CSS Custom Properties and Theming

We posted not long ago about the difference between native CSS variables (custom properties) and preprocessor variables. There are a few esoteric things preprocessor variables can do that native variables cannot, but for the most part, native variables can do the same things. But, they are more powerful because of how they are live-interpolated. Should their values ever change (e.g. JavaScript, media query hits, etc) the change triggers immediate change on the site.

Cool, right? But still, how actually useful is that? What are the major use cases? I think we're still seeing those shake out.

One use case, it occurred to me, would be theming of a site (think: custom colors for elements around a site). (more…)

Free, faster.

Ethan Marcotte, on time- and budget-constrained organizations websites:

Between the urgency of their work and the size of their resources, spending months on a full redesign isn’t something they can afford to do. Given that, a free theme for, say, WordPress can yield a considerable amount of value, especially to budget-constrained organizations. They can launch their redesign more quickly, and continue reaching the people who need their information most.

So Ethan takes a look at a bunch of free themes, so at least a responsible choice can be made there, and finds

the results were surprising: on a 3G connection, the slower themes I tested took anywhere from 45-90 seconds for any content to appear. In other words, the pages took roughly a minute before they were usable.

Pretty rough.

What I find particularly scary is that these are just empty themes. I usually attribute the slowness of sites in this category (off the shelf, slap-a-CMS on it) to be what happens on top of the theme. Stuff like uploading too many/too large of images and installing a million plugins that load their own set of resources.

I think it shows off some recent technology in a new light: saving us from ourselves. HTTP/2 makes concatenating resources less important, and that's saving us from ourselves and those million plugins individual CSS and JavaScript files. WordPress does responsive images by default now, that's saving us from ourselves and ensuring we aren't loading more image than we need. AMP, as a technology, is saying y'all have lost the plot here and we need to save you from yourselves.