3 ms·
I just took a look at how this demo was implemented. The first swatch has a hardcoded inline CSS style for the gradient, and all the rest are filled in by some
by Retr0spectrum 9y ago
I just took a look at how this demo was implemented. The first swatch has a hardcoded inline CSS style for the gradient, and all the rest are filled in by some JavaScript on page load, based on the HTML tags that annotate each swatch.
I'm curious for a couple of reasons. Why hardcode the first CSS style, and generate the rest? If you're going to the effort of dynamically generating the CSS styles, why not have the actual dataset stored in JSON or another easily ingestible format, rather than in cumbersome HTML tags?
- kvz 9y agoWithout having checked, perhaps the result of (webpack) critical (plugin)?