modern-css — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited modern-css (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Modern CSS rules for creating robust, responsive and accessible UIs.
The rules work best when you apply a [progressive enhancement](https://developer.mozilla.org/en-US/docs/Glossary/Progressive_Enhancement) approach. The CSS features are within Baseline Newly Available. Thanks to Interop, most are within Widely Available.
When editing existing files, match the surrounding code's style. For new code, follow the rules below. Where two rules could both apply, apply both consistently rather than picking one.
#### Organizing styles (@layer)
@layer to organize groups of styles.@layer on MDN./* avoid */
a {
text-decoration-skip-ink: auto;
}
/* prefer */
@layer elements, components;
@layer elements {
a {
text-decoration-skip-ink: auto;
}
}#### Encapsulating styles (@scope)
@scope to encapsulate styles.@scope on MDN.@scope (.card) {
h2 {
font-size: var(--large);
}
}#### Limiting scope (@scope ... to)
@scope (outer) to (inner)) when a scoped component hosts content it doesn't own — embedded components, slot content, or user content.@scope over a component that holds slot content, embedded components, or user-generated HTML.@scope on MDN./* avoid */
@scope (.card) {
a {
color: var(--blue);
}
}
/* prefer */
@scope (.card) to (.content) {
a {
color: var(--blue);
}
}#### Nesting rules and at-rules (&)
& for nesting rules and at-rules.a {} a:hover {}).& nesting selector on MDN.a {
color: var(--blue);
&:hover {
text-decoration: underline;
}
@container (width > 20em ) {
place-self: center;
}
}#### Relational styles (:has())
:has() for relational styles..has--like class names (e.g. .has-img {}).:has() on MDN..card {
&:has(img) {
grid-template-rows: auto 1fr;
}
}#### Additive properties (:not() and 20em < width <= 40em)
:not() and ranged queries (e.g. @media (20em < width <= 40em)) to create additive styles.div { margin: 1rem; &:first-child { margin-block-start: 0; } }):not() on MDN, media query range syntax on MDN..card {
/* Apply to all conditions */
color: red;
/* Apply based on the selector */
&:not(:first-child) {
margin-block-start: var(--medium);
}
/* Apply based on non-overlapping container conditions */
@container example (width <= 20em) {
background-color: var(--primary);
}
@container example (20em < width <= 40em ) {
background-color: var(--secondary);
}
@container example (width > 40em ) {
background-color: var(--tertiary);
}
}#### Fluid type sizes (clamp())
clamp() for font sizes to create harmonious rhythmic scales that are appropriate to the screen size, e.g. Major Second (1.125) on narrow viewports and Major Third (1.25) wide ones.px, rem) and central values without a rem addition (e.g. clamp(1.75rem, 5cqi, 2.25rem)).clamp() on MDN, Responsive design: seams & edges. and [Designing with fluid type scales](https://utopia.fyi/blog/designing-with-fluid-type-scales).
:root {
--medium: clamp(1.3125rem, 1.1821rem + 0.6522cqi, 1.6875rem);
--large: clamp(1.75rem, 1.5761rem + 0.8696cqi, 2.25rem);
}#### Widow and orphan words (text-wrap)
text-wrap with pretty or balance to avoid widow and orphan words.text-wrap on MDN.h1,
h2,
h3 {
text-wrap: balance;
}
p {
text-wrap: pretty;
}#### Perceptual uniform lightness (oklch())
oklch() for all colors.hex, rgb(), hsl() and other color formats.oklch() on MDN./* avoid */
:root {
--success: #2d7a3e;
--danger: hsl(0deg 70% 40%);
}
/* prefer */
:root {
--success: oklch(40% 0.15 150deg);
--danger: oklch(40% 0.2 25deg);
}#### Respecting color preferences (color-scheme)
color-scheme and light-dark() to support color schemes.color-scheme on MDN, light-dark() on MDN.body {
color-scheme: light dark;
background-color: light-dark(oklch(98% 0.03 250deg), oklch(14% 0 0deg));
}#### Relative color functions (oklch(from /* .. */) & color-mix() )
oklch(from var(--primary) l + 10%)) and functions (e.g. color-mix()) to create color relationships.color-mix() on MDN.button {
background-color: var(--primary);
&:hover {
background-color: oklch(from var(--primary) l c calc(h - 10deg));
}
}#### Flow-relative layout (*-inline-*, *-block-*, cqi/vi, start/end)
padding-block-start, inset-inline, inline-size), units (e.g. cqi, cqb, vi), and keywords (e.g. text-align: start) for layout.padding-top, width, cqw, vw, text-align: left)./* avoid */
.card {
padding-top: 1rem;
font-size: 20vw;
text-align: left;
}
/* prefer */
.card {
padding-block-start: 1rem;
font-size: 20vi;
text-align: start;
}#### Container queries and units (@container, cqi etc.)
cqi, cqb) for responsive layouts.padding-block: 16px, margin-inline: 1rem) as they create hard edges and seams.container on MDN, container query length units on MDN, Responsive design: seams & edges. and [Designing with fluid type scales](https://utopia.fyi/blog/designing-with-fluid-type-scales).
.card {
container: card / inline-size;
padding: 2cqi;
p {
@container card (width > 30cqi) {
place-self: center;
}
}
}#### Intrinsic sizing (*-content)
max-inline-size: fit-content, block-size: max-content).width: 300px, height: 200px) for content elements.fit-content on MDN, max-content on MDN.nav {
max-inline-size: fit-content;
}#### Aligning nested grids (subgrid)
subgrid on grid-template-rows or grid-template-columns to align nested grid items with an ancestor grid.subgrid, alignment falls back to fixed heights, JS measurement, or flattened DOM.subgrid on MDN..card {
display: grid;
grid-template-rows: auto auto auto 1fr;
> .content {
display: grid;
grid-row: span 4;
grid-template-rows: subgrid;
}
}#### Respecting motion preferences (prefers-reduced-motion)
prefers-reduced-motion: no-preference when applying large animations and transitions.prefers-reduced-motion: reduce.@media (prefers-reduced-motion: reduce)) requires every animation to also ship a reduce-motion override, and it's easy to miss one.prefers-reduced-motion on MDN./* avoid */
.hero {
animation: bounce-in 0.5s ease;
}
@media (prefers-reduced-motion: reduce) {
.hero {
animation: none;
}
}
/* prefer */
@media (prefers-reduced-motion: no-preference) {
.hero {
animation: bounce-in 0.5s ease;
}
}When asked to author, refactor, or review CSS:
Non-obvious traps that the rules above don't surface on their own:
clamp(1.75rem, 1.5761rem + 0.8696cqi, 2.25rem), not clamp(1.75rem, 5cqi, 2.25rem).width <= 20em / 20em < width <= 40em / width > 40em, not width < 20em / width >= 20em.no-preference.grid-row: span N so the child occupies the parent rows; without span, the subgrid child gets one row and aligns with nothing.This site follows the rules:
src/styles.css — @layersrc/variables.css — oklch(), light-dark(), clamp()src/elements.css — &, text-wrap, prefers-reduced-motion, cqisrc/components/signpost/signpost.css — @scopeWhen the skill is active, prefer matching patterns from the user's own files over fetching these examples.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.