TL;DR: a living HTML/CSS standards doc works because it's short, lives next to the code, and gets enforced by tooling rather than memory. Five rules that catch most real diffs beat fifty nobody reads. Store it in the repo, wire it into linting and CI, and revisit it: a doc nobody edits is already dead.
Here's the failure mode, and almost every team has lived it: two developers build the same kind of component six weeks apart, and each one marks it up differently: one reaches for a <div> grid, the other for semantic <section> elements with different class names for the same visual pattern. Nobody notices, because both versions render fine. Then a redesign touches both components at once, and the person doing the work discovers there isn't one pattern to update. There are two, with no shared vocabulary between them. This gets sharper the moment a team scales past the people who wrote the original code, whether that's new hires or outsourcing web development to cover a sprint spike. Nobody inherits tribal knowledge; they inherit only whatever's written down.
When the only record of "how we write markup" is in the original author's memory, three things degrade in order. First, review friction: a reviewer flags a pattern as wrong, the author pushes back because nobody wrote down that it is wrong, and the disagreement eats a review cycle a one-line doc reference would have closed in seconds. Second, onboarding drag: a new developer, hired or brought on for a few weeks of extra capacity, has no way to match house style except by reading as much of the existing codebase as they can before their first pull request, and they'll usually guess wrong on a few conventions. Third, slowest to show up: the codebase itself drifts until "consistent" only describes the oldest third of it.
None of this is about taste. A team that never writes its rules down can still ship working software. The cost shows up later: as review time, as a redesign normalizing years of divergent markup at once, and as every new contributor relearning conventions by trial and error.
The temptation is to write an exhaustive style guide: every tag, every property, every edge case. Don't. A 50-rule document gets opened once and never again. Pick the five or six rules that actually show up in your diffs, specific enough that a reviewer can link to them instead of re-explaining them. Three worth having on day one:
block__element--modifier is the common default), with a one-sentence rule plus a good/bad example. The scheme matters less than everyone using the same one.class, then id, then data attributes, so diffs show the change, not a reviewer's reshuffle.What doesn't belong: full component architecture tutorials, a restatement of the CSS spec, or anything a linter already enforces automatically: if the tool catches it, the doc doesn't need to repeat it. Its job is to cover the judgment calls a linter can't make.
A standards doc on a wiki gets written once, linked in an onboarding email, and never opened again. Nobody opens a separate tool mid-pull-request to check a rule. The fix is to put it where developers already are: a CONVENTIONS.md or a section of the repo's README.md, versioned with the same pull requests that change the conventions. Pair it with an .editorconfig file for the mechanical stuff (indentation, line endings, trailing whitespace) so formatting is enforced before anyone looks at the diff.
The test for whether a doc is actually alive: can you point to a pull request in the last month that changed it? No answer means it's a wiki page with extra steps.
Writing the doc is the easy half; the rules that survive are backed by tooling, not goodwill. A practical enforcement stack, roughly in order of effort:
A linter without a written doc behind it just enforces whatever the default config says. Nobody chose those rules on purpose, and nobody can explain them to a new contributor. A doc without enforcement is a suggestion. You need both: the doc explains why, the tooling makes the what non-optional.
This is where a written standard pays for itself fastest. A new hire who spends their first week reading old pull requests to reverse-engineer house style is productive in week three. A new hire, or an outsourced developer brought in to cover a deadline, handed a short, enforced CONVENTIONS.md on day one can pass review on day one, because the standard, not a senior developer's availability, is what their first diff gets checked against. That's the difference between "they'll pick it up eventually" and "they're productive this sprint."
It also changes what review is for. Instead of re-teaching house style on every new contributor's pull request, a senior developer can focus on logic and architecture, because formatting and naming were already settled before the diff ever opened.
Fewer rules, but still written down. Three people who've worked together for years can hold conventions in their heads, until one is out for two weeks or a fourth joins, and that shared memory stops transferring. A half-page doc covering your two or three actual recurring disagreements saves the first onboarding conversation entirely.
Keep them separate, or clearly sectioned. HTML/CSS conventions and JS conventions get violated in different ways and enforced by different tools. One sprawling document gets skimmed instead of read; two focused ones get opened for the specific question someone has.
Whenever a recurring review comment shows up that the doc doesn't already cover. That's the real signal, not a calendar date. If reviewers keep flagging the same thing, that's a missing rule, and it goes in during that sprint.
Pull the last 10–15 code review comments that weren't about logic: naming, formatting, element choice. Those are your actual house rules, just not written down yet. One sentence plus a good/bad example per rule gets you a working first draft in under an hour.
No. A linter enforces whatever it's configured to enforce, and most teams never audit whether that configuration was an intentional decision. The doc records why a rule exists; the linter makes sure nobody skips it. You need both, not one standing in for the other.
Write the disagreement down as a decision, not a debate that reopens every time it comes up. Pick one option, document the reasoning in a sentence, and treat it as settled until someone brings new information, not just a renewed preference.
None of this requires a committee or a quarterly audit. A standards doc earns its place by being short enough to read, specific enough to settle real disagreements, close enough to the code that someone opens it, and backed by tooling so the rules hold when nobody's checking by hand. Teams that get this right stop re-litigating the same markup questions every few weeks. That's the return on the hour it takes to write the first version. For further reading on the conventions this kind of doc usually codifies, see the MDN HTML reference and CSS Guidelines.