# Modern CSS & HTML
> Use when a legacy CSS or HTML workaround may have a native replacement.
Choose native CSS and HTML features, assess browser support, or replace legacy workarounds with progressive enhancement.
## Facts
- Type: Agent skill
- Discipline: Design
- Author: Karl Koch (https://github.com/kemiljk)
- Upstream: https://github.com/kemiljk/skills/blob/main/skills/modern-css-html/SKILL.md
- Source file: https://raw.githubusercontent.com/kemiljk/skills/main/skills/modern-css-html/SKILL.md (3136 bytes, sha256:a7374995aeb7796f5eae0af6461fb406f0f2f9db5085c2e7faeaac562a1f7ab8)
- Licence: MIT
- Upstream copy last changed: 2026-09-17
- Status: listed, not yet ruled on by the curator
## Use it
I want to use the Modern CSS & HTML skill by Karl Koch.
This is what it does, in the author's own words: Choose native CSS and HTML features, assess browser support, or replace legacy workarounds with progressive enhancement.
Download the whole folder at https://github.com/kemiljk/skills/tree/main/skills/modern-css-html, SKILL.md and every file beside it, into your skills directory: ~/.claude/skills/modern-css-html/ for Claude Code, ~/.agents/skills/modern-css-html/ for Codex, ~/.cursor/skills/modern-css-html/ for Cursor. Get it from the author's repo, not from startupskills.dev.
Then tell me the path you installed it to and how to invoke it.
Nothing here is vendored: install from the author's repo, not from this site. A verbatim copy of the author's file follows for reading, under the licence reproduced after it; the current file is in the author's repo.
## Links
- Page: https://startupskills.dev/kemiljk/modern-css-html
- Author: https://startupskills.dev/kemiljk
- Index: https://startupskills.dev/llms.txt
## The file itself
---
name: modern-css-html
description: "Choose native CSS and HTML features, assess browser support, or replace legacy workarounds with progressive enhancement."
license: MIT
---
# Modern CSS & HTML
Write CSS and HTML with current platform features. Prefer native materials over legacy hacks and unnecessary JavaScript.
## Composition with other skills
- This skill owns **native implementation choices**.
- `fluid-design` owns **interaction feel** when physics, interruption, or gestures exceed CSS.
- `semantic-html-first` owns **element and ARIA boundaries**.
- If a native CSS/HTML feature can meet the requirement with acceptable support, use it.
## Browser support policy
Target features available in both **WebKit (Safari)** and **Blink (Chrome/Edge)** unless the task explicitly allows a single-engine experiment.
- **Widely available in both engines:** ship as default.
- **Newly available in both:** ship with `@supports` / progressive enhancement.
- **Single-engine or unstable:** mention as optional; provide a cross-engine path.
Do not hardcode volatile global percentage figures in recommendations. Re-check support when unsure, and encode the decision as "both engines / enhance / fallback".
## Core defaults
### HTML
- Use native elements (`button`, `a`, `details`, `dialog`, `select`, form controls) before ARIA widgets.
- Prefer semantic structure (`main`, `nav`, `section`, headings) over div soup.
- Use Popover API + CSS Anchor Positioning before custom floating stacks when support allows.
### Layout
- `gap` over margin hacks; `inset` over four physical offsets; `aspect-ratio` over padding hacks.
- `100dvh` for mobile full-height; logical properties for direction-aware spacing.
- Container queries for component responsiveness; range syntax for media queries.
- `subgrid`, `grid-template-areas`, `position: sticky`, scroll snapping when they replace JS.
### Colour and theme
- Build palettes in `oklch()`.
- Derive states with `color-mix()` and relative colour syntax.
- Prefer `light-dark()` with `color-scheme` over duplicated scheme blocks.
### Motion
- Animate `translate`, `rotate`, `scale`, and `opacity` preferentially.
- Use `@starting-style` and `transition-behavior: allow-discrete` for entry/exit where supported.
- Prefer CSS scroll-driven timelines over Intersection Observer class toggles when support allows.
- Defer to `fluid-design` for springs, gestures, and interruptible physics.
## Review checklist
- [ ] Is there a native HTML element for this control?
- [ ] Can layout/colour/motion be done in CSS without a library?
- [ ] Are colours tokens/`oklch` rather than one-off hex?
- [ ] Are fallbacks expressed with `@supports` where needed?
- [ ] Does reduced-motion get a real alternative path?
- [ ] Are physical left/right properties avoided for direction-sensitive UI?
- [ ] If JS remains, is it covering a gap CSS/HTML cannot?
## References
- Read [Task recipes](references/recipes.md) when implementing a matching pattern.
- Read [Feature notes](references/features.md) when choosing a feature or fallback.
Load only the reference relevant to the current decision.
## Licence of the file above
The file above is https://raw.githubusercontent.com/kemiljk/skills/main/skills/modern-css-html/SKILL.md, by Karl Koch, reproduced without changes.
- Source: https://github.com/kemiljk/skills/blob/main/skills/modern-css-html/SKILL.md
- Copyright: Copyright (c) 2026 Karl Koch
- Licence: MIT, https://raw.githubusercontent.com/kemiljk/skills/main/LICENSE
The repo's licence file, verbatim from https://raw.githubusercontent.com/kemiljk/skills/main/LICENSE:
MIT License
Copyright (c) 2026 Karl Koch
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.