Add forced-colors support and contrast guidance
CI / Test and package (push) Failing after 49s

This commit is contained in:
2026-11-21 02:24:44 +01:00
parent db683819c9
commit 5e93a89b3a
15 changed files with 192 additions and 13 deletions
+76
View File
@@ -126,6 +126,41 @@
.catalog-hero__meta { align-items: center; }
.catalog-contrast-guide {
display: grid;
grid-template-columns: minmax(0, 1.2fr) minmax(14rem, 0.8fr);
gap: var(--frost-space-5) var(--frost-space-8);
margin-block: var(--frost-space-8) 0;
border-color: color-mix(in srgb, var(--frost-color-accent) 42%, var(--frost-color-border));
}
.catalog-contrast-guide h2 { margin: 0 0 var(--frost-space-3); font-size: var(--frost-font-size-xl); }
.catalog-contrast-guide p:not(.catalog-eyebrow) { margin: 0; color: var(--frost-color-text-muted); }
.catalog-contrast-guide ul { grid-column: 1 / -1; display: grid; gap: var(--frost-space-2); margin: 0; padding-inline-start: var(--frost-space-5); color: var(--frost-color-text-muted); }
.catalog-system-colors {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: var(--frost-space-2);
align-self: start;
}
.catalog-system-color {
display: grid;
min-height: 3.5rem;
place-items: center;
padding: var(--frost-space-2);
border: 1px solid var(--frost-color-border-strong);
border-radius: var(--frost-radius-sm);
font-size: 0.75rem;
font-weight: 750;
}
.catalog-system-color--canvas { background: var(--frost-color-surface); color: var(--frost-color-text); }
.catalog-system-color--text { background: var(--frost-color-text); color: var(--frost-color-bg); }
.catalog-system-color--button { background: var(--frost-color-surface-soft); color: var(--frost-color-text); }
.catalog-system-color--highlight { background: var(--frost-color-accent); color: var(--frost-color-on-accent); }
.catalog-empty {
padding: var(--frost-space-8);
border: 1px dashed var(--frost-color-border-strong);
@@ -286,6 +321,7 @@
@media (max-width: 48rem) {
.catalog-hero,
.catalog-contrast-guide,
.catalog-component__header,
.catalog-details { grid-template-columns: 1fr; }
.catalog-hero__actions { justify-self: start; }
@@ -293,4 +329,44 @@
.catalog-demo-grid { grid-template-columns: 1fr; }
.catalog-component__header { padding: var(--frost-space-5); }
}
@media (forced-colors: active) {
.catalog-sidebar,
.catalog-hero,
.catalog-contrast-guide,
.catalog-component,
.catalog-component__header,
.catalog-code,
.catalog-code__toolbar,
.catalog-a11y {
border-color: CanvasText;
background: Canvas;
color: CanvasText;
box-shadow: none;
}
.catalog-hero { background-image: none; }
.catalog-brand__mark { border: 1px solid Highlight; background: Highlight; color: HighlightText; forced-color-adjust: none; }
.catalog-eyebrow,
.catalog-hero__copy,
.catalog-sidebar__intro,
.catalog-nav__label,
.catalog-component__header p,
.catalog-live__label,
.catalog-a11y ul,
.catalog-contrast-guide p:not(.catalog-eyebrow),
.catalog-contrast-guide ul { color: CanvasText; }
.catalog-nav__link { color: LinkText; }
.catalog-nav__link:hover,
.catalog-nav__link:focus-visible { background: Highlight; color: HighlightText; forced-color-adjust: none; }
.catalog-live { background: Canvas; }
.catalog-copy { border-color: ButtonText; background: ButtonFace; color: ButtonText; forced-color-adjust: none; }
.catalog-copy:hover { background: Highlight; color: HighlightText; }
.catalog-code pre { background: Canvas; color: CanvasText; forced-color-adjust: none; }
.catalog-system-color { border-color: CanvasText; forced-color-adjust: none; }
.catalog-system-color--canvas { background: Canvas; color: CanvasText; }
.catalog-system-color--text { background: CanvasText; color: Canvas; }
.catalog-system-color--button { background: ButtonFace; color: ButtonText; }
.catalog-system-color--highlight { background: Highlight; color: HighlightText; }
}
}