We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I'm opening this issue off the back of - vercel/next.js#10142
It appears that when importing a value from another file when using pure mode an error is encountered. Example:
pure
colors.css
@value blue: #001e62;
module.css
@value blue from "../colors.css";
CLI output:
Selector ":import("../colors.css")" is not pure (pure selectors must contain at least one local class or id)
Repository with a reproducible case - https://github.com/simonsmith/next-js-css-modules-unable-to-use--global-with-css-modules
npm install npm run dev
Reproduce in tests Find a test that references :import and add options: { mode: 'pure' } to see the same output in the console:
:import
options: { mode: 'pure' }
{ should: 'not localize imported alias', input: ` :import(foo) { a_value: some-value; } .foo > .a_value { } `, + options: { mode: 'pure' }, expected: ` :import(foo) { a_value: some-value; } :local(.foo) > .a_value { } `, },
My rudimentary debugging has shown that the code checking for import in the class case is not entered, and instead we only see selector used
import
class
selector
The text was updated successfully, but these errors were encountered:
Treat :import and :export statements as pure. Fixes css-modules#21
e992820
Successfully merging a pull request may close this issue.
Hello,
I'm opening this issue off the back of - vercel/next.js#10142
It appears that when importing a value from another file when using
pure
mode an error is encountered. Example:colors.css
module.css
CLI output:
Repository with a reproducible case - https://github.com/simonsmith/next-js-css-modules-unable-to-use--global-with-css-modules
Reproduce in tests
Find a test that references
:import
and addoptions: { mode: 'pure' }
to see the same output in the console:{ should: 'not localize imported alias', input: ` :import(foo) { a_value: some-value; } .foo > .a_value { } `, + options: { mode: 'pure' }, expected: ` :import(foo) { a_value: some-value; } :local(.foo) > .a_value { } `, },
My rudimentary debugging has shown that the code checking for
import
in theclass
case is not entered, and instead we only seeselector
usedThe text was updated successfully, but these errors were encountered: