Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

deprecating the current usage, and make it follow official CSS Module spec #58

Closed
trusktr opened this issue Sep 1, 2023 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request experimental

Comments

@trusktr
Copy link

trusktr commented Sep 1, 2023

Here's how the standardized CSS Module spec works:

https://web.dev/css-module-scripts

The import does not return CSS class names, but a CSS style sheet.

It could be possible to provide a utility that gets the class names from the sheet, and even modified the class names in the CSS OM, and it could also be possible to do at build time. With this idea, the default behavior would be as the CSS Module spec, but then some options could be specified to opt into the non-standard behavior.

The standard behavior would be more useful for vanilla custom elements and aligned with future direction of web, but the opt-in CSS name handling could be more useful for systems like React, Preact, Solid.js, etc.

@trusktr trusktr changed the title deprecating the current usage, and make it follow actual CSS Module spec deprecating the current usage, and make it follow official CSS Module spec Sep 1, 2023
@indooorsman
Copy link
Owner

indooorsman commented Sep 4, 2023

That module I think is totally different with the one in css modules.
As mentioned in https://web.dev/css-module-scripts I think it's just like a normal export of esm without any changes to class names.
However it's a cool idea, I will have a try, thanks @trusktr !

@indooorsman indooorsman self-assigned this Sep 4, 2023
@indooorsman indooorsman added the enhancement New feature or request label Sep 4, 2023
@indooorsman indooorsman pinned this issue Sep 4, 2023
@indooorsman
Copy link
Owner

@trusktr after some investigation I found that import assertion has been deprecated and there's another propsal using with instead of assert https://github.com/tc39/proposal-import-attributes and esbuild hasn't implemented this feature.

Repository owner locked and limited conversation to collaborators Nov 30, 2023
@indooorsman indooorsman converted this issue into discussion #66 Nov 30, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request experimental
Projects
None yet
Development

No branches or pull requests

2 participants