Skip to content
Skills Library
Programming · Building & coding

fe-css-modern

/fe-css-modern

Uses current CSS features where they replace JavaScript or preprocessor work - native nesting, :has(), @scope, color-mix() and oklch, light-dark(), @starting-style, @property, text-wrap, anchor positioning - each with its Baseline status and a fallback. Use when modernising a stylesheet, replacing a JS-driven style, or asked "can I use this CSS feature", "do we still need Sass for this".

Licence
MIT
Last repository change
11.11.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 11.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Uses current CSS features where they replace JavaScript or preprocessor work - native nesting, :has(), @scope, color-mix() and oklch, light-dark(), @starting-style, @property, text-wrap, anchor positioning - each with its Baseline status and a fallback. Use when modernising a stylesheet, replacing a JS-driven style, or asked "can I use this CSS feature", "do we still need Sass for this".

Triggers from the description

can I use this CSS featuredo we still need Sass for this
Original author description

Uses current CSS features where they replace JavaScript or preprocessor work - native nesting, :has(), @scope, color-mix() and oklch, light-dark(), @starting-style, @property, text-wrap, anchor positioning - each with its Baseline status and a fallback. Use when modernising a stylesheet, replacing a JS-driven style, or asked "can I use this CSS feature", "do we still need Sass for this".

How it works

  1. Rules
  2. Do this
  3. Check
  4. References
Original SKILL.md headings · 35 lines, 369 words
SKILL.md preview
---
name: fe-css-modern
description: Uses current CSS features where they replace JavaScript or preprocessor work - native nesting, :has(), @scope, color-mix() and oklch, light-dark(), @starting-style, @property, text-wrap, anchor positioning - each with its Baseline status and a fallback. Use when modernising a stylesheet, replacing a JS-driven style, or asked "can I use this CSS feature", "do we still need Sass for this".
license: MIT
compatibility: Any agent that reads Agent Skills. The audit command needs Node.js 20 or newer.
metadata:
  title: Modern CSS features
  area: styling
  lane: A
  requires: web
  globs: "**/*.css **/*.scss **/*.less **/*.vue **/*.svelte **/*.astro"
  rules: "css/baseline-check css/nesting-no-concat css/light-dark-color-scheme css/limited-needs-supports"
  version: 0.1.0
---

# Modern CSS features

Read `.frontend-skills/profile.json` and `.frontend-skills/lessons.md` first when they exist; a confirmed lesson wins over this skill.

## Rules

- Check a feature's Baseline status against the project's browser targets before relying on it (css/baseline-check).
- Native nesting never joins `&` to a suffix (`&__title`); write the full selector or `&.modifier` (css/nesting-no-concat).
- With `light-dark()`, declare `color-scheme: light dark` on `:root` (css/light-dark-color-scheme).
- Anchor positioning and scroll-driven animations go in `@supports` with a working fallback (css/limited-needs-supports).
- Use `:has()` for parent and sibling state (`.field:has(:user-invalid)`) instead of classes toggled by JavaScript.
- Build palettes in `oklch()` and derive states with `color-mix(in oklch, …)`; still check contrast of every text pair.
- Animate entry and `display` changes with `@starting-style` and `transition-behavior: allow-discrete`, not timeouts.
- Register a custom property with `@property` when it must animate or needs a type.
- `text-wrap: balance` for headings, `pretty` for body text: both fail safe.
- Use `@scope` only as enhancement until it is Widely available; keep the class naming that works without it.

## Do this

1. Read the project's browser targets (`browserslist` in `package.json` or `.browserslistrc`, or the framework default) before choosing a feature.
2. Look the feature up in the table in the reference (date-stamped) or on the web-features explorer; Widely available features need no fallback.
3. For a Newly available feature, make sure the page still works without it; for a feature that is not Baseline, write the fallback first and the feature inside `@supports`.
4. Replace JavaScript that only toggles a style (parent highlight, open state, theme) with `:has()`, `:user-invalid`, `[open]`, `light-dark()`.
5. In a Sass project, keep Sass for loops and maps; native nesting, custom properties and `color-mix()` now cover what Sass was often used for.

## Check

- `npx github:dawidolko/frontend-skills audit --changed` reports joined nesting suffixes, `light-dark()` without a colour scheme and anchor or scroll-timeline CSS outside `@supports`.
- By hand: open the page in the oldest browser of the project's targets (or disable the feature in DevTools) and confirm the fallback works.

## References

- [references/modern-css.md](references/modern-css.md): the Baseline table with dates, patterns for `:has()`, nesting, `@scope`, colour functions, `light-dark()`, `@starting-style`, `@property`, popover and anchor positioning. Read it when you choose or replace a feature.
Files in this package (2)
  • SKILL.md 3 KB
  • references/modern-css.md 5 KB

Versions

The database has no other skills named fe-css-modern.

Database snapshot: 13.11.2026 · package version 55d5f7238f54 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100modern-css
    Write modern CSS using native features instead of legacy hacks, workarounds, and JavaScript. Covers layout, selectors, color, typography, animation, HTML-native UI, and workflow with 118 old-vs-modern patterns from modern-css.com. Use when writing, reviewing, or refactoring CSS,…
  • 100tailwind-v4
    Tailwind CSS v4 with CSS-first configuration and design tokens. Use when setting up Tailwind v4, defining theme variables, using OKLCH colors, or configuring dark mode. Triggers on @theme, @tailwindcss/vite, oklch, CSS variables, --color-, tailwind v4.
  • 95tailwind-v4
    Tailwind CSS v4 with CSS-first configuration and design tokens. Use when setting up Tailwind v4, defining theme variables, using OKLCH colors, or configuring dark mode. Triggers on @theme, @tailwindcss/vite, oklch, CSS variables, --color-, tailwind v4.
  • 100modern-css
    Implement or debug CSS layouts, responsive styles, themes, and motion. Use when choosing native CSS features or replacing legacy styling with browser-compatible CSS; not for unrelated frontend logic.
  • 95modern-css
    Specialized knowledge for writing modern high-quality CSS. Trigger this skill when starting a new CSS project/file, when the user asks about new CSS features (e.g. Masonry, View Transitions, Container Queries, Scroll-driven animations), or requests refactoring of legacy styles to modern standards.
  • 100css-modules-and-sass
    Use this skill when maintaining scoped component styles, Sass mixins, nested rules, and variables using CSS Modules and Sass/SCSS.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.