---
name: techboidesign-techboi-web-rules
title: techboi web rules
kind: skill
version: 1.0
description: >
  Alejandro Alvarez's house rules for building websites in plain HTML and CSS —
  mobile first, BEM classes, cascade layers, tokens, one column grid, CSS-first
  interaction, calm motion, accessibility. Use when building, refactoring or
  reviewing a static site, landing page or HTML/CSS component.
updated: 2026-12-03
authored_by: Techboidesign
author_url: https://github.com/Techboidesign
source_url: https://github.com/Techboidesign/skill-pack/tree/HEAD/skills/techboi-web-rules
brought_by: kt
license: MIT
---

# Techboi Web Rules

Read [references/WEB-RULES.md](references/WEB-RULES.md) in full before writing any code. The look changes per project; the way of building does not.

## Non-negotiables
1. **Minimal code.** Fewest lines that fully work.
2. **Classes on every block** (short BEM). Never select by position (`:nth-child`) or element chains (`body > header > a`) or ids.
3. **Mobile first.** Base CSS = phone; `min-width` at `48rem` and `64rem`. No `max-width` queries.
4. **Cascade layers:** `reset, base, components, utilities`. Every rule in a layer. No `!important`.
5. **Tokens, not magic numbers.** Same token names every project (`--bg`, `--fg`, `--accent`, `--cols`, `--gap`, `--text-*`, `--dur*`, `--curve*`).
6. **Grid is the layout.** Every `.section` sits on `repeat(var(--cols), minmax(0, 1fr))`.
7. **CSS first, JS when worth it.** Radios + `:checked`/`:has()`, `<details>`, `:target`, view transitions. JS = small `defer` file in `scripts/`, no inline JS, page works without it.
8. **Motion is fast, minimal and optional.** Follow `techboi-motion`: ≤ 300ms, one axis, hovers in `@media (hover: hover)`, movement only in `prefers-reduced-motion: no-preference`.
9. **Accessible by default.** Visible `:focus-visible`, contrast ≥ 4.5:1, labels on every input, unique ids.
10. **Semantic HTML, no cards inside cards, comments explain why.**

## Before hand-in
Run the `techboi-web-validation` skill (automatic `check.sh` + W3C validators + manual browser checks).
