mcpField
C
css-first

css-first

github.com/deptharkDesign & UI1177 installsUpdated 1d ago
Repository

About css-first

css-first is a skill for interface work that prioritizes semantic HTML and CSS before JavaScript. It helps developers choose maintainable approaches by considering browser support, progressive enhancement, accessibility, and project conventions.

Key features

  1. 01Prioritizes CSS for interface work
  2. 02Ranks options by semantics and accessibility
  3. 03Checks Baseline and browser support
  4. 04Provides fallbacks for limited-support features
  5. 05Catalogs modern CSS examples

Use cases

  1. 01Build responsive components and layouts
  2. 02Plan fallbacks for newer CSS features
  3. 03Choose styles for project browser targets
  4. 04Verify interface behavior in a browser

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/depthark/css-first-skill --skill css-first

After installing, type/css-firstin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

CLAUDE.md
.gitignore
README.md
agents/
openai.yaml
css-demos/
INDEX.md
css-demos/accessibility/
prefers-reduced-motion.css
css-demos/animation/
animatable-zoom.css
scroll-triggered.css
scroll-driven.css
starting-style.css
view-transitions.css
css-demos/container/
anchored-queries.css
comma-separated-queries.css
named-queries.css
size-queries.css
style-queries.css
scroll-state-queries.css
css-demos/functions/
advanced-attr.css
calc-size.css
progress-function.css
random-function.css
contrast-color.css
css-if-function.css
custom-functions.css
inherit-function.css
trigonometric-functions.css
sibling-functions.css
css-demos/interaction/
css-carousel.css
flip-card.css
window-drag.css

Details

From the project README

CSS First

Solve interface work with semantic HTML and CSS before proposing JavaScript. Prefer modern, standards-based CSS when it matches the user's target browsers and preserve the core experience with progressive enhancement when support is incomplete.

Workflow

  1. Identify the visual or interaction intent and inspect the project's framework, browser targets, writing modes, and existing conventions.
  2. Search css-demos/INDEX.md for a matching pattern.
  3. When support or recency matters, fetch the current Baseline record using references/live-mdn-fetch.md. Treat checked-in labels as dated snapshots, not permanent facts.
  4. Rank solutions by semantic fit, accessibility, interoperability, and maintenance cost. Prefer logical properties and native CSS capabilities.
  5. If the selected feature is Limited Availability or has no WebStatus record, show a usable fallback and gate the enhancement with @supports when practical.
  6. Verify syntax and behavior in a real browser when the environment provides one.

Baseline Vocabulary

Use the Web Platform Status meaning exactly. Do not convert global usage percentages into Baseline labels.

API statusLabelMeaning
widely🟢 Widely AvailableInteroperable in the core browser set for at least 30 months
newly🔵 Newly AvailableInteroperable in the core browser set for less than 30 months
limited🟡 Limited AvailabilityNot Baseline because core-browser coverage is incomplete
missing🟣 Experimental / unknownNo usable WebStatus record; inspect specifications and browser releases

Browser-version percentages can be useful supplementary data, but never determine a Baseline category.

Rules

Read only the references needed for the task:

Current Chrome Additions

The demo catalog covers author-facing CSS shipped or announced from Chrome 148 through Chrome 152, including name-only and comma-separated container queries, at-rule() and named-feature() support tests, animatable zoom, rounded polygon(), text-fit, background-clip: border-area, CSS image() values, image-valued light-dark(), flex-wrap: balance, overscroll-behavior: chain, print page-margin-safety, SVG path-length, ruby-overhang, media-state pseudo-classes, alpha(), window-drag, and installed-app accent system colors.

Use the feature's demo header and live WebStatus entry together: Chrome shipping does not by itself mean a feature is Baseline.

Maintaining Snapshots

From this skill directory, run:

python3 scripts/update_baseline.py --check
python3 scripts/update_baseline.py --write

--check reports drift without changing files. --write refreshes mapped demo headers and their matching entries in css-demos/INDEX.md from the official WebStatus API. Features without a WebStatus record stay manual and must cite their release note or specification.

Quick Reference

IntentPreferred CSSDemo
Component responsivenessContainer queriescss-demos/container/size-queries.css
Parent-aware styles:has()css-demos/layout/has-selector.css
Balanced wrapped flex linesflex-wrap: balancecss-demos/layout/flex-wrap-balance.css
Entry animation@starting-stylecss-demos/animation/starting-style.css
Scroll effectsScroll-driven animationscss-demos/animation/scroll-driven.css
Native tooltip placementAnchor positioningcss-demos/positioning/anchor-positioning.css
Responsive headline fittingtext-fitcss-demos/visual/text-fit.css
Theme-aware imageslight-dark() / image()css-demos/visual/css-image-values.css
Media playback state:playing, :paused, and related pseudo-classescss-demos/interaction/media-state-pseudos.css
Installed-app drag regionwindow-dragcss-demos/interaction/window-drag.css
Reduced motionprefers-reduced-motioncss-demos/accessibility/prefers-reduced-motion.css
Decorative variationrandom()css-demos/functions/random-function.css
Normalize a rangeprogress()css-demos/functions/progress-function.css

Use MDN for syntax and caveats and WebStatus for Baseline:

Comments

Markdown supported