-
Notifications
You must be signed in to change notification settings - Fork 43
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
suggestion: Component scoped Styling #26
Comments
I've thought about this, but it also creates the opposite pain for consumers who want to use Bulma to style their entire app. They would have duplicated styles coming from Svelma that would have to be processed to remove the duplicates if they're importing all of Bulma elsewhere. I'm open to a solution that doesn't create pains for both sides. |
A solution i would suggest is dividing the CSS while writing, at start you have the original Bulma CSS file. First, we would create a CSS file which will contain simple classes (mainly animation key frames and color stylings) and non-generic classnames (will not include "title" and "container" for example). Afterwards, remove these stylings from the original Bulma CSS file. Also, remove component specific stylings from the original Bulma CSS file and include then within the component. after doing this process we would wind up with 2 CSS files: one that has the simple non-intrusive CSS (keyframes and color) and another CSS file which will include the remainder of the stylings of Bulma (HTML element specific and generic classes). combined ( simple CSS file + remainder of stylings + component specific CSS) we would have decomposed Bulma into componenet specific CSS and HTML element specific CSS. shoud a developer want to use only components styling he would import only the simple CSS class. I think this solution would solve the issue at hand. Thought it would be a hassle to decompose the whole CSS file element by element but this would dramatically improve developers experience. |
Sounds like an awful lot of work. Maybe once the core components are all added we can look at doing this; or if someone wants to take it on themselves I'm for it. |
Hello, I would like to ask/suggest why not make the styling scoped just for the component rather than importing the whole Bulma css file.
making the styling scoped will be more useful for implementing one component of Svelma. Currently using Svelma would imply using all of Bulma built-in css styles (mainly css which targets HTML elements: body, h1, html will give developers a headache)
The text was updated successfully, but these errors were encountered: