Opinion: Leptos should ship with an opinionated CSS solution, preferably support for component scoped CSS, a la, CSS modules #1970
Replies: 2 comments 3 replies
-
Just to nitpick: I think what you mean is that we don't provide an alternative to native CSS out of the box. Using plain CSS (or using SASS) is actually the best Leptos experience, because CSS files immediately reload as you edit and save them. But I think you're talking about component-scoped CSS a la Angular, Svelte, or Vue, none or which are "native CSS" for what it's worth. |
Beta Was this translation helpful? Give feedback.
-
I think just like React has EmotionJS, StyledJS, etc. libraries for styling react components, and Rust people tend to use tokio even though its not official, it's good to let community libraries provide options for different ways of handling styles in your app. Having an "official" way in Leptos wouldn't be bad, but I think there would be more benefit letting community libraries provide options for developers. |
Beta Was this translation helpful? Give feedback.
-
The whole point of a component based web framework is to let developers encapsulate UI into composable pieces that can be reused and composed independently. And styling is an integral part of that puzzle.
Having to stitch together community maintained styling solutions to have a coherent developer experience is counter-productive.
Cargo-leptos which is currently the meta-framework for Leptos ships with defaults for using Tailwind CSS but falls short when it comes to using native CSS out of the box.
I propose that we allocate some effort into setting up a basic mechanism to change this. The lowest hanging fruit to tackle this seems to be adding support for scoped CSS natively in the framework that works out of the box without the dev having to cobble together a half baked solution that falls apart every time any of the depencies in the toolchain updates.
11 votes ·
Beta Was this translation helpful? Give feedback.
All reactions