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

CSS variables forced in style prop #10

Open
ppo opened this issue Mar 28, 2020 · 1 comment
Open

CSS variables forced in style prop #10

ppo opened this issue Mar 28, 2020 · 1 comment

Comments

@ppo
Copy link

ppo commented Mar 28, 2020

Wouldn't it be better to define the default value of the CSS variables in the CSS file and to not define them via the style prop?
That way, it's easy to modify them in another CSS file (without having to use !important).
If styling props are passed, define them individually via style.

@alex996
Copy link
Owner

alex996 commented Jul 27, 2020

I'd gladly pass props directly through style; however, it's not always that easy because some spinners have multiple levels of children. If those props gets assigned to each child div, then customizing them with your own CSS class would be a nightmare (it's already quite involved in the source CSS).

Basically it comes down to: if you want to customize color, size, or thickness - pass those as props. In fact, I would very much prefer that everything (or as much as possible) is customizable with props only. If you need to change something that currently isn't exposed as a prop (e.g. margin), then passing your own CSS class is the way to go. So, depending on your situation, at least for now, you may want to use both.

What was your use case for a custom CSS class, may I ask? I could add those styles as props, so you wouldn't have to pass it.

I moved CSS var defaults from JS to CSS by the way (see v4.0.0). Not sure if this addresses your points, but let me know if I missed something. Thanks

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

No branches or pull requests

2 participants