-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
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
Update docs for new CSS modules features #1028
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/languages/css.md
Outdated
{% endsamplefile %} | ||
{% endsample %} | ||
|
||
To reference a global variable, use the `from global` syntax: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to declare a global variable in a CSS module asset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, you'd have to do it by importing a non-css module. I can note this
src/languages/css.md
Outdated
|
||
{% warning %} | ||
|
||
**Note**: CSS grid line names can be ambiguous due to automatic postfixing done by the browser, which generates line names ending with `-start` and `-end` for each grid template area. When using CSS grid, ensure that your `"pattern"` configuration ends with the `[local]` placeholder so that these references work correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Doesn't parcel-css throw an error if the user didn't respect this? Then I'd rather phrase this as "When using CSS, your pattern configuation has to end ... "
src/languages/css.md
Outdated
### Enabling CSS modules globally | ||
|
||
By default, CSS modules are only enabled for files ending with `.module.css`. All other CSS files are treated as global CSS by default. However, this can be overridden to enable CSS modules for all files by configuring `@parcel/transformer-css` in your project root `package.json`. | ||
By default, CSS modules are only enabled for filenames ending with `.module.css`. All other CSS files are treated as global CSS by default. However, this can be overridden to enable CSS modules for all source files (i.e. not in `node_modules`) by configuring `@parcel/transformer-css` in your project root `package.json`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can CSS modules be enabled for a filename?
Maybe "for files whose name ends with"?
Docs for parcel-bundler/lightningcss#180, parcel-bundler/lightningcss#183, and parcel-bundler/parcel#8122