Replies: 8 comments 6 replies
-
A few notes:
|
Beta Was this translation helpful? Give feedback.
-
I understand these viewpoints but requiring the consuming developer to import the CSS for each component is a poor developer experience and kills the whole point of a self contained component. Having to import the CSS and the component means more burden placed on the consuming developer, and an extra possible point of failure just to use a component. If the library already contains the CSS all bundled up, compiled, and ready to go then there is zero burden. Having to not only make the CSS available for each component, or as a monolithic CSS file, is a burden on the library creator. It kills the simple import experience completely. In other environments the CSS for components just functions, such as in create-react-app, Storybook, and others. Not so in Remix. Remix should be able to deliver a similar "out of the box" ease of use. Whether it be with some form of automated import of the component specific CSS file or some other mechanism. Consuming developers shouldn't need to think about multiple imports to use a single self contained component. |
Beta Was this translation helpful? Give feedback.
-
See my first bullet above. These are all client only environments where dumping into the head is acceptable. This is something we've deemed unacceptable in Remix as it breaks a lot of things:
We are planning to release an example of how you could piece together your own bundler requirements with Webpack while still utilizing Remix conventions / libraries. Sounds like this is what you want. |
Beta Was this translation helpful? Give feedback.
-
UX > DX |
Beta Was this translation helpful? Give feedback.
-
We have an |
Beta Was this translation helpful? Give feedback.
-
@jacob-ebey I am also stuck here, we have an in-house component library that internally uses Ex:
Now if i try to use component lib in remix app it's falling |
Beta Was this translation helpful? Give feedback.
-
I think that it’s a valid point that to use some of the most well known UI React libraries in remix (spectrum, chakra, mui, antd?) is at best convoluted and at worst (spectrum) impossible. I very much understand why it’s so and very good reasons behind remix design. But it’s still very frustrating. I am also not sure what is the recommended way for authors of component libraries to ship css in a way that doesn't require to manually deal with each component css. I guess the solution might be one of the newer css-in-js at build time solutions... But I am not sure how it supposed to plug in to remix compiler to emit the right css for each route. |
Beta Was this translation helpful? Give feedback.
-
Can you guys please fix this issue? Resistance is futile. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What version of Remix are you using?
1.7.5
Steps to Reproduce
Import any React components library that doesn't have all its CSS inlined. Where components use standard *.css file imports for example.
How are we to use Remix and leverage component libraries when something as basic as CSS doesn't function as it does under most standard React contexts? Are we seriously to return to generating monolithic CSS files?
Are React component libraries required to adapt to include some form of build artifact or component architecture to adapt when in a Remix context? That's a heavy burden to place on component creators.
It definitely feels bad that Remix hasn't been built to function with existing React component libraries out of the box.
It would be great to have greater transparency into what the Remix team is doing to address this massive functionality gap. The community wants to help but we need more information please.
Expected Behavior
Importing and using a React component should render using its imported CSS that is built into the component.
Actual Behavior
Component styles are not included at all even though they are part of the ESM/CJS module.
Beta Was this translation helpful? Give feedback.
All reactions