3 ms·
> (rip cache) You'd have a separate theme.css that defined the new variables. Because of CSS variables you can keep the main style.css and all the markup the s
by rriepe 6y ago
> (rip cache)
You'd have a separate theme.css that defined the new variables. Because of CSS variables you can keep the main style.css and all the markup the same.
- bawolff 6y agoTrue, but you still cant do first paint until all css is loaded, and for people with fast connections, the latency of the extra roundtrip matters more than the size of the file downloaded (within reason)
- rriepe 6y agoYeah you'd have to load it in async to avoid that. You could start with a gray base and have the theme color pop in. Flash of original color.
- bryzaguy 6y agoAn alternative would be keeping theme state in JS as suggested at the end of the article which improves the cache-ability of the css file as themes change.