Is there a limit for CSS variable count?
How many will be enough or start to cause some performance problems?
5 Replies
From what I've been told, you can cause performance issues, but it has to be a lot.
Also, that was a year or so ago, so things might have been improved since then.
If I do remember correctly, custom properties are optimized when they're on the
:root
, and if they're never changed.a lot is more than 100? 200? 500?
A lot was in the thousands 😄
ou... for me 100 seems a lot
@Kevin maybe you know some good articles about css variables? how to decide what to set as a variable?
Is this ok - or not?
Personally, I like the second option.