-
Notifications
You must be signed in to change notification settings - Fork 27
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
Needed styles for elements #116
Comments
I'm a bit unsure of this one personally. Can we specify this in a meaningful way? I see you proposed adding And what exactly would the field mean? That the stylesheet has to be included in the main page, or in a shadow root? The answer depends on if the stylesheet only defines inheritable properties on I feel like this is information that's best for unstructured documentation for the moment. I realize you have a tool and probably want to add the stylesheet automatically, but we'd need to specify this in a way that isn't too specific to how Shoelace does things at the moment. Other libraries may do something differently, and Shoelace/Web Awesome might do something different in the future. cc @claviska and @KonnorRogers because this automated use is an interesting case. |
Yea it doesn't seem to fit in with the overall format of We use an external stylesheet for a couple of utilities and mainly for CSS vars / themeing. Stylesheets are kind of optional tbh, as the components should still function without them, they just wont have proper tokens / styling. I don't have a good answer here, but maybe As for contents, it could be a number of things which is tricky, it could be a package like Open Props , it could be a URL, or a local path. I think unstructured makes sense to me, since it seems "external" to the elements themselves, but 🤷♂️ EDIT: I guess the trouble here is if you look at something like Enhance.dev or WebC , the external stylesheet can actually be really important because IIRC they "scoop" all of the |
In a perfect world, theme stylesheets would be optional and we'd use custom property fallbacks in every component for a basic, functional appearance. Alas, that's cumbersome in the code and it creates competition with the default theme. Not to mention I don't think many people would want a barebones component library they have to restyle completely themselves — that's why we provide a simple, clean look with the default theme, which is technically optional. But even if we used fallbacks, the library would have to use primitive color values (kinda tough to maintain across dozens of components) or it would need to include a base set of design tokens for consistency (at which point we're competing with our own theme's tokens). For this to be useful, we'd have to identify the many ways stylesheets are and can be used in custom elements and account for them. I suspect a "recommended" property would be useful for Shoelace in its current form, if only for tooling to help users install it. |
For example, shoelace elements need a stylesheet, so they display something.
Could we create a way to link to the needed styles wich should be loaded for a component?
The text was updated successfully, but these errors were encountered: