Design tokens: tokens.css, tailwind.css, a11y.css and the TS token module
tokens.css (neutral --ipal-* defaults, light/dark, inverse scope, reduced motion) is generated from src/modules/tokens/catalog.ts. tailwind.css maps the utilities. New @intecion/ipal-kit/tokens entry: IPAL_TOKENS, ipalVar, IPAL_BREAKPOINTS, defineTokens, tokensToCss, contrastReport, fluidClamp. fluid.css / fluid-wide.css gain fs-xs, fs-h4, space-stack, space-section-sm. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
500c534bc9
commit
9511b12d19
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* @intecion/ipal-kit/a11y.css — the CSS for the accessibility widget's attributes
|
||||
* (data-a11y-* on <html>, set by <AccessibilityProvider>; docs/accessibility.md).
|
||||
* Optional: import it only on a site that shows <AccessibilityWidget>. Works through the
|
||||
* design tokens: the readable font swaps --ipal-font-body/-heading, "no animations"
|
||||
* zeroes the --ipal-duration-* tokens (tokens.css) and stops every other animation.
|
||||
* Override any value after the import, e.g. --ipal-font-readable.
|
||||
*/
|
||||
|
||||
:root {
|
||||
--ipal-font-readable: Verdana, Tahoma, "Segoe UI", sans-serif;
|
||||
}
|
||||
|
||||
/* Text size: the fluid scale is in rem, so everything grows with the root size */
|
||||
html[data-a11y-text="1"] { font-size: 112.5%; }
|
||||
html[data-a11y-text="2"] { font-size: 125%; }
|
||||
html[data-a11y-text="3"] { font-size: 150%; }
|
||||
|
||||
/* Line spacing */
|
||||
html[data-a11y-line="1"] { --ipal-lh-body: 1.8; --ipal-lh-heading: 1.45; }
|
||||
html[data-a11y-line="2"] { --ipal-lh-body: 2.2; --ipal-lh-heading: 1.7; }
|
||||
html[data-a11y-line="1"] body * { line-height: 1.8 !important; }
|
||||
html[data-a11y-line="2"] body * { line-height: 2.2 !important; }
|
||||
|
||||
/* Contrast and grayscale: one filter value per combination (filter values do not stack) */
|
||||
html[data-a11y-contrast="high"] { filter: contrast(1.4); }
|
||||
html[data-a11y-grayscale="on"] { filter: grayscale(1); }
|
||||
html[data-a11y-contrast="high"][data-a11y-grayscale="on"] { filter: contrast(1.4) grayscale(1); }
|
||||
html[data-a11y-contrast="inverted"] { filter: invert(1) hue-rotate(180deg); }
|
||||
html[data-a11y-contrast="inverted"][data-a11y-grayscale="on"] { filter: invert(1) hue-rotate(180deg) grayscale(1); }
|
||||
html[data-a11y-contrast="inverted"] img,
|
||||
html[data-a11y-contrast="inverted"] video,
|
||||
html[data-a11y-contrast="inverted"] picture {
|
||||
filter: invert(1) hue-rotate(180deg); /* media keep their own colours */
|
||||
}
|
||||
|
||||
/* Underlined links */
|
||||
html[data-a11y-underline="on"] a { text-decoration: underline !important; }
|
||||
|
||||
/* Readable font */
|
||||
html[data-a11y-font="readable"] {
|
||||
--ipal-font-body: var(--ipal-font-readable);
|
||||
--ipal-font-heading: var(--ipal-font-readable);
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
html[data-a11y-font="readable"] body * { font-family: var(--ipal-font-readable) !important; }
|
||||
|
||||
/* No animations (the duration tokens are zeroed in tokens.css) */
|
||||
html[data-a11y-motion="reduce"] *,
|
||||
html[data-a11y-motion="reduce"] *::before,
|
||||
html[data-a11y-motion="reduce"] *::after {
|
||||
animation-duration: 0.001ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
scroll-behavior: auto !important;
|
||||
transition-duration: 0.001ms !important;
|
||||
}
|
||||
|
||||
/* Big cursor */
|
||||
html[data-a11y-cursor="big"],
|
||||
html[data-a11y-cursor="big"] * {
|
||||
cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l16 11-7 1.5 4 7.5-3 1.5-4-7.5L4 21z' fill='black' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") 4 2, auto !important;
|
||||
}
|
||||
@@ -13,15 +13,19 @@
|
||||
* any variable in the project's :root.
|
||||
*/
|
||||
:root {
|
||||
--ipal-fs-xs: clamp(0.75rem, 0.7356rem + 0.0641vw, 0.8125rem); /* 0.75→0.8125rem · fine print, legal (since 1.15.0) */
|
||||
--ipal-fs-sm: clamp(0.875rem, 0.8606rem + 0.0641vw, 0.9375rem); /* 0.875→0.9375rem · small print, captions */
|
||||
--ipal-fs-base: clamp(1rem, 0.9712rem + 0.1282vw, 1.125rem); /* 1→1.125rem · body text */
|
||||
--ipal-fs-lg: clamp(1.125rem, 1.0673rem + 0.2564vw, 1.375rem); /* 1.125→1.375rem · lead / intro */
|
||||
--ipal-fs-h4: clamp(1.125rem, 1.0385rem + 0.3846vw, 1.5rem); /* 1.125→1.5rem · h4, card titles (since 1.15.0) */
|
||||
--ipal-fs-h3: clamp(1.25rem, 1.1346rem + 0.5128vw, 1.75rem); /* 1.25→1.75rem · h3 */
|
||||
--ipal-fs-h2: clamp(1.5rem, 1.2692rem + 1.0256vw, 2.5rem); /* 1.5→2.5rem · h2 — section headings */
|
||||
--ipal-fs-h1: clamp(2rem, 1.6538rem + 1.5385vw, 3.5rem); /* 2→3.5rem · h1 — page heading */
|
||||
--ipal-fs-display: clamp(2.5rem, 2.0385rem + 2.0513vw, 4.5rem); /* 2.5→4.5rem · hero / display */
|
||||
--ipal-space-stack: clamp(1rem, 0.8846rem + 0.5128vw, 1.5rem); /* 1→1.5rem · heading → content (since 1.15.0) */
|
||||
--ipal-space-gap: clamp(1rem, 0.7692rem + 1.0256vw, 2rem); /* 1→2rem · gap between items in a section */
|
||||
--ipal-space-gutter: clamp(1rem, 0.6538rem + 1.5385vw, 2.5rem); /* 1→2.5rem · container side padding */
|
||||
--ipal-space-section-sm: clamp(1.5rem, 0.9808rem + 2.3077vw, 3.75rem); /* 1.5→3.75rem · compact section: CTA band, logos (since 1.15.0) */
|
||||
--ipal-space-section: clamp(3rem, 1.9615rem + 4.6154vw, 7.5rem); /* 3→7.5rem · vertical padding of a section */
|
||||
}
|
||||
|
||||
|
||||
@@ -24,15 +24,19 @@
|
||||
* @intecion/ipal-kit/fluid-wide.css instead: same variables, scaled 360 → 1920px.
|
||||
*/
|
||||
:root {
|
||||
--ipal-fs-xs: clamp(0.75rem, 0.7255rem + 0.1087vw, 0.8125rem); /* 0.75→0.8125rem · fine print, legal (since 1.15.0) */
|
||||
--ipal-fs-sm: clamp(0.875rem, 0.8505rem + 0.1087vw, 0.9375rem); /* 0.875→0.9375rem · small print, captions */
|
||||
--ipal-fs-base: clamp(1rem, 0.9511rem + 0.2174vw, 1.125rem); /* 1→1.125rem · body text */
|
||||
--ipal-fs-lg: clamp(1.125rem, 1.0272rem + 0.4348vw, 1.375rem); /* 1.125→1.375rem · lead / intro */
|
||||
--ipal-fs-h4: clamp(1.125rem, 0.9783rem + 0.6522vw, 1.5rem); /* 1.125→1.5rem · h4, card titles (since 1.15.0) */
|
||||
--ipal-fs-h3: clamp(1.25rem, 1.0543rem + 0.8696vw, 1.75rem); /* 1.25→1.75rem · h3 */
|
||||
--ipal-fs-h2: clamp(1.5rem, 1.1087rem + 1.7391vw, 2.5rem); /* 1.5→2.5rem · h2 — section headings */
|
||||
--ipal-fs-h1: clamp(2rem, 1.413rem + 2.6087vw, 3.5rem); /* 2→3.5rem · h1 — page heading */
|
||||
--ipal-fs-display: clamp(2.5rem, 1.7174rem + 3.4783vw, 4.5rem); /* 2.5→4.5rem · hero / display */
|
||||
--ipal-space-stack: clamp(1rem, 0.8043rem + 0.8696vw, 1.5rem); /* 1→1.5rem · heading → content (since 1.15.0) */
|
||||
--ipal-space-gap: clamp(1rem, 0.6087rem + 1.7391vw, 2rem); /* 1→2rem · gap between items in a section */
|
||||
--ipal-space-gutter: clamp(1rem, 0.413rem + 2.6087vw, 2.5rem); /* 1→2.5rem · container side padding */
|
||||
--ipal-space-section-sm: clamp(1.5rem, 0.6196rem + 3.913vw, 3.75rem); /* 1.5→3.75rem · compact section: CTA band, logos (since 1.15.0) */
|
||||
--ipal-space-section: clamp(3rem, 1.2391rem + 7.8261vw, 7.5rem); /* 3→7.5rem · vertical padding of a section */
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
* @intecion/ipal-kit/tailwind.css — Tailwind 4 preset for the --ipal-* design tokens
|
||||
* (docs/design-tokens.md). Import after "tailwindcss" and tokens.css:
|
||||
*
|
||||
* @import "tailwindcss";
|
||||
* @import "@intecion/ipal-kit/fluid-wide.css";
|
||||
* @import "@intecion/ipal-kit/tokens.css";
|
||||
* @import "@intecion/ipal-kit/tailwind.css";
|
||||
* @import "../../design/tokens.css";
|
||||
*
|
||||
* `@theme inline` makes every utility read the --ipal-* variable where it is used, so a
|
||||
* scope that re-maps a token (dark theme, data-surface="inverse") reaches every utility.
|
||||
* Colours switch with the theme on their own: no dark: variant for colours.
|
||||
*/
|
||||
|
||||
/* dark: follows <ThemeScript> (data-theme on <html>), not the device setting */
|
||||
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));
|
||||
|
||||
@theme inline {
|
||||
--color-bg: var(--ipal-bg);
|
||||
--color-surface: var(--ipal-surface);
|
||||
--color-surface-muted: var(--ipal-surface-muted);
|
||||
--color-surface-raised: var(--ipal-surface-raised);
|
||||
--color-inverse: var(--ipal-surface-inverse);
|
||||
--color-on-inverse: var(--ipal-text-inverse);
|
||||
--color-fg: var(--ipal-text);
|
||||
--color-fg-strong: var(--ipal-text-strong);
|
||||
--color-fg-muted: var(--ipal-text-muted);
|
||||
--color-border: var(--ipal-border);
|
||||
--color-border-strong: var(--ipal-border-strong);
|
||||
--color-primary: var(--ipal-primary);
|
||||
--color-primary-hover: var(--ipal-primary-hover);
|
||||
--color-on-primary: var(--ipal-primary-text);
|
||||
--color-secondary: var(--ipal-secondary);
|
||||
--color-secondary-hover: var(--ipal-secondary-hover);
|
||||
--color-on-secondary: var(--ipal-secondary-text);
|
||||
--color-accent: var(--ipal-accent);
|
||||
--color-on-accent: var(--ipal-accent-text);
|
||||
--color-link: var(--ipal-link);
|
||||
--color-link-hover: var(--ipal-link-hover);
|
||||
--color-hover: var(--ipal-hover);
|
||||
--color-focus: var(--ipal-focus);
|
||||
--color-overlay: var(--ipal-overlay);
|
||||
--color-success: var(--ipal-success);
|
||||
--color-success-surface: var(--ipal-success-surface);
|
||||
--color-warning: var(--ipal-warning);
|
||||
--color-warning-surface: var(--ipal-warning-surface);
|
||||
--color-danger: var(--ipal-danger);
|
||||
--color-danger-surface: var(--ipal-danger-surface);
|
||||
--color-info: var(--ipal-info);
|
||||
--color-info-surface: var(--ipal-info-surface);
|
||||
|
||||
--font-sans: var(--ipal-font-body);
|
||||
--font-body: var(--ipal-font-body);
|
||||
--font-heading: var(--ipal-font-heading);
|
||||
--font-mono: var(--ipal-font-mono);
|
||||
|
||||
--text-xs: var(--ipal-fs-xs);
|
||||
--text-sm: var(--ipal-fs-sm);
|
||||
--text-base: var(--ipal-fs-base);
|
||||
--text-lg: var(--ipal-fs-lg);
|
||||
--text-lead: var(--ipal-fs-lg);
|
||||
--text-lead--line-height: var(--ipal-lh-body);
|
||||
--text-h4: var(--ipal-fs-h4);
|
||||
--text-h4--line-height: var(--ipal-lh-heading);
|
||||
--text-h3: var(--ipal-fs-h3);
|
||||
--text-h3--line-height: var(--ipal-lh-heading);
|
||||
--text-h2: var(--ipal-fs-h2);
|
||||
--text-h2--line-height: var(--ipal-lh-heading);
|
||||
--text-h1: var(--ipal-fs-h1);
|
||||
--text-h1--line-height: var(--ipal-lh-heading);
|
||||
--text-display: var(--ipal-fs-display);
|
||||
--text-display--line-height: var(--ipal-lh-heading);
|
||||
--leading-body: var(--ipal-lh-body);
|
||||
--leading-heading: var(--ipal-lh-heading);
|
||||
--tracking-heading: var(--ipal-tracking-heading);
|
||||
|
||||
--spacing-stack: var(--ipal-space-stack);
|
||||
--spacing-gap: var(--ipal-space-gap);
|
||||
--spacing-gutter: var(--ipal-space-gutter);
|
||||
--spacing-section-sm: var(--ipal-space-section-sm);
|
||||
--spacing-section: var(--ipal-space-section);
|
||||
|
||||
--radius-control: var(--ipal-radius);
|
||||
--radius-sm: var(--ipal-radius-sm);
|
||||
--radius-card: var(--ipal-radius-card);
|
||||
--radius-media: var(--ipal-radius-media);
|
||||
|
||||
--shadow-sm: var(--ipal-shadow-sm);
|
||||
--shadow-md: var(--ipal-shadow-md);
|
||||
--shadow-lg: var(--ipal-shadow-lg);
|
||||
|
||||
--container-container: var(--ipal-container);
|
||||
--container-container-wide: var(--ipal-container-wide);
|
||||
--container-narrow: var(--ipal-container-narrow);
|
||||
--container-measure: var(--ipal-measure);
|
||||
|
||||
--ease-out: var(--ipal-ease-out);
|
||||
--ease-in-out: var(--ipal-ease-in-out);
|
||||
}
|
||||
|
||||
/* Durations and layers have no theme namespace in Tailwind 4: plain utilities. */
|
||||
@utility duration-fast {
|
||||
transition-duration: var(--ipal-duration-fast);
|
||||
}
|
||||
@utility duration-base {
|
||||
transition-duration: var(--ipal-duration);
|
||||
}
|
||||
@utility duration-slow {
|
||||
transition-duration: var(--ipal-duration-slow);
|
||||
}
|
||||
@utility z-header {
|
||||
z-index: var(--ipal-z-header);
|
||||
}
|
||||
@utility z-overlay {
|
||||
z-index: var(--ipal-z-overlay);
|
||||
}
|
||||
@utility z-toast {
|
||||
z-index: var(--ipal-z-toast);
|
||||
}
|
||||
|
||||
@layer base {
|
||||
body {
|
||||
background-color: var(--ipal-bg);
|
||||
color: var(--ipal-text);
|
||||
font-family: var(--ipal-font-body);
|
||||
font-weight: var(--ipal-fw-body);
|
||||
line-height: var(--ipal-lh-body);
|
||||
}
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
color: var(--ipal-text-strong);
|
||||
font-family: var(--ipal-font-heading);
|
||||
font-weight: var(--ipal-fw-heading);
|
||||
letter-spacing: var(--ipal-tracking-heading);
|
||||
line-height: var(--ipal-lh-heading);
|
||||
}
|
||||
/* a scope that re-maps the text roles (data-surface="inverse") also sets its own text colour */
|
||||
[data-surface] {
|
||||
color: var(--ipal-text);
|
||||
}
|
||||
:focus-visible {
|
||||
outline: var(--ipal-focus-width) solid var(--ipal-focus);
|
||||
outline-offset: var(--ipal-focus-offset);
|
||||
}
|
||||
}
|
||||
|
||||
/* Smooth colours only at the moment the theme switches (applyTheme sets data-theme-switching). */
|
||||
[data-theme-switching] *,
|
||||
[data-theme-switching] *::before,
|
||||
[data-theme-switching] *::after {
|
||||
transition-duration: var(--ipal-duration) !important;
|
||||
transition-property: background-color, border-color, color, fill, stroke !important;
|
||||
transition-timing-function: var(--ipal-ease-in-out) !important;
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* @intecion/ipal-kit/tokens.css — neutral defaults for every --ipal-* design token
|
||||
* (generated from src/modules/tokens/catalog.ts; docs/design-tokens.md).
|
||||
*
|
||||
* Light values on :root, dark values on :root[data-theme="dark"] (set by <ThemeScript>,
|
||||
* storage key "theme"). A brand overrides them in src/design/tokens.css, generated by
|
||||
* `ipal-tokens` from src/design/tokens.ts and imported after this file.
|
||||
* Components read only the role names, never "-dark": the roles switch with the theme.
|
||||
* The type and space scale is in fluid.css / fluid-wide.css — import one of them as well.
|
||||
*/
|
||||
|
||||
:root {
|
||||
--ipal-bg: oklch(1 0 0);
|
||||
--ipal-surface: oklch(1 0 0);
|
||||
--ipal-surface-muted: oklch(0.97 0 0);
|
||||
--ipal-surface-raised: oklch(1 0 0);
|
||||
--ipal-surface-inverse: oklch(0.205 0 0);
|
||||
--ipal-text: oklch(0.371 0 0);
|
||||
--ipal-text-strong: oklch(0.205 0 0);
|
||||
--ipal-text-muted: oklch(0.53 0 0);
|
||||
--ipal-text-inverse: oklch(0.97 0 0);
|
||||
--ipal-border: oklch(0.922 0 0);
|
||||
--ipal-border-strong: oklch(0.87 0 0);
|
||||
--ipal-primary: oklch(0.546 0.245 262.881);
|
||||
--ipal-primary-hover: color-mix(in oklch, var(--ipal-primary), black 12%);
|
||||
--ipal-primary-text: oklch(1 0 0);
|
||||
--ipal-secondary: var(--ipal-text-strong);
|
||||
--ipal-secondary-hover: color-mix(in oklch, var(--ipal-secondary), white 18%);
|
||||
--ipal-secondary-text: var(--ipal-text-inverse);
|
||||
--ipal-accent: var(--ipal-primary);
|
||||
--ipal-accent-text: var(--ipal-primary-text);
|
||||
--ipal-link: var(--ipal-primary);
|
||||
--ipal-link-hover: color-mix(in oklch, var(--ipal-link), var(--ipal-text-strong) 30%);
|
||||
--ipal-link-inverse: var(--ipal-text-inverse);
|
||||
--ipal-hover: oklch(0.97 0 0);
|
||||
--ipal-focus: var(--ipal-link);
|
||||
--ipal-focus-inverse: var(--ipal-text-inverse);
|
||||
--ipal-overlay: oklch(0 0 0 / 0.5);
|
||||
--ipal-success: oklch(0.527 0.154 150.069);
|
||||
--ipal-success-surface: oklch(0.982 0.018 155.826);
|
||||
--ipal-warning: oklch(0.555 0.163 48.998);
|
||||
--ipal-warning-surface: oklch(0.987 0.022 95.277);
|
||||
--ipal-danger: oklch(0.505 0.213 27.518);
|
||||
--ipal-danger-surface: oklch(0.971 0.013 17.38);
|
||||
--ipal-info: oklch(0.488 0.243 264.376);
|
||||
--ipal-info-surface: oklch(0.97 0.014 254.604);
|
||||
--ipal-font-body: var(--font-family-body, ui-sans-serif, system-ui, sans-serif);
|
||||
--ipal-font-heading: var(--font-family-heading, var(--ipal-font-body));
|
||||
--ipal-font-mono: var(--font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
|
||||
--ipal-lh-body: 1.6;
|
||||
--ipal-lh-heading: 1.15;
|
||||
--ipal-fw-body: 400;
|
||||
--ipal-fw-heading: 650;
|
||||
--ipal-tracking-heading: -0.01em;
|
||||
--ipal-radius: 0.375rem;
|
||||
--ipal-radius-sm: 0.25rem;
|
||||
--ipal-radius-card: 0.75rem;
|
||||
--ipal-radius-media: 0.5rem;
|
||||
--ipal-radius-full: 9999px;
|
||||
--ipal-shadow-sm: 0 1px 2px 0 oklch(0 0 0 / 0.06), 0 1px 3px 0 oklch(0 0 0 / 0.08);
|
||||
--ipal-shadow-md: 0 4px 8px -2px oklch(0 0 0 / 0.08), 0 2px 4px -2px oklch(0 0 0 / 0.06);
|
||||
--ipal-shadow-lg: 0 16px 32px -8px oklch(0 0 0 / 0.14), 0 4px 8px -4px oklch(0 0 0 / 0.08);
|
||||
--ipal-container-narrow: 48rem;
|
||||
--ipal-duration-fast: 150ms;
|
||||
--ipal-duration: 250ms;
|
||||
--ipal-duration-slow: 400ms;
|
||||
--ipal-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
|
||||
--ipal-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
|
||||
--ipal-z-header: 40;
|
||||
--ipal-z-overlay: 50;
|
||||
--ipal-z-toast: 60;
|
||||
--ipal-focus-width: 2px;
|
||||
--ipal-focus-offset: 2px;
|
||||
color-scheme: light;
|
||||
}
|
||||
|
||||
:root[data-theme="dark"] {
|
||||
--ipal-bg: oklch(0.145 0 0);
|
||||
--ipal-surface: oklch(0.205 0 0);
|
||||
--ipal-surface-muted: oklch(0.18 0 0);
|
||||
--ipal-surface-raised: oklch(0.235 0 0);
|
||||
--ipal-surface-inverse: oklch(0.97 0 0);
|
||||
--ipal-text: oklch(0.87 0 0);
|
||||
--ipal-text-strong: oklch(0.97 0 0);
|
||||
--ipal-text-muted: oklch(0.708 0 0);
|
||||
--ipal-text-inverse: oklch(0.205 0 0);
|
||||
--ipal-border: oklch(0.269 0 0);
|
||||
--ipal-border-strong: oklch(0.371 0 0);
|
||||
--ipal-primary: oklch(0.546 0.245 262.881);
|
||||
--ipal-primary-hover: color-mix(in oklch, var(--ipal-primary), black 12%);
|
||||
--ipal-primary-text: oklch(1 0 0);
|
||||
--ipal-secondary: var(--ipal-text-strong);
|
||||
--ipal-secondary-hover: color-mix(in oklch, var(--ipal-secondary), black 12%);
|
||||
--ipal-secondary-text: var(--ipal-text-inverse);
|
||||
--ipal-accent: var(--ipal-primary);
|
||||
--ipal-accent-text: var(--ipal-primary-text);
|
||||
--ipal-link: color-mix(in oklch, var(--ipal-primary), white 40%);
|
||||
--ipal-link-hover: color-mix(in oklch, var(--ipal-link), var(--ipal-text-strong) 30%);
|
||||
--ipal-link-inverse: var(--ipal-text-inverse);
|
||||
--ipal-hover: oklch(0.269 0 0);
|
||||
--ipal-focus: var(--ipal-link);
|
||||
--ipal-focus-inverse: var(--ipal-text-inverse);
|
||||
--ipal-overlay: oklch(0 0 0 / 0.65);
|
||||
--ipal-success: oklch(0.792 0.209 151.711);
|
||||
--ipal-success-surface: oklch(0.266 0.065 152.934);
|
||||
--ipal-warning: oklch(0.828 0.189 84.429);
|
||||
--ipal-warning-surface: oklch(0.279 0.077 45.635);
|
||||
--ipal-danger: oklch(0.704 0.191 22.216);
|
||||
--ipal-danger-surface: oklch(0.258 0.092 26.042);
|
||||
--ipal-info: oklch(0.707 0.165 254.624);
|
||||
--ipal-info-surface: oklch(0.282 0.091 267.935);
|
||||
--ipal-shadow-sm: 0 1px 2px 0 oklch(0 0 0 / 0.4), 0 0 0 1px oklch(1 0 0 / 0.04);
|
||||
--ipal-shadow-md: 0 4px 8px -2px oklch(0 0 0 / 0.5), 0 0 0 1px oklch(1 0 0 / 0.05);
|
||||
--ipal-shadow-lg: 0 16px 32px -8px oklch(0 0 0 / 0.6), 0 0 0 1px oklch(1 0 0 / 0.06);
|
||||
--ipal-surface-dark: var(--ipal-surface);
|
||||
--ipal-border-dark: var(--ipal-border);
|
||||
--ipal-text-dark: var(--ipal-text);
|
||||
--ipal-text-strong-dark: var(--ipal-text-strong);
|
||||
--ipal-text-muted-dark: var(--ipal-text-muted);
|
||||
--ipal-primary-dark: var(--ipal-primary);
|
||||
--ipal-primary-hover-dark: var(--ipal-primary-hover);
|
||||
--ipal-primary-text-dark: var(--ipal-primary-text);
|
||||
--ipal-hover-dark: var(--ipal-hover);
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
/* Inverted section (settings.background = inverted): content inside reads the inverse roles. */
|
||||
|
||||
[data-surface="inverse"] {
|
||||
--ipal-text: var(--ipal-text-inverse);
|
||||
--ipal-text-strong: var(--ipal-text-inverse);
|
||||
--ipal-text-muted: color-mix(in oklch, var(--ipal-text-inverse) 72%, var(--ipal-surface-inverse));
|
||||
--ipal-border: color-mix(in oklch, var(--ipal-text-inverse) 18%, var(--ipal-surface-inverse));
|
||||
--ipal-border-strong: color-mix(in oklch, var(--ipal-text-inverse) 30%, var(--ipal-surface-inverse));
|
||||
--ipal-surface: color-mix(in oklch, var(--ipal-text-inverse) 8%, var(--ipal-surface-inverse));
|
||||
--ipal-hover: color-mix(in oklch, var(--ipal-text-inverse) 12%, var(--ipal-surface-inverse));
|
||||
--ipal-link: var(--ipal-link-inverse);
|
||||
--ipal-focus: var(--ipal-focus-inverse);
|
||||
--ipal-link-hover: var(--ipal-link-inverse);
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
:root[data-theme="dark"] [data-surface="inverse"] {
|
||||
color-scheme: light;
|
||||
}
|
||||
|
||||
/* No motion for people who asked for none (the a11y widget's "no animations" too). */
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
html:root {
|
||||
--ipal-duration-fast: 0ms;
|
||||
--ipal-duration: 0ms;
|
||||
--ipal-duration-slow: 0ms;
|
||||
}
|
||||
}
|
||||
|
||||
html[data-a11y-motion="reduce"] {
|
||||
--ipal-duration-fast: 0ms;
|
||||
--ipal-duration: 0ms;
|
||||
--ipal-duration-slow: 0ms;
|
||||
}
|
||||
Reference in New Issue
Block a user