Stakeholders of styling
Tags: css, stakeholders, influence, web
Published: 2021-11-07 07:47:55

---
title: Stakeholders of styling
published: true
date: 2021-09-13 14:48:18 UTC
tags: css,stakeholders,influence,web
canonical_url: https://adactio.com/journal/18454
---

When [I wrote about the new `accent-color` property in CSS](https://adactio.com/journal/18442), I pondered how much control a web developer should have over styling form controls:

> Who are we to make that decision? Shouldn’t the user’s choice take primacy over our choices?
> 
> But then again, where do we draw the line? We’re allowed over-ride link colours. We’re allowed over-ride font choices.

Ultimately, I came down on the side of granting authors more control:

> If developers don’t get a standardised way to customise native form controls, they’ll just recreate their own over-engineered versions.

This question of “who gets to decide?” used to be much more prevelant in the early days of the web. One way to think about this is that there are three stakeholders involved in the presentation of a web page:

1. The author of the page. “Author” is spec-speak for designer or developer.
2. The user.
3. The browser, or user agent. A piece of software tries to balance the needs of both author and user. But, as the name implies, the user takes precedence.

These days we tend to think of web design a single-stakeholder undertaking. The author decides how something should be presented and then executes that decision using CSS.

But as [Eric](https://meyerweb.com/) once said, every line of you CSS you write is a _suggestion_ to the browser. That’s not how we think about CSS though. We think of CSS like a series of instructions rather than suggestions. Never mind respecting the user’s preferences; one of the first things we do is reset all the user _agent’s_ styles.

In the early days of the web, more consideration was given to the idea of style _suggestions_ rather than _instructions_. Heck, users could always over-ride any of your suggestions with their own user stylesheet. These days, users would need to install [a browser extension](https://userstyles.org/) to do the same thing.

[The first proposal for CSS](https://www.w3.org/People/howcome/p/cascade.html) had a concept called “[influence](https://adactio.com/journal/17272)”:

> `h2.font.size = 20pt 40%`
> 
> Here, the requested influence is reduced to 40%. If a style sheet later in the cascade also requests influence over h2.font.size, up to 60% can be granted. When the document is rendered, a weighted average of the two requests is calculated, and the final font size is determined.

I think the only remnant of “influence” left in CSS is accidental. It’s in the specificity of selectors …and the `!important` declaration.

I think it’s a shame that user stylesheets are no longer a thing. But I get why they were dropped from browsers. They date from a time when it was mostly nerds using the web, before “regular folks” came on board. I understand why it became a little-used feature, suitable for being dropped. But the principle of it still rankles slightly.

But in recent years there has been a slight return to the multi-stakeholder concept of styling websites. Thanks to `prefers-reduced-motion` and `prefers-color-scheme`, a responsible author can choose to bow to the wishes of the user.

I was reminded of this [when I added a dark mode to my website](https://adactio.com/journal/15941):

> Y’know, when I first heard about Apple adding dark mode to their OS—and also to CSS—I thought, “Oh, great, Apple are making shit up again!” But then I realised that, like user style sheets, this is one more reminder to designers and developers that they don’t get the last word—users do.