It's even worse than it appears.
Tuesday, October 9, 2018
There’s this great line at the end of an episode of Law & Order. Jack McCoy says the person who was convicted got a tough sentence. The DA, an old man, says when he gets out he’ll be 35. “I’d take it,” he said. When a young cute person mocks others’ pain, I think of this story.#
I found a perfect use-case for CSS variables. Bootstrap hard-codes the size of <h4> elements at 17.5 pixels. In the editor I'm developing, the default size is 18px. I find it's the most readable size for editing. Anyway, when you put a small head in the text using <h4> the text is actually smaller than the surrounding text. Not good. Enter CSS variables. Declare --normal-font-size as 18px, override Bootstrap's idea of the size of <h4>, and use the same variable in defining the size of all the other text. That way the relationship is clear in the code, and if we ever want to change the size of normal text, it's easy to do. This is progress. Code just got more maintainable. 👍#

© 1994-2018 Dave Winer.

Last update: Tuesday October 9, 2018; 4:27 PM EDT.