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]>
63 lines
3.6 KiB
CSS
63 lines
3.6 KiB
CSS
/*
|
||
* @intecion/ipal-kit/fluid.css — fluid type & spacing scale (variables only, no classes).
|
||
* Scales smoothly from a 360px to a 1280px viewport; rem-based, so browser zoom and
|
||
* user font size still work (WCAG 1.4.4). Opt-in:
|
||
*
|
||
* @import "tailwindcss";
|
||
* @import "@intecion/ipal-kit/fluid.css";
|
||
* @theme inline {
|
||
* --text-display: var(--ipal-fs-display);
|
||
* --text-h1: var(--ipal-fs-h1);
|
||
* --text-h2: var(--ipal-fs-h2);
|
||
* --text-h3: var(--ipal-fs-h3);
|
||
* --text-lead: var(--ipal-fs-lg);
|
||
* --spacing-section: var(--ipal-space-section);
|
||
* --spacing-gutter: var(--ipal-space-gutter);
|
||
* --spacing-gap: var(--ipal-space-gap);
|
||
* }
|
||
* → text-h1, text-display, py-section, px-gutter, gap-gap
|
||
*
|
||
* The design (DESIGN.md) decides the numbers: override any variable in the project's
|
||
* :root — the plugin only removes the clamp() maths from every project.
|
||
*
|
||
* Wider screens should keep growing (13" laptop → 27" monitor)? Import
|
||
* @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 */
|
||
}
|
||
|
||
/*
|
||
* Layout & height-aware helpers (added in 1.9.1 — nothing uses them until the
|
||
* project does, so existing sites look exactly the same):
|
||
* max-w-[var(--ipal-measure)] comfortable line length for running text
|
||
* --ipal-container / -wide content widths for the section container
|
||
* min-h-[var(--ipal-hero-min-h)] hero that fills a laptop screen, not a 4K one
|
||
* text-[length:var(--ipal-fs-display-fit)], py-[var(--ipal-space-section-fit)]
|
||
* shrink on SHORT screens (1366×768, 1280×720,
|
||
* landscape phones) so the hero CTA stays above the fold
|
||
* svh = the small viewport height (mobile browser bars shown) — never 100vh.
|
||
*/
|
||
:root {
|
||
--ipal-measure: 68ch;
|
||
--ipal-container: 80rem;
|
||
--ipal-container-wide: 96rem;
|
||
--ipal-hero-min-h: min(100svh, 56rem);
|
||
--ipal-fs-display-fit: min(var(--ipal-fs-display), 7svh + 0.75rem);
|
||
--ipal-fs-h1-fit: min(var(--ipal-fs-h1), 6svh + 0.5rem);
|
||
--ipal-space-section-fit: min(var(--ipal-space-section), 10svh);
|
||
}
|