-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add headless prop to remove default classes #248
Conversation
I think what people usually expect from Perhaps we should be more surgical about which styles we disable in Screen.Recording.2023-07-06.at.3.15.53.PM.mp4 |
Well yes, that's intended behaviour. If you really want to style it with the tailwind(or other similar framework), usually that does mean that you NEED to style it. But I see options here:
|
Separating layout and design CSS is probably a bit of work but actually seems like a really good idea to me. If we manage that, we could even consider making the unstyled version the default. In that case, we should rename the prop to, say, ui: 'styled' | headless' | 'bare' = 'styled' where
I don't use tailwind myself but if you'd like to contribute such an example, that'd be much appreciated! 👍 |
Even better might be to make a base headless component and decorator components with styles. |
Hmm... not sure. I expect the savings from excluding design CSS to be minimal. On the other hand, IIRC the Svelte Compiler has difficulty optimizing But I'm happy to be convinced otherwise on both points. |
@janosh makes sense. Also, it would be a huge rewrite to do it that way. Maybe even easier to make headless from scratch. I think for now adding example tailwind classes and keeping a "headless" prop would be good enough for most use cases. If you agree I will add example tailwind classes for people to start from. |
Sure, go ahead. |
Turns out that to make it work properly with a tailwind, it needs changes to the HTML structure. Also there are over CSS that doesn't have props for it. I guess this is all starting to be too complicated and not worth it. To make something headless it needs to be designed that way from the beginning. I think we can mark this as a failed experiment and close this PR. |
No worries. Thanks for documenting your conclusion. |
Closes #247.
Summary of major changes
Todos
Checklist
[] has tests (only needed if any new functionality was added or bugs fixed)
[] has examples/docs (only needed if any new functionality was added)