Comment by noelwelsh
2 years ago
A programming language doesn't have to be Turing complete to be a programming language. Programming languages do at least one of two things: control a machine or provide a notation for solutions to a problem. CSS is both. It controls the layout engine in the browser and it provides a declarative notation for doing so.
All programming languages need some way to provide abstraction, which means hiding irrelevant details, and composition, which means building bigger things out of small things.
CSS related examples are until recently you couldn't say "Use the main theme color" (abstraction; hiding the actual color behind a name.) You still cannot name a group of styles and reuse them, so you cannot say "the dark theme is the base theme with these colors added" (abstraction and composition). If you look at what Tailwind is, the core is just composition: being able to say "this element's style is built out of the following components". The @apply CSS extension that Tailwind provides is pure composition.
No comments yet
Contribute on Hacker News ↗