Functional CSS

What is it?

it makes HTML powerful enough to define its style not just content.

It usually has tons of basic classes for typeography, spacing, color, grid systems, and more. They tend to have obvious names like .red or .hide align many use shorthand like .dn for display none.

For convincing on why this is important, read this article by John Gold. Don't just skim it, read the whole thing, every word.

Problem with CSS

originally for "style sheets" aka: you want the same content to look different depending on the theme

cascading was supposed to be awesome at styling components in complex ways. Unfortunately it accomplished that was "complex", in the bad sense, and lead to hard to debug code (where is this style coming from? How do I override it?)

CSS was created with this assumption that the style was more likely to change than the HTML. That you where more likely to retheme HTML than add a new type of UI. That's a bad bet. Rethemes happen, just not very often. HTML is not usually set in stone either.

Pros:

Cons:

Tags: css, functional-programing


Backlinks: