I am using css modules with Sass in next.js and I got this error
:global {
.slick-track {
display: flex; // Syntax error: Selector ":global .slick-track" is not pure (pure selectors must contain at least one local class or id)
}
}
This is as identical as the official css-modules doc example but with Sass instead of Less but in Sass syntax this should be working.
I saw this question but it was using a tag whereas I am using a class so it should be pure.
When I add ()
to :global it won't pop error but the style is not applying (You cannot find this style in browser console)
:global() {
.slick-track {
display: flex; // No error, but style not working
}
}
For this scss file it does not have any dependency (@import @use
etc.) but I think it is not the case.
I try adding a custom postcss.config.js
according to this but not working either.