The question of whether CSS counts as a programming language tends to enter public discussion with motives attached that have little to do with language taxonomy. It gets used to defend or unsettle the standing of CSS specialists, which is a large part of why the debate rarely produces anything useful.

What the answer would actually change

Suppose the industry settled on a clean boolean. If true, does pay get normalized across all web workers? If false, do CSS specialists deserve pay cuts? Would mutual respect suddenly appear, or would CSS people be relegated to eating lunch in the boiler room? The answers to those questions seem doubtful, and that is the real argument against holding the discussion at all.

The stakes are asymmetric in both directions. Proving CSS is not a programming language lets someone keep feeling superior about their "real" programming skills and rationalize being paid more than a front-of-the-front-end developer who specializes in CSS, which preserves the status quo. Proving it is one could shift a company or the wider industry toward equal respect and pay, which breaks the status quo. Either way, a technical verdict is being recruited for a workplace argument.

Programs execute, don't they?

A common objection holds that most people will not accept CSS as a programming language because programs execute. JavaScript qualifies without dispute on exactly that basis: write code, then run it.

> node my-program.js

That program executes. Printing "Hello, World!" to a terminal takes console.log("Hello, World!");.

CSS, the objection goes, cannot do that — except it can. Writing body::after { content: "Hello, World!"; } into style.css and opening a page that loads the file produces output. CSS executes in its own way. The distinction that matters is that it is a domain-specific language (DSL) and not a general-purpose language (GPL). Within the browser context, the mechanism that tells CSS to run (<link>, usually) is not so different from the one that tells JavaScript to run (<script>, usually).

Programming concepts mapped onto CSS

Comparisons between CSS syntax and programming constructs are not hard to find:

  • A selector functions somewhat like an if statement that loops over matches.
  • calc() is a direct implementation of math.
  • A group of media queries resembles a switch.
  • A custom property holds state.
  • :checked supplies a boolean.

CSS is also typed, and it is full of functions. The syntax has been discussed in those terms before.

The Turing-completeness angle

For anyone trying to settle the question, Turing completeness is a reasonable proxy. One college professor had long told students that CSS is not Turing complete but is now reconsidering that position upon learning otherwise. Whatever the intention behind such teaching, computer science professors shape what computer science students carry into the industry year after year.

Lara Schenck has examined this angle in depth. CSS basically is Turing complete, via the cellular automaton angle of Rule 110, though not entirely on its own; the construction leans on selectors and :checked. Her summary of the distinction is the precise one:

Alone, CSS is not Turing complete. CSS plus HTML plus user input is Turing complete!

None of that obliges anyone to feel that CSS is a programming language. It is too declarative, too application-specific. That reaction is understandable. What matters is that whatever conclusion a person reaches does not influence things that actually count, like pay and respect.

Keeping the question separate from the people

The same separation applies elsewhere in the industry, as with "website" versus "web app": regardless of whether the distinction is real, users should not be affected by which taxonomic bucket someone decides a project belongs to.

Respect is in order no matter how the question is answered — along the lines of "I don't consider CSS a programming language, but it doesn't mean I think it's trivial or that my specialist co-workers are any less valuable than my Python specialist co-workers." Or: "I think there is an interesting distinction between declarative markup languages and other types of languages, but they are all code." Nuanced, respectful, agenda-less comments of that kind are what these discussions need far more of.