Skip to content
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

Open
OmG3r opened this issue Sep 9, 2019 · 3 comments
Open

suggestion: Component scoped Styling #26

OmG3r opened this issue Sep 9, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@OmG3r
Copy link

OmG3r commented Sep 9, 2019

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)

@c0bra
Copy link
Owner

c0bra commented Sep 9, 2019

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.

@c0bra c0bra added enhancement New feature or request waiting-reply Waiting for a reply labels Sep 9, 2019
@OmG3r
Copy link
Author

OmG3r commented Sep 9, 2019

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.
shoud a developer want to use all of Bulma styling he would import both the simple CSS file and the file that includes the remainder of the CSS.

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.

@c0bra c0bra removed the waiting-reply Waiting for a reply label Sep 12, 2019
@c0bra
Copy link
Owner

c0bra commented Sep 13, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants