Skip to content

Why using CSS variables, instead of inline styles? #93

Answered by roginfarrer
cvle asked this question in Q&A
Discussion options

You must be logged in to vote

Using CSS variables allows you to use conditions that are not possible with inline styles. Conditions like media queries or pseudo selectors. Also if you combine the use of CSS and inline styles, the inline styles will always have a higher specificity than styles applied by classes, making the CSS not work.

One optimization this library could make is to use inline styles if no conditions are configured. Would need to fully think through the ramifications of that, though.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cvle
Comment options

Answer selected by cvle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants