Open BeeMargarida opened 1 year ago
Currently doing a POC in a SK project with Panda
would it be viable to style components using css in the svelte files in <style>
tags, and having shared .css
files for common theme styles, and allowing users to inject styles inline using the style
prop? Would this significantly reduce the bundle size by not requiring a runtime library?
Right now, without using any runtime library, the only way to override in <style>
with be with :global()
, since svelte does not provide any other way. One of the things we are exploring is to pass css variables as props (svelte allows this), but we still want to enforce the theme (so passing a blue with result in using our color variable for blue600, for example). This is still in POC phase, since we want to maintain the same feature set, even if the style API totally changes
Another possibility would be vanilla-extract.
What about using SUIT CSS naming convention and SASS in component <style>
tags? Then users could import a global stylesheet via JS import
statement in the layout, which could override needed parts. The naming scheme would make it clear what class belong to what component.
Also, as it would not depend on external library, but Svelte built-in solution, it would reduce the risk of having to refactor again in case a 3rd party styling library is selected, and it gets abandoned.
Necessary since Stitches is now not being currently maintained.
Current Options: ✅ PandaCSS 🚫 Emotion 🚫 Styled Components 🚫 Linaria