Replies: 5 comments 17 replies
-
I wonder if adding support for css modules could also open up support for vanilla-extract. There is a discussion about this in vanilla-extract. Vanilla extract does use a babel-plugin which is another problem. |
Beta Was this translation helpful? Give feedback.
-
Any updates on this? Really eager to try remixing vanilla-extract 🤣 |
Beta Was this translation helpful? Give feedback.
-
I would really, really like to move to remix, but this is a huge barrier for me. I'm considering developing a workaround, but would love to see this available out-of-the-box. I think adoption would soar from existing React projects that already utilize it. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/orgs/remix-run/projects/5/views/1 |
Beta Was this translation helpful? Give feedback.
-
Formalized in #4542 |
Beta Was this translation helpful? Give feedback.
-
CSS Modules are a widely used method for dealing with scoped selectors in JavaScript projects, and in React they are often used as the basis for component-level styles. Many frameworks support them out-of-the-box, and Remix plans to do the same.
This discussion will be used to track the development of CSS Modules support as it is implemented. There are several pieces to the CSS Modules puzzle, and we'll likely roll out support for them in phases.
Another thing to consider is our approach in loading styles on the page. Many frameworks accomplish this by injecting a
<style>
tag into the head of the document as CSS modules are discovered (this may happen on the client or on the server). We prefer to generate static stylesheets, as static assets are easier to cache and this approach aligns more closely with our philosophy overall (more on that here). We could either generate a single stylesheet with all module styles defined in one place, or we could generate one stylesheet per route since we'll have the data for CSS Modules in the assets manifest. In the beginning we're likely to start with a global stylesheet as it simplifies both the implementation and the user API.For reference: https://github.com/css-modules/css-modules
More to come, and questions/feedback welcome. 🚀
Beta Was this translation helpful? Give feedback.
All reactions