foldkit-mixins 0.18.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -2
- package/dist/app.d.mts +1 -1
- package/dist/app.mjs +1 -1
- package/dist/defaults.mjs +2 -2
- package/dist/defaults.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/prose.d.mts +2 -0
- package/dist/prose.d.mts.map +1 -1
- package/dist/prose.mjs +4 -2
- package/dist/prose.mjs.map +1 -1
- package/dist/{root-CT_iUZvD.mjs → root-DdIhpyqg.mjs} +2 -2
- package/dist/{root-CT_iUZvD.mjs.map → root-DdIhpyqg.mjs.map} +1 -1
- package/dist/styleValue-6hpAYYfg.mjs.map +1 -1
- package/dist/theme.d.mts +100 -3
- package/dist/theme.d.mts.map +1 -1
- package/dist/theme.mjs +7 -3
- package/dist/theme.mjs.map +1 -1
- package/dist/{themes-DF2Spo6_.d.mts → themes-Dum5GN0v.d.mts} +46 -4
- package/dist/themes-Dum5GN0v.d.mts.map +1 -0
- package/dist/{tokens-CkTT9DNd.mjs → tokens-BFpuo-sA.mjs} +218 -23
- package/dist/tokens-BFpuo-sA.mjs.map +1 -0
- package/dist/{tokens-C4tC1NFW.d.mts → tokens-eAYuf574.d.mts} +37 -4
- package/dist/tokens-eAYuf574.d.mts.map +1 -0
- package/dist/utilities.d.mts +1 -1
- package/dist/utilities.mjs +1 -1
- package/package.json +6 -6
- package/dist/themes-DF2Spo6_.d.mts.map +0 -1
- package/dist/tokens-C4tC1NFW.d.mts.map +0 -1
- package/dist/tokens-CkTT9DNd.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -277,8 +277,8 @@ one.
|
|
|
277
277
|
| `Theme.root(theme, { omit?, colorScheme? })` / `Theme.scoped(theme, selector, overrides)` | from `foldkit-mixins/theme`: tokens as `:root` custom properties, or as overrides under a selector; unlayered global pieces for `Style.stylesheet` |
|
|
278
278
|
| `Theme.schemeScript(key?)` / `Theme.chooseScheme(scheme, key?)` / `Theme.currentScheme()` | from `foldkit-mixins/theme`: a head script applying a kept `light` or `dark` before the first paint; a Command's Effect that applies and keeps a choice; the scheme applied now |
|
|
279
279
|
| `Theme.knobScript({ key?, selector? })` / `Theme.chooseKnobs(theme, { base, key?, selector? })` | from `foldkit-mixins/theme`: a head script applying kept knob variables before the first paint; a Command's Effect that applies `theme`'s knobs that differ from `base` and keeps them |
|
|
280
|
-
| `Theme.make(values)` / `Theme.standard(theme?)` | from `foldkit-mixins/theme`: a theme, the typed knob values it changes (`Knobs.standard`); every shipped token with a theme's knobs, for `Theme.root
|
|
281
|
-
| `Theme.tokens` / `Theme.breakpointWidths(theme)` | from `foldkit-mixins/theme`: the shipped spacing, type, radius, motion, width, border, shadow and breakpoint scales, `icon` (the masks the components draw their own icons with, Lucide's by default; an application's pack is `foldkit-mixins-ui`'s `Icons.tokens(pack)`, passed as its own tokens), and `safe` (what a notch or the home indicator takes from each screen edge, `env(safe-area-inset-*)`, 0 unless the viewport meta says `viewport-fit=cover`); the breakpoints as pixel widths for `foldkit-primitives/media` |
|
|
280
|
+
| `Theme.make(values)` / `Theme.standard(theme?)` / `Theme.fluidType({ min, max })` | from `foldkit-mixins/theme`: a theme, the typed knob values it changes (`Knobs.standard`); every shipped token with a theme's knobs, for `Theme.root`; one size blended between two lengths by the theme's fluid range |
|
|
281
|
+
| `Theme.tokens` / `Theme.breakpointWidths(theme)` | from `foldkit-mixins/theme`: the shipped spacing, type, reading, radius, motion, width, border, shadow and breakpoint scales, `icon` (the masks the components draw their own icons with, Lucide's by default; an application's pack is `foldkit-mixins-ui`'s `Icons.tokens(pack)`, passed as its own tokens), and `safe` (what a notch or the home indicator takes from each screen edge, `env(safe-area-inset-*)`, 0 unless the viewport meta says `viewport-fit=cover`); the breakpoints as pixel widths for `foldkit-primitives/media` |
|
|
282
282
|
| `Layers.define(names)` / `Layers.standard` | cascade layers as a value: `names`, `declare` (the `@layer …;` statement as a global piece), `in(name, piece)` (a piece's unlayered rules and global CSS inside that layer; what is already layered keeps its layer; a piece wholly in another layer is `style:relayered`) and `layer(name)` (the placement `Style.forSlots(S)(pieces, { layer })` takes, so a slot style is compiled in that layer). A name outside the order is a type error. `standard` is `reset, tokens, theme, defaults, components, layouts, variants, utilities, app`; also under `foldkit-mixins/layers` |
|
|
283
283
|
| `Style.stylesheet(...)` | one `<style>` block from `NamedStyle`s and bare `StyleValue`s: the layer order hoisted first (two different orders is `style:conflicting-layer-order`), then global chunks, then scoped classes, deduplicated. Once an order is declared, a rule outside it is `style:unlayered-rule`, since it would beat every layer; keyframes, font faces and `@property` pass |
|
|
284
284
|
|
|
@@ -379,6 +379,30 @@ reaches a knob by its path, typed by it: `Knobs.paths(knobs)` lists them, `Knobs
|
|
|
379
379
|
theme, checked by its knob; a schemed knob's `light` and `dark` are knobs of their own, each with its
|
|
380
380
|
range. `/create` is drawn this way.
|
|
381
381
|
|
|
382
|
+
Type is still by default. `type.fluid` (0 to 1) says how much larger every size grows between
|
|
383
|
+
`type.viewportMin` and `type.viewportMax`: `0` is today's fixed scale, `1` uses the whole range,
|
|
384
|
+
and the growth is larger the further a step stands above the body. The `fluid` token group is
|
|
385
|
+
`ratio` (the viewport's place in that range, 0 to 1) and `progress` (that place at the theme's
|
|
386
|
+
strength); `Theme.fluidType({ min, max })` writes the same blend for one value, so a heading reads
|
|
387
|
+
its size from the page's range instead of a `clamp()` with a `vw` in it. A range of its own is
|
|
388
|
+
`Theme.fluidType({ min, max, viewport: { min: '500px', max: '1000px' } })`.
|
|
389
|
+
|
|
390
|
+
Reading is its own group: `reading.measure` is a length in `ch` (65 by default) that caps
|
|
391
|
+
`Prose` and the `body`, `lead` and `quote` levels of `Typography`; `reading.headingWrap` and
|
|
392
|
+
`reading.bodyWrap` choose `balance`, `pretty` or `wrap`; and `reading.align` is `start`,
|
|
393
|
+
`center`, `end` or `justify`. `Prose.style({ measure, align })` still overrides them for one
|
|
394
|
+
container.
|
|
395
|
+
|
|
396
|
+
A frame narrower than the window measures its own width: `Theme.containerFluidProgress()` is
|
|
397
|
+
the progress of the nearest `container-type: inline-size` ancestor, for setting
|
|
398
|
+
`--fk-fluid-progress` on its contents, and `Theme.fluidType({ min, max, container: true })`
|
|
399
|
+
uses it directly. `/create`'s previews and the CMS hero are drawn this way.
|
|
400
|
+
|
|
401
|
+
`Typography`'s `display`, `title` and `subtitle` grow with the same progress, their leading
|
|
402
|
+
growing with their size: `Theme.role('display', { fluid: true })`. The interface roles
|
|
403
|
+
`body`, `caption` and `micro` stay on the control ladder, so a button's or a field's words do
|
|
404
|
+
not outgrow its height.
|
|
405
|
+
|
|
382
406
|
Themes are installed by name, the names being a record's keys:
|
|
383
407
|
|
|
384
408
|
```ts
|
package/dist/app.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { i as StyleValue } from "./styleValue-DEsUAC4v.mjs";
|
|
|
2
2
|
import { standard } from "./layers.mjs";
|
|
3
3
|
import { a as NamedStyle, l as StyleOptions, n as Declared, r as DeclaredPieces, u as StylePieces } from "./style-Cs-aMa_a.mjs";
|
|
4
4
|
import { a as compose, r as ThemeTokens, t as Refs } from "./core-Cq9PThXv.mjs";
|
|
5
|
-
import { d as RootOptions, g as KnobTheme, r as Themes, t as StandardTokens, v as Standard } from "./themes-
|
|
5
|
+
import { d as RootOptions, g as KnobTheme, r as Themes, t as StandardTokens, v as Standard } from "./themes-Dum5GN0v.mjs";
|
|
6
6
|
//#region src/app.d.ts
|
|
7
7
|
interface Common<Own extends ThemeTokens> {
|
|
8
8
|
/**
|
package/dist/app.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { i as stylesheet, n as forSlots, r as slots } from "./style-COMT0F2e.mjs
|
|
|
2
2
|
import { i as compose } from "./styleValue-6hpAYYfg.mjs";
|
|
3
3
|
import { r as standard } from "./layers-DxWvuCJL.mjs";
|
|
4
4
|
import { o as ref, r as compose$1 } from "./core-BrR6UPbk.mjs";
|
|
5
|
-
import { l as standardOf, t as root } from "./root-
|
|
5
|
+
import { l as standardOf, t as root } from "./root-DdIhpyqg.mjs";
|
|
6
6
|
import { body, reset } from "./defaults.mjs";
|
|
7
7
|
//#region src/app.ts
|
|
8
8
|
/**
|
package/dist/defaults.mjs
CHANGED
|
@@ -20,8 +20,8 @@ const reset = global([
|
|
|
20
20
|
":where(:is(img,picture,video,canvas,svg)){display:block;max-inline-size:100%;block-size:auto}",
|
|
21
21
|
":where(:is(input,button,textarea,select)){font:inherit;color:inherit}",
|
|
22
22
|
":where(textarea){field-sizing:content;min-block-size:2lh}",
|
|
23
|
-
":where(:is(h1,h2,h3,h4,h5,h6)){text-wrap:balance}",
|
|
24
|
-
":where(p){text-wrap:pretty;overflow-wrap:break-word}",
|
|
23
|
+
":where(:is(h1,h2,h3,h4,h5,h6)){text-wrap:var(--fk-reading-heading-wrap, balance)}",
|
|
24
|
+
":where(p){text-wrap:var(--fk-reading-body-wrap, pretty);overflow-wrap:break-word}",
|
|
25
25
|
`@media (prefers-reduced-motion:reduce){*,*::before,*::after{--fk-knob-travel:0!important;animation-duration:0.01ms!important;scroll-behavior:auto!important}}`
|
|
26
26
|
].join(""));
|
|
27
27
|
/** The page's font, color, background, and color scheme. */
|
package/dist/defaults.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.mjs","names":[],"sources":["../src/defaults.ts"],"sourcesContent":["/**\n * `foldkit-mixins/defaults`: the baseline plain HTML gets before any slot is\n * styled. Every member is element-selector CSS over `--fk-*` tokens with a\n * fallback, so it re-themes with the tokens and still reads without them.\n * The pieces are unlayered; a page puts `reset` in `reset` and the rest in\n * `defaults` with `Layers.standard.in`. Selectors use `:where()` so any\n * class rule beats them.\n */\nimport { compose, global } from './styleValue.js'\nimport type { StyleValue } from './styleValue.js'\n\nconst v = (name: string, fallback: string): string => `var(--fk-${name}, ${fallback})`\n\n/** Box model, margins, media, form-control fonts: what every page assumes. */\nexport const reset: StyleValue = global(\n [\n '*,*::before,*::after{box-sizing:border-box;margin:0;min-width:0}',\n // 100%, not none: none stops a phone enlarging text in landscape, and also the\n // reader's own text size, where a browser applies it through this property.\n ':where(html){text-size-adjust:100%;-webkit-text-size-adjust:100%;tab-size:4;font-synthesis:none;text-rendering:optimizeLegibility}',\n // A tap draws no grey square of the browser's own: what was pressed shows its own\n // `:active` state (Defaults.controls, the recipes). And a second tap is a tap, not a\n // zoom, so a quick press on a stepper or a pager does not wait for one.\n ':where(:root){-webkit-tap-highlight-color:transparent}',\n ':where(:is(a,button,input,select,textarea,summary,label,[role=button],[role=tab],[role=option],[role=menuitem])){touch-action:manipulation}',\n // What a finger needs, 44px, as the platforms advise: the recipes' controls are at least\n // this tall where the pointer is coarse, and keep their density elsewhere. A region that\n // must stay dense sets it to 0.\n '@media (pointer:coarse){:where(:root){--fk-touch-floor:2.75rem}}',\n // A control's words are its name, not text to select: a long press on a button, a tab or\n // a menu row selected them on a phone and offered to copy, and a double tap selected a\n // word. Prefixed by hand, as iOS Safari reads only the prefixed one. Not a tree's rows or\n // a grid's cells, whose text may be edited or copied.\n ':where(:is(button,summary,[role=button],[role=tab],[role=option],[role=menuitem],[role=menuitemcheckbox],[role=menuitemradio],[role=switch],[role=checkbox],[role=radio])){-webkit-user-select:none;user-select:none}',\n ':where(:is(img,picture,video,canvas,svg)){display:block;max-inline-size:100%;block-size:auto}',\n ':where(:is(input,button,textarea,select)){font:inherit;color:inherit}',\n ':where(textarea){field-sizing:content;min-block-size:2lh}',\n ':where(:is(h1,h2,h3,h4,h5,h6)){text-wrap:balance}',\n ':where(p){text-wrap:pretty;overflow-wrap:break-word}',\n // Reduced motion is fewer and gentler, not none: what moves snaps (the\n // `travel` knob on every element, important so one that sets the knob\n // itself, a scoped theme's or an inline one, cannot restore it), while a\n // fade keeps its duration. Keyframes are a recipe's own and still stop.\n `@media (prefers-reduced-motion:reduce){*,*::before,*::after{--fk-knob-travel:0!important;animation-duration:0.01ms!important;scroll-behavior:auto!important}}`,\n ].join(''),\n)\n\n/** The page's font, color, background, and color scheme. */\nexport const body: StyleValue = global(\n // Scrollbars in the theme's line color, which keeps the page's hue, not the\n // browser's grey; inherited, so one rule reaches every scrolling panel.\n `:where(:root){scrollbar-color:${v('outline-overt', 'auto')} transparent;accent-color:${v('accent-default', 'auto')}}` +\n // Selected text in the accent's tint rather than the browser's own blue.\n `:where(::selection){background:color-mix(in oklab, ${v('accent-default', 'Highlight')} 28%, transparent)}` +\n `:where(body){font-family:${v('font-body', 'system-ui, sans-serif')};font-size:${v('size-md', '1rem')};line-height:${v('leading-normal', '1.5')};font-weight:${v('weight-normal', '400')};color:${v('text-default', 'CanvasText')};background:${v('surface-base', 'Canvas')};-webkit-font-smoothing:antialiased}`,\n)\n\n/**\n * A type hierarchy for h1 to h6 from the size scale, in `text-overt`. A\n * container drawn in a color of its own, such as a band on the accent, sets\n * `--fk-heading: currentColor` (`Style.vars`) and its headings take its color.\n */\nexport const headings: StyleValue = global(\n [\n `:where(:is(h1,h2,h3,h4,h5,h6)){font-family:${v('font-heading', 'inherit')};font-weight:${v('weight-bold', '700')};line-height:${v('leading-tight', '1.2')};color:${v('heading', v('text-overt', 'inherit'))};letter-spacing:-0.01em}`,\n `:where(h1){font-size:${v('size-4xl', '2.25rem')}}`,\n `:where(h2){font-size:${v('size-3xl', '1.875rem')}}`,\n `:where(h3){font-size:${v('size-2xl', '1.5rem')}}`,\n `:where(h4){font-size:${v('size-xl', '1.25rem')}}`,\n `:where(h5){font-size:${v('size-lg', '1.125rem')}}`,\n `:where(h6){font-size:${v('size-md', '1rem')}}`,\n ].join(''),\n)\n\n/** Link color, hover, and a visible focus ring. */\nexport const links: StyleValue = global(\n [\n `:where(a){color:${v('text-link', 'LinkText')};text-decoration-thickness:from-font;text-underline-offset:0.15em}`,\n // Only where something hovers: a touch screen keeps `:hover` on the link tapped last.\n `@media (hover:hover){:where(a:hover){color:${v('text-link-hover', 'LinkText')}}}`,\n `:where(a:active){color:${v('text-link-hover', 'LinkText')}}`,\n `:where(:is(a,button,input,select,textarea,summary,[tabindex]):focus-visible){outline:${v('border-thick', '2px')} solid ${v('outline-focus', 'Highlight')};outline-offset:2px}`,\n ].join(''),\n)\n\n/** Inline code and code blocks on the subtle surface. */\nexport const code: StyleValue = global(\n [\n `:where(:is(code,kbd,samp,pre)){font-family:${v('font-mono', 'ui-monospace, monospace')};font-size:${v('size-sm', '0.875rem')}}`,\n `:where(:not(pre)>code){padding:0.1em 0.35em;border-radius:${v('radius-sm', '3px')};background:${v('surface-muted', 'transparent')};overflow-wrap:anywhere}`,\n `:where(kbd){padding:0.1em 0.4em;border:${v('border-thin', '1px')} solid ${v('outline-default', 'currentColor')};border-block-end-width:2px;border-radius:${v('radius-sm', '3px')};font-size:0.85em}`,\n `:where(hr){border:0;border-block-start:${v('border-thin', '1px')} solid ${v('outline-subtle', 'currentColor')}}`,\n `:where(pre){padding:${v('space-md', '1rem')};border:${v('border-thin', '1px')} solid ${v('outline-subtle', 'transparent')};border-radius:${v('radius-md', '6px')};background:${v('surface-subtle', 'transparent')};overflow-x:auto;line-height:${v('leading-snug', '1.375')}}`,\n ].join(''),\n)\n\n/** Text inputs, selects, textareas, and buttons: one radius, one border, one focus. */\nexport const controls: StyleValue = global(\n [\n `:where(:is(input:not([type=checkbox],[type=radio],[type=range],[type=color],[type=file]),select,textarea)){padding:${v('space-xs', '0.5rem')} ${v('space-sm', '0.75rem')};border:${v('border-thin', '1px')} solid ${v('outline-default', 'ButtonBorder')};border-radius:${v('radius-md', '6px')};background:${v('surface-base', 'Field')};color:${v('text-default', 'FieldText')};transition:border-color ${v('motion-fast', '150ms')} ${v('motion-ease', 'ease-out')}}`,\n `:where(:is(input,select,textarea):focus-visible){border-color:${v('accent-default', 'Highlight')}}`,\n `:where(:is(input,select,textarea)[aria-invalid=true]){border-color:${v('error-default', 'red')}}`,\n `:where(button,[type=button],[type=submit],[type=reset]){padding:${v('space-xs', '0.5rem')} ${v('space-md', '1rem')};border:${v('border-thin', '1px')} solid ${v('outline-default', 'ButtonBorder')};border-radius:${v('radius-md', '6px')};background:${v('surface-subtle', 'ButtonFace')};color:${v('text-default', 'ButtonText')};cursor:pointer;transition:background ${v('motion-fast', '150ms')} ${v('motion-ease', 'ease-out')}}`,\n `@media (hover:hover){:where(button,[type=button],[type=submit],[type=reset]):hover{background:${v('surface-muted', 'ButtonFace')}}}`,\n `:where(button,[type=button],[type=submit],[type=reset]):active{background:${v('surface-muted', 'ButtonFace')}}`,\n `:where(:is(button,input,select,textarea):disabled){opacity:0.5;cursor:not-allowed}`,\n `:where(:is(input,select,textarea,button)::placeholder){color:${v('text-muted', 'GrayText')}}`,\n ].join(''),\n)\n\n/** Every default except `reset`, which belongs in its own layer. */\nexport const all: StyleValue = compose(body, headings, links, code, controls)\n\nexport const Defaults = { reset, body, headings, links, code, controls, all } as const\n"],"mappings":";;;;;;;;;;AAWA,MAAM,KAAK,MAAc,aAA6B,YAAY,KAAK,IAAI,SAAS;;AAGpF,MAAa,QAAoB,OAC/B;CACE;CAGA;CAIA;CACA;CAIA;CAKA;CACA;CACA;CACA;CACA;CACA;CAKA;AACF,CAAC,CAAC,KAAK,EAAE,CACX;;AAGA,MAAa,OAAmB,OAG9B,iCAAiC,EAAE,iBAAiB,MAAM,EAAE,4BAA4B,EAAE,kBAAkB,MAAM,EAAE,sDAE5D,EAAE,kBAAkB,WAAW,EAAE,8CAC3D,EAAE,aAAa,uBAAuB,EAAE,aAAa,EAAE,WAAW,MAAM,EAAE,eAAe,EAAE,kBAAkB,KAAK,EAAE,eAAe,EAAE,iBAAiB,KAAK,EAAE,SAAS,EAAE,gBAAgB,YAAY,EAAE,cAAc,EAAE,gBAAgB,QAAQ,EAAE,qCAChR;;;;;;AAOA,MAAa,WAAuB,OAClC;CACE,8CAA8C,EAAE,gBAAgB,SAAS,EAAE,eAAe,EAAE,eAAe,KAAK,EAAE,eAAe,EAAE,iBAAiB,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,SAAS,CAAC,E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AAK,EAAE,SAAS,EAAE,mBAAmB,cAAc,EAAE,iBAAiB,EAAE,aAAa,KAAK,EAAE,cAAc,EAAE,gBAAgB,OAAO,EAAE,SAAS,EAAE,gBAAgB,WAAW,EAAE,2BAA2B,EAAE,eAAe,OAAO,EAAE,GAAG,EAAE,eAAe,UAAU,EAAE;CACvc,iEAAiE,EAAE,kBAAkB,WAAW,EAAE;CAClG,sEAAsE,EAAE,iBAAiB,KAAK,EAAE;CAChG,mEAAmE,EAAE,YAAY,QAAQ,EAAE,GAAG,EAAE,YAAY,MAAM,EAAE,UAAU,EAAE,eAAe,KAAK,EAAE,SAAS,EAAE,mBAAmB,cAAc,EAAE,iBAAiB,EAAE,aAAa,KAAK,EAAE,cAAc,EAAE,kBAAkB,YAAY,EAAE,SAAS,EAAE,gBAAgB,YAAY,EAAE,wCAAwC,EAAE,eAAe,OAAO,EAAE,GAAG,EAAE,eAAe,UAAU,EAAE;CACta,iGAAiG,EAAE,iBAAiB,YAAY,EAAE;CAClI,6EAA6E,EAAE,iBAAiB,YAAY,EAAE;CAC9G;CACA,gEAAgE,EAAE,cAAc,UAAU,EAAE;AAC9F,CAAC,CAAC,KAAK,EAAE,CACX;;AAGA,MAAa,MAAkB,QAAQ,MAAM,UAAU,OAAO,MAAM,QAAQ;AAE5E,MAAa,WAAW;CAAE;CAAO;CAAM;CAAU;CAAO;CAAM;CAAU;AAAI"}
|
|
1
|
+
{"version":3,"file":"defaults.mjs","names":[],"sources":["../src/defaults.ts"],"sourcesContent":["/**\n * `foldkit-mixins/defaults`: the baseline plain HTML gets before any slot is\n * styled. Every member is element-selector CSS over `--fk-*` tokens with a\n * fallback, so it re-themes with the tokens and still reads without them.\n * The pieces are unlayered; a page puts `reset` in `reset` and the rest in\n * `defaults` with `Layers.standard.in`. Selectors use `:where()` so any\n * class rule beats them.\n */\nimport { compose, global } from './styleValue.js'\nimport type { StyleValue } from './styleValue.js'\n\nconst v = (name: string, fallback: string): string => `var(--fk-${name}, ${fallback})`\n\n/** Box model, margins, media, form-control fonts: what every page assumes. */\nexport const reset: StyleValue = global(\n [\n '*,*::before,*::after{box-sizing:border-box;margin:0;min-width:0}',\n // 100%, not none: none stops a phone enlarging text in landscape, and also the\n // reader's own text size, where a browser applies it through this property.\n ':where(html){text-size-adjust:100%;-webkit-text-size-adjust:100%;tab-size:4;font-synthesis:none;text-rendering:optimizeLegibility}',\n // A tap draws no grey square of the browser's own: what was pressed shows its own\n // `:active` state (Defaults.controls, the recipes). And a second tap is a tap, not a\n // zoom, so a quick press on a stepper or a pager does not wait for one.\n ':where(:root){-webkit-tap-highlight-color:transparent}',\n ':where(:is(a,button,input,select,textarea,summary,label,[role=button],[role=tab],[role=option],[role=menuitem])){touch-action:manipulation}',\n // What a finger needs, 44px, as the platforms advise: the recipes' controls are at least\n // this tall where the pointer is coarse, and keep their density elsewhere. A region that\n // must stay dense sets it to 0.\n '@media (pointer:coarse){:where(:root){--fk-touch-floor:2.75rem}}',\n // A control's words are its name, not text to select: a long press on a button, a tab or\n // a menu row selected them on a phone and offered to copy, and a double tap selected a\n // word. Prefixed by hand, as iOS Safari reads only the prefixed one. Not a tree's rows or\n // a grid's cells, whose text may be edited or copied.\n ':where(:is(button,summary,[role=button],[role=tab],[role=option],[role=menuitem],[role=menuitemcheckbox],[role=menuitemradio],[role=switch],[role=checkbox],[role=radio])){-webkit-user-select:none;user-select:none}',\n ':where(:is(img,picture,video,canvas,svg)){display:block;max-inline-size:100%;block-size:auto}',\n ':where(:is(input,button,textarea,select)){font:inherit;color:inherit}',\n ':where(textarea){field-sizing:content;min-block-size:2lh}',\n ':where(:is(h1,h2,h3,h4,h5,h6)){text-wrap:var(--fk-reading-heading-wrap, balance)}',\n ':where(p){text-wrap:var(--fk-reading-body-wrap, pretty);overflow-wrap:break-word}',\n // Reduced motion is fewer and gentler, not none: what moves snaps (the\n // `travel` knob on every element, important so one that sets the knob\n // itself, a scoped theme's or an inline one, cannot restore it), while a\n // fade keeps its duration. Keyframes are a recipe's own and still stop.\n `@media (prefers-reduced-motion:reduce){*,*::before,*::after{--fk-knob-travel:0!important;animation-duration:0.01ms!important;scroll-behavior:auto!important}}`,\n ].join(''),\n)\n\n/** The page's font, color, background, and color scheme. */\nexport const body: StyleValue = global(\n // Scrollbars in the theme's line color, which keeps the page's hue, not the\n // browser's grey; inherited, so one rule reaches every scrolling panel.\n `:where(:root){scrollbar-color:${v('outline-overt', 'auto')} transparent;accent-color:${v('accent-default', 'auto')}}` +\n // Selected text in the accent's tint rather than the browser's own blue.\n `:where(::selection){background:color-mix(in oklab, ${v('accent-default', 'Highlight')} 28%, transparent)}` +\n `:where(body){font-family:${v('font-body', 'system-ui, sans-serif')};font-size:${v('size-md', '1rem')};line-height:${v('leading-normal', '1.5')};font-weight:${v('weight-normal', '400')};color:${v('text-default', 'CanvasText')};background:${v('surface-base', 'Canvas')};-webkit-font-smoothing:antialiased}`,\n)\n\n/**\n * A type hierarchy for h1 to h6 from the size scale, in `text-overt`. A\n * container drawn in a color of its own, such as a band on the accent, sets\n * `--fk-heading: currentColor` (`Style.vars`) and its headings take its color.\n */\nexport const headings: StyleValue = global(\n [\n `:where(:is(h1,h2,h3,h4,h5,h6)){font-family:${v('font-heading', 'inherit')};font-weight:${v('weight-bold', '700')};line-height:${v('leading-tight', '1.2')};color:${v('heading', v('text-overt', 'inherit'))};letter-spacing:-0.01em}`,\n `:where(h1){font-size:${v('size-4xl', '2.25rem')}}`,\n `:where(h2){font-size:${v('size-3xl', '1.875rem')}}`,\n `:where(h3){font-size:${v('size-2xl', '1.5rem')}}`,\n `:where(h4){font-size:${v('size-xl', '1.25rem')}}`,\n `:where(h5){font-size:${v('size-lg', '1.125rem')}}`,\n `:where(h6){font-size:${v('size-md', '1rem')}}`,\n ].join(''),\n)\n\n/** Link color, hover, and a visible focus ring. */\nexport const links: StyleValue = global(\n [\n `:where(a){color:${v('text-link', 'LinkText')};text-decoration-thickness:from-font;text-underline-offset:0.15em}`,\n // Only where something hovers: a touch screen keeps `:hover` on the link tapped last.\n `@media (hover:hover){:where(a:hover){color:${v('text-link-hover', 'LinkText')}}}`,\n `:where(a:active){color:${v('text-link-hover', 'LinkText')}}`,\n `:where(:is(a,button,input,select,textarea,summary,[tabindex]):focus-visible){outline:${v('border-thick', '2px')} solid ${v('outline-focus', 'Highlight')};outline-offset:2px}`,\n ].join(''),\n)\n\n/** Inline code and code blocks on the subtle surface. */\nexport const code: StyleValue = global(\n [\n `:where(:is(code,kbd,samp,pre)){font-family:${v('font-mono', 'ui-monospace, monospace')};font-size:${v('size-sm', '0.875rem')}}`,\n `:where(:not(pre)>code){padding:0.1em 0.35em;border-radius:${v('radius-sm', '3px')};background:${v('surface-muted', 'transparent')};overflow-wrap:anywhere}`,\n `:where(kbd){padding:0.1em 0.4em;border:${v('border-thin', '1px')} solid ${v('outline-default', 'currentColor')};border-block-end-width:2px;border-radius:${v('radius-sm', '3px')};font-size:0.85em}`,\n `:where(hr){border:0;border-block-start:${v('border-thin', '1px')} solid ${v('outline-subtle', 'currentColor')}}`,\n `:where(pre){padding:${v('space-md', '1rem')};border:${v('border-thin', '1px')} solid ${v('outline-subtle', 'transparent')};border-radius:${v('radius-md', '6px')};background:${v('surface-subtle', 'transparent')};overflow-x:auto;line-height:${v('leading-snug', '1.375')}}`,\n ].join(''),\n)\n\n/** Text inputs, selects, textareas, and buttons: one radius, one border, one focus. */\nexport const controls: StyleValue = global(\n [\n `:where(:is(input:not([type=checkbox],[type=radio],[type=range],[type=color],[type=file]),select,textarea)){padding:${v('space-xs', '0.5rem')} ${v('space-sm', '0.75rem')};border:${v('border-thin', '1px')} solid ${v('outline-default', 'ButtonBorder')};border-radius:${v('radius-md', '6px')};background:${v('surface-base', 'Field')};color:${v('text-default', 'FieldText')};transition:border-color ${v('motion-fast', '150ms')} ${v('motion-ease', 'ease-out')}}`,\n `:where(:is(input,select,textarea):focus-visible){border-color:${v('accent-default', 'Highlight')}}`,\n `:where(:is(input,select,textarea)[aria-invalid=true]){border-color:${v('error-default', 'red')}}`,\n `:where(button,[type=button],[type=submit],[type=reset]){padding:${v('space-xs', '0.5rem')} ${v('space-md', '1rem')};border:${v('border-thin', '1px')} solid ${v('outline-default', 'ButtonBorder')};border-radius:${v('radius-md', '6px')};background:${v('surface-subtle', 'ButtonFace')};color:${v('text-default', 'ButtonText')};cursor:pointer;transition:background ${v('motion-fast', '150ms')} ${v('motion-ease', 'ease-out')}}`,\n `@media (hover:hover){:where(button,[type=button],[type=submit],[type=reset]):hover{background:${v('surface-muted', 'ButtonFace')}}}`,\n `:where(button,[type=button],[type=submit],[type=reset]):active{background:${v('surface-muted', 'ButtonFace')}}`,\n `:where(:is(button,input,select,textarea):disabled){opacity:0.5;cursor:not-allowed}`,\n `:where(:is(input,select,textarea,button)::placeholder){color:${v('text-muted', 'GrayText')}}`,\n ].join(''),\n)\n\n/** Every default except `reset`, which belongs in its own layer. */\nexport const all: StyleValue = compose(body, headings, links, code, controls)\n\nexport const Defaults = { reset, body, headings, links, code, controls, all } as const\n"],"mappings":";;;;;;;;;;AAWA,MAAM,KAAK,MAAc,aAA6B,YAAY,KAAK,IAAI,SAAS;;AAGpF,MAAa,QAAoB,OAC/B;CACE;CAGA;CAIA;CACA;CAIA;CAKA;CACA;CACA;CACA;CACA;CACA;CAKA;AACF,CAAC,CAAC,KAAK,EAAE,CACX;;AAGA,MAAa,OAAmB,OAG9B,iCAAiC,EAAE,iBAAiB,MAAM,EAAE,4BAA4B,EAAE,kBAAkB,MAAM,EAAE,sDAE5D,EAAE,kBAAkB,WAAW,EAAE,8CAC3D,EAAE,aAAa,uBAAuB,EAAE,aAAa,EAAE,WAAW,MAAM,EAAE,eAAe,EAAE,kBAAkB,KAAK,EAAE,eAAe,EAAE,iBAAiB,KAAK,EAAE,SAAS,EAAE,gBAAgB,YAAY,EAAE,cAAc,EAAE,gBAAgB,QAAQ,EAAE,qCAChR;;;;;;AAOA,MAAa,WAAuB,OAClC;CACE,8CAA8C,EAAE,gBAAgB,SAAS,EAAE,eAA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,WAAuB,OAClC;CACE,sHAAsH,EAAE,YAAY,QAAQ,EAAE,GAAG,EAAE,YAAY,SAAS,EAAE,UAAU,EAAE,eAAe,KAAK,EAAE,SAAS,EAAE,mBAAmB,cAAc,EAAE,iBAAiB,EAAE,aAAa,KAAK,EAAE,cAAc,EAAE,gBAAgB,OAAO,EAAE,SAAS,EAAE,gBAAgB,WAAW,EAAE,2BAA2B,EAAE,eAAe,OAAO,EAAE,GAAG,EAAE,eAAe,UAAU,EAAE;CACvc,iEAAiE,EAAE,kBAAkB,WAAW,EAAE;CAClG,sEAAsE,EAAE,iBAAiB,KAAK,EAAE;CAChG,mEAAmE,EAAE,YAAY,QAAQ,EAAE,GAAG,EAAE,YAAY,MAAM,EAAE,UAAU,EAAE,eAAe,KAAK,EAAE,SAAS,EAAE,mBAAmB,cAAc,EAAE,iBAAiB,EAAE,aAAa,KAAK,EAAE,cAAc,EAAE,kBAAkB,YAAY,EAAE,SAAS,EAAE,gBAAgB,YAAY,EAAE,wCAAwC,EAAE,eAAe,OAAO,EAAE,GAAG,EAAE,eAAe,UAAU,EAAE;CACta,iGAAiG,EAAE,iBAAiB,YAAY,EAAE;CAClI,6EAA6E,EAAE,iBAAiB,YAAY,EAAE;CAC9G;CACA,gEAAgE,EAAE,cAAc,UAAU,EAAE;AAC9F,CAAC,CAAC,KAAK,EAAE,CACX;;AAGA,MAAa,MAAkB,QAAQ,MAAM,UAAU,OAAO,MAAM,QAAQ;AAE5E,MAAa,WAAW;CAAE;CAAO;CAAM;CAAU;CAAO;CAAM;CAAU;AAAI"}
|
package/dist/index.d.mts
CHANGED
|
@@ -14,7 +14,7 @@ declare namespace diagnostics_d_exports {
|
|
|
14
14
|
* programming errors (a definition attaches something a slot does not allow),
|
|
15
15
|
* so `resolve` throws a `DiagnosticError` carrying one.
|
|
16
16
|
*/
|
|
17
|
-
type DiagnosticCode = 'mixins:unknown-slot' | 'mixins:hidden-slot' | 'mixins:capability-mismatch' | 'mixins:unsupported-event' | 'mixins:unsupported-attribute' | 'mixins:protected-event' | 'mixins:protected-attribute' | 'mixins:protected-style-property' | 'mixins:style-property-conflict' | 'mixins:event-conflict' | 'mixins:attribute-conflict' | 'mixins:structural-override' | 'mixins:duplicate-mount-name' | 'mixins:duplicate-item-id' | 'mixins:ragged-grid-areas' | 'mixins:inline-shorthand-conflict' | 'style:duplicate-layer' | 'style:conflicting-layer-order' | 'style:unlayered-rule' | 'style:relayered' | 'theme:unparseable-breakpoint' | 'a11y:missing-slot' | 'a11y:hidden-slot' | 'a11y:capability-mismatch' | 'a11y:missing-event' | 'a11y:missing-attribute';
|
|
17
|
+
type DiagnosticCode = 'mixins:unknown-slot' | 'mixins:hidden-slot' | 'mixins:capability-mismatch' | 'mixins:unsupported-event' | 'mixins:unsupported-attribute' | 'mixins:protected-event' | 'mixins:protected-attribute' | 'mixins:protected-style-property' | 'mixins:style-property-conflict' | 'mixins:event-conflict' | 'mixins:attribute-conflict' | 'mixins:structural-override' | 'mixins:duplicate-mount-name' | 'mixins:duplicate-item-id' | 'mixins:ragged-grid-areas' | 'mixins:inline-shorthand-conflict' | 'style:duplicate-layer' | 'style:conflicting-layer-order' | 'style:unlayered-rule' | 'style:relayered' | 'theme:unparseable-breakpoint' | 'theme:fluid-boundary' | 'theme:fluid-range' | 'a11y:missing-slot' | 'a11y:hidden-slot' | 'a11y:capability-mismatch' | 'a11y:missing-event' | 'a11y:missing-attribute';
|
|
18
18
|
interface Diagnostic {
|
|
19
19
|
readonly source: 'mixins' | 'a11y' | 'style' | 'theme';
|
|
20
20
|
readonly code: DiagnosticCode;
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":["AnySlot","behavior","Behavior.NamedBehavior","Options","behavior","Behavior.NamedBehavior","Options","behavior","Behavior.NamedBehavior","Options","behavior","Behavior.NamedBehavior","Behavior.NamedBehavior"],"sources":["../src/diagnostics.ts","../src/a11y.ts","../src/attributes.ts","../src/behaviors/collection.ts","../src/behaviors/disclosure.ts","../src/behaviors/field-association.ts","../src/behaviors/spin-value.ts","../src/behaviors/toggle-state.ts","../src/behaviors/index.ts","../src/selector.ts"],"mappings":";;;;;;;;;;;;;;;;KAMY;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":["AnySlot","behavior","Behavior.NamedBehavior","Options","behavior","Behavior.NamedBehavior","Options","behavior","Behavior.NamedBehavior","Options","behavior","Behavior.NamedBehavior","Behavior.NamedBehavior"],"sources":["../src/diagnostics.ts","../src/a11y.ts","../src/attributes.ts","../src/behaviors/collection.ts","../src/behaviors/disclosure.ts","../src/behaviors/field-association.ts","../src/behaviors/spin-value.ts","../src/behaviors/toggle-state.ts","../src/behaviors/index.ts","../src/selector.ts"],"mappings":";;;;;;;;;;;;;;;;KAMY;UA8BK;WACN;WACA,MAAM;WACN;WACA;WACA;WACA,UAAU,SAAS;;cAGjB,wBAAwB;WAC1B,YAAY;EAErB,YAAY,YAAY;;;;;KCnCd;UAOK,uBAAuB;WAC7B;WACA,MAAM;;UAGA;WACN,aAAa;WACb,SAAS,cAAc;WACvB,aAAa,cAAc;;WAE3B;;KAGC,eAAe,SAAS,eAAe;cAEtC;UAEI,QAAQ,aAAa,eAAe;YACzC;aAA2B,cAAc;;WAC1C,cAAc;;cAGZ,gBAAiB,aAAa,cAAY,MAAQ,SAAO,QAAQ;cAyCjE,WAAQ,SACV,SAAO;YACG,eAAeA;MACjC,cAAc;;;;;KC5EL,MAAM;;KAGN,GAAG,SAAS,UAAU,OAAO,QAAQ,UAAU;WAAqB,MAAM;;;cAGzE,QAAS,SAAO,WAAa,eAAe,qBAAmB;;cAS/D,OAAQ,SAAS,UAAU,KAAG,YAC7B,eAAe,UAAQ,KAC9B,MACJ,GAAG,SAAS;;cAGF,SAAU,SAAS,UAAU,KAAG,YAC/B,eAAe,UAAQ,KAC9B,MACJ,cAAc,GAAG,SAAS;;;;UCvBZ,MAAM;WACZ;;WAEA,KAAK;WACL,KAAK,kBAAkB;;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;;;;;cEf5E,OAAI,cAAgB;;cAIpB,MAAG;;cAGH,QAAE,WAAkB;;cAGpB,QAAK;;cAGL,aAAU;;cAGV,UAAO;;cAGP,WAAQ"}
|
package/dist/prose.d.mts
CHANGED
|
@@ -5,6 +5,8 @@ export interface ProseOptions {
|
|
|
5
5
|
readonly measure?: string;
|
|
6
6
|
/** The line height, e.g. `'1.75'`. Default: the theme's relaxed leading. */
|
|
7
7
|
readonly leading?: string;
|
|
8
|
+
/** The alignment. Default: the theme's reading alignment. */
|
|
9
|
+
readonly align?: 'start' | 'center' | 'end' | 'justify';
|
|
8
10
|
/** The space before an element, by what it follows. */
|
|
9
11
|
readonly rhythm?: Partial<{
|
|
10
12
|
/** Between flowing blocks: paragraph after paragraph, list after paragraph. */
|
package/dist/prose.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prose.d.mts","names":[],"sources":["../src/prose.ts"],"mappings":";;iBAUiB;;WAEN;;WAEA;;WAEA,SAAS;;aAEP;;aAEA;;aAEA;;aAEA;;;;;;;;
|
|
1
|
+
{"version":3,"file":"prose.d.mts","names":[],"sources":["../src/prose.ts"],"mappings":";;iBAUiB;;WAEN;;WAEA;;WAEA;;WAEA,SAAS;;aAEP;;aAEA;;aAEA;;aAEA;;;;;;;;qBAwEA,QAAK,UAAa,iBAAoB;qBAWtC;yBAAA"}
|
package/dist/prose.mjs
CHANGED
|
@@ -40,6 +40,7 @@ const rules = compose(nest("> *", { marginBlock: "0" }), nest("> * + *", { margi
|
|
|
40
40
|
const variables = (options) => ({
|
|
41
41
|
...options.measure === void 0 ? {} : { "--fk-prose-measure": options.measure },
|
|
42
42
|
...options.leading === void 0 ? {} : { "--fk-prose-leading": options.leading },
|
|
43
|
+
...options.align === void 0 ? {} : { "--fk-prose-align": options.align },
|
|
43
44
|
...options.rhythm?.paragraph === void 0 ? {} : { "--fk-prose-paragraph": options.rhythm.paragraph },
|
|
44
45
|
...options.rhythm?.heading === void 0 ? {} : { "--fk-prose-heading": options.rhythm.heading },
|
|
45
46
|
...options.rhythm?.list === void 0 ? {} : { "--fk-prose-list": options.rhythm.list },
|
|
@@ -51,8 +52,9 @@ const variables = (options) => ({
|
|
|
51
52
|
* declarations, so a later layer can override either.
|
|
52
53
|
*/
|
|
53
54
|
const style = (options = {}) => compose(self({
|
|
54
|
-
maxInlineSize: "var(--fk-prose-measure, 65ch)",
|
|
55
|
-
lineHeight: "var(--fk-prose-leading, var(--fk-leading-relaxed, 1.6))"
|
|
55
|
+
maxInlineSize: "var(--fk-prose-measure, var(--fk-reading-measure, 65ch))",
|
|
56
|
+
lineHeight: "var(--fk-prose-leading, var(--fk-leading-relaxed, 1.6))",
|
|
57
|
+
textAlign: "var(--fk-prose-align, var(--fk-reading-align, start))"
|
|
56
58
|
}), inline(variables(options)), rules);
|
|
57
59
|
const Prose = { style };
|
|
58
60
|
//#endregion
|
package/dist/prose.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prose.mjs","names":[],"sources":["../src/prose.ts"],"sourcesContent":["/**\n * `foldkit-mixins/prose`: the longform-content contract. One class carries\n * the rhythm between unlike elements (a heading and the paragraph after it,\n * a list and the paragraph before it); the measure and each rhythm step are\n * `--fk-prose-*` variables, so every prose container shares the class and\n * options only write variables. Belongs in the `components` layer.\n */\nimport { compose, inline, nest, self } from './styleValue.js'\nimport type { StyleValue } from './styleValue.js'\n\nexport interface ProseOptions {\n /** The line length, e.g. `'65ch'`. */\n readonly measure?: string\n /** The line height, e.g. `'1.75'`. Default: the theme's relaxed leading. */\n readonly leading?: string\n /** The space before an element, by what it follows. */\n readonly rhythm?: Partial<{\n /** Between flowing blocks: paragraph after paragraph, list after paragraph. */\n readonly paragraph: string\n /** Before a heading; the content after a heading sits tight. */\n readonly heading: string\n /** Between list items and before a nested list. */\n readonly list: string\n /** Around figures, blockquotes, code blocks, tables, and rules. */\n readonly figure: string\n }>\n}\n\nconst flow = 'var(--fk-prose-paragraph, var(--fk-space-md, 1em))'\nconst heading = 'var(--fk-prose-heading, var(--fk-space-xl, 1.8em))'\nconst list = 'var(--fk-prose-list, var(--fk-space-2xs, 0.35em))'\nconst figure = 'var(--fk-prose-figure, var(--fk-space-lg, 1.5em))'\n\nconst rules: StyleValue = compose(\n nest('> *', { marginBlock: '0' }),\n nest('> * + *', { marginBlockStart: flow }),\n nest('> :is(h2, h3, h4, h5, h6)', { marginBlockStart: heading }),\n nest('> :is(h1, h2, h3, h4, h5, h6) + *', { marginBlockStart: 'var(--fk-space-xs, 0.5em)' }),\n nest('> :is(figure, blockquote, pre, table, hr)', { marginBlock: figure }),\n nest(':is(ul, ol)', { paddingInlineStart: 'var(--fk-space-lg, 1.5em)' }),\n nest('li + li', { marginBlockStart: list }),\n nest(':is(li > ul, li > ol)', { marginBlockStart: list }),\n nest('blockquote', {\n paddingInlineStart: 'var(--fk-space-md, 1em)',\n borderInlineStart: 'var(--fk-border-heavy, 3px) solid var(--fk-outline-default, currentColor)',\n color: 'var(--fk-text-subtle, inherit)',\n }),\n nest('figcaption', {\n marginBlockStart: 'var(--fk-space-xs, 0.5em)',\n color: 'var(--fk-text-muted, inherit)',\n fontSize: 'var(--fk-size-sm, 0.875em)',\n }),\n nest('hr', {\n border: '0',\n borderBlockStart: 'var(--fk-border-thin, 1px) solid var(--fk-outline-subtle, currentColor)',\n }),\n nest('table', {\n inlineSize: '100%',\n borderCollapse: 'collapse',\n fontSize: 'var(--fk-size-sm, 0.875em)',\n }),\n nest(':is(th, td)', {\n padding: 'var(--fk-space-xs, 0.5em) var(--fk-space-sm, 0.75em)',\n borderBlockEnd: 'var(--fk-border-thin, 1px) solid var(--fk-outline-subtle, currentColor)',\n textAlign: 'start',\n }),\n nest('mark', {\n padding: '0 0.2em',\n background: 'var(--fk-accent-subtle, Mark)',\n color: 'var(--fk-accent-ink, MarkText)',\n }),\n nest('abbr[title]', { textDecorationStyle: 'dotted', cursor: 'help' }),\n nest(':not(pre) > code', { overflowWrap: 'anywhere' }),\n nest('pre', { overflowX: 'auto' }),\n nest('a', { overflowWrap: 'anywhere' }),\n)\n\nconst variables = (options: ProseOptions): Readonly<Record<`--${string}`, string>> => ({\n ...(options.measure === undefined ? {} : { '--fk-prose-measure': options.measure }),\n ...(options.leading === undefined ? {} : { '--fk-prose-leading': options.leading }),\n ...(options.rhythm?.paragraph === undefined\n ? {}\n : { '--fk-prose-paragraph': options.rhythm.paragraph }),\n ...(options.rhythm?.heading === undefined\n ? {}\n : { '--fk-prose-heading': options.rhythm.heading }),\n ...(options.rhythm?.list === undefined ? {} : { '--fk-prose-list': options.rhythm.list }),\n ...(options.rhythm?.figure === undefined ? {} : { '--fk-prose-figure': options.rhythm.figure }),\n})\n\n/**\n * The prose container: one class for every caller, options as variables on it.\n * The measure and leading are a rule reading those variables, not inline\n * declarations, so a later layer can override either.\n */\nexport const style = (options: ProseOptions = {}): StyleValue =>\n compose(\n self({\n maxInlineSize: 'var(--fk-prose-measure, 65ch)',\n lineHeight: 'var(--fk-prose-leading, var(--fk-leading-relaxed, 1.6))',\n }),\n inline(variables(options)),\n rules,\n )\n\nexport const Prose = { style } as const\n"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"prose.mjs","names":[],"sources":["../src/prose.ts"],"sourcesContent":["/**\n * `foldkit-mixins/prose`: the longform-content contract. One class carries\n * the rhythm between unlike elements (a heading and the paragraph after it,\n * a list and the paragraph before it); the measure and each rhythm step are\n * `--fk-prose-*` variables, so every prose container shares the class and\n * options only write variables. Belongs in the `components` layer.\n */\nimport { compose, inline, nest, self } from './styleValue.js'\nimport type { StyleValue } from './styleValue.js'\n\nexport interface ProseOptions {\n /** The line length, e.g. `'65ch'`. */\n readonly measure?: string\n /** The line height, e.g. `'1.75'`. Default: the theme's relaxed leading. */\n readonly leading?: string\n /** The alignment. Default: the theme's reading alignment. */\n readonly align?: 'start' | 'center' | 'end' | 'justify'\n /** The space before an element, by what it follows. */\n readonly rhythm?: Partial<{\n /** Between flowing blocks: paragraph after paragraph, list after paragraph. */\n readonly paragraph: string\n /** Before a heading; the content after a heading sits tight. */\n readonly heading: string\n /** Between list items and before a nested list. */\n readonly list: string\n /** Around figures, blockquotes, code blocks, tables, and rules. */\n readonly figure: string\n }>\n}\n\nconst flow = 'var(--fk-prose-paragraph, var(--fk-space-md, 1em))'\nconst heading = 'var(--fk-prose-heading, var(--fk-space-xl, 1.8em))'\nconst list = 'var(--fk-prose-list, var(--fk-space-2xs, 0.35em))'\nconst figure = 'var(--fk-prose-figure, var(--fk-space-lg, 1.5em))'\n\nconst rules: StyleValue = compose(\n nest('> *', { marginBlock: '0' }),\n nest('> * + *', { marginBlockStart: flow }),\n nest('> :is(h2, h3, h4, h5, h6)', { marginBlockStart: heading }),\n nest('> :is(h1, h2, h3, h4, h5, h6) + *', { marginBlockStart: 'var(--fk-space-xs, 0.5em)' }),\n nest('> :is(figure, blockquote, pre, table, hr)', { marginBlock: figure }),\n nest(':is(ul, ol)', { paddingInlineStart: 'var(--fk-space-lg, 1.5em)' }),\n nest('li + li', { marginBlockStart: list }),\n nest(':is(li > ul, li > ol)', { marginBlockStart: list }),\n nest('blockquote', {\n paddingInlineStart: 'var(--fk-space-md, 1em)',\n borderInlineStart: 'var(--fk-border-heavy, 3px) solid var(--fk-outline-default, currentColor)',\n color: 'var(--fk-text-subtle, inherit)',\n }),\n nest('figcaption', {\n marginBlockStart: 'var(--fk-space-xs, 0.5em)',\n color: 'var(--fk-text-muted, inherit)',\n fontSize: 'var(--fk-size-sm, 0.875em)',\n }),\n nest('hr', {\n border: '0',\n borderBlockStart: 'var(--fk-border-thin, 1px) solid var(--fk-outline-subtle, currentColor)',\n }),\n nest('table', {\n inlineSize: '100%',\n borderCollapse: 'collapse',\n fontSize: 'var(--fk-size-sm, 0.875em)',\n }),\n nest(':is(th, td)', {\n padding: 'var(--fk-space-xs, 0.5em) var(--fk-space-sm, 0.75em)',\n borderBlockEnd: 'var(--fk-border-thin, 1px) solid var(--fk-outline-subtle, currentColor)',\n textAlign: 'start',\n }),\n nest('mark', {\n padding: '0 0.2em',\n background: 'var(--fk-accent-subtle, Mark)',\n color: 'var(--fk-accent-ink, MarkText)',\n }),\n nest('abbr[title]', { textDecorationStyle: 'dotted', cursor: 'help' }),\n nest(':not(pre) > code', { overflowWrap: 'anywhere' }),\n nest('pre', { overflowX: 'auto' }),\n nest('a', { overflowWrap: 'anywhere' }),\n)\n\nconst variables = (options: ProseOptions): Readonly<Record<`--${string}`, string>> => ({\n ...(options.measure === undefined ? {} : { '--fk-prose-measure': options.measure }),\n ...(options.leading === undefined ? {} : { '--fk-prose-leading': options.leading }),\n ...(options.align === undefined ? {} : { '--fk-prose-align': options.align }),\n ...(options.rhythm?.paragraph === undefined\n ? {}\n : { '--fk-prose-paragraph': options.rhythm.paragraph }),\n ...(options.rhythm?.heading === undefined\n ? {}\n : { '--fk-prose-heading': options.rhythm.heading }),\n ...(options.rhythm?.list === undefined ? {} : { '--fk-prose-list': options.rhythm.list }),\n ...(options.rhythm?.figure === undefined ? {} : { '--fk-prose-figure': options.rhythm.figure }),\n})\n\n/**\n * The prose container: one class for every caller, options as variables on it.\n * The measure and leading are a rule reading those variables, not inline\n * declarations, so a later layer can override either.\n */\nexport const style = (options: ProseOptions = {}): StyleValue =>\n compose(\n self({\n maxInlineSize: 'var(--fk-prose-measure, var(--fk-reading-measure, 65ch))',\n lineHeight: 'var(--fk-prose-leading, var(--fk-leading-relaxed, 1.6))',\n textAlign: 'var(--fk-prose-align, var(--fk-reading-align, start))',\n }),\n inline(variables(options)),\n rules,\n )\n\nexport const Prose = { style } as const\n"],"mappings":";;;;;;;;;AA8BA,MAAM,OAAO;AACb,MAAM,UAAU;AAChB,MAAM,OAAO;AAGb,MAAM,QAAoB,QACxB,KAAK,OAAO,EAAE,aAAa,IAAI,CAAC,GAChC,KAAK,WAAW,EAAE,kBAAkB,KAAK,CAAC,GAC1C,KAAK,6BAA6B,EAAE,kBAAkB,QAAQ,CAAC,GAC/D,KAAK,qC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QAAQ;CACnD,GAAI,QAAQ,QAAQ,SAAS,KAAA,IAAY,CAAC,IAAI,EAAE,mBAAmB,QAAQ,OAAO,KAAK;CACvF,GAAI,QAAQ,QAAQ,WAAW,KAAA,IAAY,CAAC,IAAI,EAAE,qBAAqB,QAAQ,OAAO,OAAO;AAC/F;;;;;;AAOA,MAAa,SAAS,UAAwB,CAAC,MAC7C,QACE,KAAK;CACH,eAAe;CACf,YAAY;CACZ,WAAW;AACb,CAAC,GACD,OAAO,UAAU,OAAO,CAAC,GACzB,KACF;AAEF,MAAa,QAAQ,EAAE,MAAM"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as global } from "./styleValue-6hpAYYfg.mjs";
|
|
2
2
|
import { i as define, n as VAR_PREFIX, r as compose } from "./core-BrR6UPbk.mjs";
|
|
3
|
-
import { _ as tokensOf, b as variables, c as tokens, d as make$1, g as standard, v as unsetOf } from "./tokens-
|
|
3
|
+
import { _ as tokensOf, b as variables, c as tokens, d as make$1, g as standard, v as unsetOf } from "./tokens-BFpuo-sA.mjs";
|
|
4
4
|
import { Effect, Schema } from "effect";
|
|
5
5
|
//#region src/theme/oklch.ts
|
|
6
6
|
/**
|
|
@@ -371,4 +371,4 @@ const scoped = (_theme, selector, overrides) => {
|
|
|
371
371
|
//#endregion
|
|
372
372
|
export { choose as a, script as c, apply as i, standardOf as l, scoped as n, make as o, THEME_KEY as r, scope as s, root as t, scriptLiteral as u };
|
|
373
373
|
|
|
374
|
-
//# sourceMappingURL=root-
|
|
374
|
+
//# sourceMappingURL=root-DdIhpyqg.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-CT_iUZvD.mjs","names":["makeTheme","declarations"],"sources":["../src/theme/oklch.ts","../src/theme/scriptLiteral.ts","../src/theme/themes.ts","../src/theme/root.ts"],"sourcesContent":["/**\n * A whole palette from a few knobs, as css-tags derives it: every value\n * except the knobs is a CSS expression over other tokens, so overriding a\n * knob on the element that declares the tokens (`:root`, or a scoped theme's\n * selector) re-derives the rest in the browser. A custom property resolves\n * where it is declared, so a knob overridden on a subtree below `:root`\n * changes nothing: `Theme.scope` declares the derivations there too. Where\n * light and dark schemes need different numbers the value is a `light-dark()` pair, so one theme serves both and a user's\n * choice is a `color-scheme` override.\n */\nimport { define } from './core.js'\nimport { standard, unsetOf } from './knobs.js'\n\nconst v = (group: string, name: string) => `var(--fk-${group}-${name})`\nconst ld = (light: string, dark: string) => `light-dark(${light}, ${dark})`\nconst offset = (amount: number) => `${amount < 0 ? '-' : '+'} ${Math.abs(amount)}`\n/** `oklch(from <color> …)` with the hue kept. */\nconst from = (color: string, l: string, c: string) => `oklch(from ${color} ${l} ${c} h)`\nconst shift = (color: string, dl: number, dc: number) =>\n from(color, `calc(l ${offset(dl)})`, `calc(c ${offset(dc)})`)\nconst scale = (color: string, dl: number, cx: number) =>\n from(color, `calc(l ${offset(dl)})`, `calc(c * ${cx})`)\n/** The same lightness and chroma as `color` on another hue. */\nconst rehue = (color: string, hue: string) => `oklch(from ${color} l c ${hue})`\n/** Near-black or near-white text over `color`. */\nconst contrast = (color: string) =>\n `oklch(from ${color} clamp(0.1, (0.65 / l - 1) * 999, 0.98) min(c, 0.08) h)`\n/** `color` as text on the base surface: dark in a light scheme, light in a dark one. */\nconst ink = (color: string) => ld(from(color, '0.5', 'c'), from(color, '0.8', 'c'))\n/**\n * `color` tinted onto the base surface, the same in both schemes. Mixed in\n * OKLab, not OKLCH: OKLCH interpolates hue, so a mix mostly of the base keeps\n * the base's hue, and a green tinted onto a blue-grey base came out blue.\n */\nconst tint = (color: string, percent: number) =>\n `color-mix(in oklab, ${v('surface', 'base')} ${percent}%, ${color})`\n\nconst neutral = v('hue', 'neutral')\nconst base = v('surface', 'base')\nconst surfaceC = v('knob', 'surface-c')\nconst surfaceCDark = v('knob', 'surface-c-dark')\nconst contrastFactor = v('knob', 'contrast-factor')\n\ntype Step = readonly [lightness: number, chroma: number]\n\n/**\n * How far a step's target lies past the offset it names: at the default\n * contrast (26%) a step sits where its offset says, and the whole knob spans\n * 2.5 times that, so its range is one a reader sees. At a reach of 1 the knob\n * at its top moved the muted surface four points of lightness.\n */\nconst REACH = 2.5\nconst reach = ([lightness, chroma]: Step): Step => [\n Number((lightness * REACH).toFixed(4)),\n Number((1 + (chroma - 1) * REACH).toFixed(4)),\n]\n\n/** A surface step: the base mixed toward a target by `surface-contrast`. */\nconst surfaceStep = (lightStep: Step, darkStep: Step) => {\n const amount = v('knob', 'surface-contrast')\n const [light, dark] = [reach(lightStep), reach(darkStep)]\n const target = ld(scale(base, light[0], light[1]), scale(base, dark[0], dark[1]))\n return `color-mix(in oklch, ${base} calc(100% - ${amount}), ${target} ${amount})`\n}\n\n/** `a` where the 0-or-1 knob `name` is 1, `b` where it is 0. */\nconst share = (a: string, name: string, b: string) =>\n `color-mix(in oklab, ${a} calc(${v('knob', name)} * 100%), ${b})`\n\n/** A text color: fixed lightness, chroma scaled by surface saturation and the contrast factor. */\nconst text = (light: Step, dark: Step) =>\n ld(\n `oklch(${light[0]}% calc(${surfaceC} * ${light[1]} * ${contrastFactor}) ${neutral})`,\n `oklch(${dark[0]}% calc(${surfaceCDark} * ${dark[1]} * ${contrastFactor}) ${neutral})`,\n )\n\n/**\n * A color family, every one the same shape: its fill, the fill hovered and\n * pressed, a tint of it on the base, a line in it that stands off the base\n * (darker in a light scheme, lighter in a dark one), and text on the fill\n * and in the family's color.\n */\nconst family = (name: string, defaultValue: string) => {\n const color = v(name, 'default')\n return {\n default: defaultValue,\n hover: shift(color, -0.06, 0),\n active: shift(color, -0.1, 0.05),\n subtle: tint(color, 85),\n outline: ld(shift(color, -0.05, 0), shift(color, 0.05, 0)),\n 'on-fill': contrast(color),\n ink: ink(color),\n }\n}\n\n/**\n * A code color in `hue`: the same lightness for every kind, so no kind shouts,\n * dark enough to read on a light surface and light enough on a dark one.\n */\nconst syntaxInk = (hue: string) =>\n ld(`oklch(48% ${v('knob', 'syntax-c')} ${hue})`, `oklch(80% ${v('knob', 'syntax-c')} ${hue})`)\n\n/**\n * A chart's series color: a hue a fixed turn from the first, at a lightness\n * and chroma chosen for that hue in each scheme (a yellow sits lighter than a\n * blue to read as strong). The five are the dataviz reference palette's first\n * slots, in its order, which keeps neighbors apart under protan and deutan\n * vision; moving `chart-h` turns them all and keeps the order.\n */\nconst chartInk = (turn: number, light: Step, dark: Step) => {\n const hue = `calc(${v('knob', 'chart-h')} ${offset(turn)})`\n return ld(`oklch(${light[0]} ${light[1]} ${hue})`, `oklch(${dark[0]} ${dark[1]} ${hue})`)\n}\n\n/** A feedback family, lighter in a dark scheme so its fill reads on a dark page. */\nconst feedback = (name: string, l: number, c: number, dark: number) =>\n family(\n name,\n ld(\n `oklch(${l}% ${c} ${v('knob', `${name}-h`)})`,\n `oklch(${dark}% ${c} ${v('knob', `${name}-h`)})`,\n ),\n )\n\n/** The color scales, each named for its hue (a knob, `red-h`). */\ntype ScaleName = 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'purple'\n\n/**\n * One lightness ladder for every scale, near white to near black in even\n * steps, so step 6 of red is as light as step 6 of blue: a step number\n * means the same contrast in any hue (after css-tags' palette).\n */\nconst scaleL = [97, 88.5, 80, 71.5, 63, 54.5, 46, 37.5, 29, 20.5]\n// Chroma swells toward the middle, where a screen can show most of it, and\n// thins at both ends, where a vivid near-white or near-black falls out of gamut.\nconst scaleC = [0.02, 0.05, 0.09, 0.13, 0.16, 0.17, 0.155, 0.125, 0.09, 0.055]\n\n/**\n * A color's ten steps, `1` the lightest, and four `wash`es: step 6 mixed\n * into the page, so a tinted ground follows the scheme and the surface\n * knobs as the page does.\n */\nconst colorScale = (name: ScaleName) => {\n const hue = v('knob', `${name}-h`)\n const step = (index: number) =>\n `oklch(${scaleL[index]}% calc(${scaleC[index]} * ${v('knob', 'scale-c')}) ${hue})`\n const wash = (share: number) =>\n `color-mix(in oklab, ${v(name, '6')} ${share}%, ${v('surface', 'base')})`\n return {\n '1': step(0),\n '2': step(1),\n '3': step(2),\n '4': step(3),\n '5': step(4),\n '6': step(5),\n '7': step(6),\n '8': step(7),\n '9': step(8),\n '10': step(9),\n 'wash-1': wash(8),\n 'wash-2': wash(16),\n 'wash-3': wash(28),\n 'wash-4': wash(44),\n }\n}\n\n/**\n * An outline, the palette's line until the `shape.outlines` knob gives it the\n * text's own ink: `outline-ink` 0 is the line itself, 1 the ink at its strength.\n */\nconst inked = (line: string, strength: 'subtle' | 'default' | 'overt') =>\n `color-mix(in oklch, ${line}, color-mix(in oklch, ${v('text', 'overt')} ${v('knob', `outline-ink-${strength}`)}, transparent) calc(${v('knob', 'outline-ink')} * 100%))`\n\nconst accent = v('accent', 'default')\n\n/**\n * The palette: every color a CSS expression over the knobs' variables. The\n * knobs stand at their defaults here; a theme declares its own values over\n * them (`Theme.standard`).\n */\nexport const palette = define({\n knob: {\n ...unsetOf(standard),\n // How much of the text a state lays over its surface; a hover's is a knob.\n 'state-tint': '8%',\n 'state-tint-dark': '25%',\n 'image-edge': '10%',\n // How much lighter each raised level is in a dark scheme.\n 'raise-dark': '0.027',\n },\n hue: {\n accent: v('knob', 'accent-h'),\n secondary: `calc(${v('knob', 'accent-h')} + ${v('knob', 'secondary-shift')})`,\n tertiary: `calc(${v('knob', 'accent-h')} + ${v('knob', 'tertiary-shift')})`,\n neutral: v('knob', 'neutral-h'),\n },\n surface: {\n base: ld(\n `oklch(${v('knob', 'base-l')} calc(${surfaceC} * 0.9) ${neutral})`,\n `oklch(${v('knob', 'base-l-dark')} calc(${surfaceCDark} * 0.9) ${neutral})`,\n ),\n // A control's resting ground, separate from a neutral surface step so a\n // field can keep its contrast if the steps move: filled fields read it,\n // the page reads base.\n field: v('surface', 'default'),\n // Each step keeps about the base's chroma, so a sidebar, a panel and\n // the page read as one color at a few lightnesses: one with less reads\n // grey on the page, one with more reads as another, bluer color.\n muted: surfaceStep([-0.04, 1.2], [-0.03, 1.05]),\n subtle: surfaceStep([-0.025, 1.15], [-0.015, 1.05]),\n default: surfaceStep([-0.055, 1.25], [0.045, 1.1]),\n overt: surfaceStep([-0.31, 2.25], [0.125, 1.2]),\n // The deepest of the page's color in both schemes: under a dialog's\n // backdrop, a veil of it darkens the page; it was near-white in a dark one.\n bedrock: ld(\n `oklch(8% calc(${surfaceC} * 1.2) ${neutral})`,\n `oklch(6% calc(${surfaceCDark} * 1.2) ${neutral})`,\n ),\n },\n text: {\n default: text([20, 2], [88, 0.8]),\n muted: text([45, 1.5], [65, 1.2]),\n subtle: text([35, 1.8], [75, 1]),\n overt: text([10, 2.2], [95, 0.6]),\n link: shift(accent, 0.1, 0.05),\n 'link-hover': shift(v('text', 'link'), -0.1, 0),\n },\n // Steps from the base, as the surfaces are: darker in a light scheme,\n // lighter in a dark one, and in the base's own hue with a little more of\n // its chroma, which a thin line needs to read as the page's color. Text mixed into the base, as they were, came out grey on a\n // tinted page: the text is near-neutral, so the mix lost the tint.\n outline: {\n subtle: inked(ld(scale(base, -0.07, 1.3), scale(base, 0.065, 1.25)), 'subtle'),\n // Between two parts of one surface (groups of a list, a panel's\n // header): a step past `subtle`, which a dark page all but hides.\n divider: inked(ld(scale(base, -0.1, 1.35), scale(base, 0.095, 1.3)), 'subtle'),\n default: inked(ld(scale(base, -0.13, 1.4), scale(base, 0.12, 1.35)), 'default'),\n overt: inked(ld(scale(base, -0.27, 1.6), scale(base, 0.23, 1.5)), 'overt'),\n // The accent as it is: darker and more saturated, the ring was the\n // harshest color on the page.\n focus: accent,\n },\n accent: family(\n 'accent',\n ld(\n `oklch(${v('knob', 'accent-l')} ${v('knob', 'accent-c')} ${v('hue', 'accent')})`,\n `oklch(${v('knob', 'accent-l-dark')} ${v('knob', 'accent-c-dark')} ${v('hue', 'accent')})`,\n ),\n ),\n secondary: family('secondary', rehue(accent, v('hue', 'secondary'))),\n tertiary: family('tertiary', rehue(accent, v('hue', 'tertiary'))),\n // A near-black of the shadow's hue: faint on a light surface, and denser\n // on a dark one, where a light shadow would read as a glow.\n shadow: {\n color: ld(\n `oklch(25% ${v('knob', 'shadow-c')} ${v('knob', 'shadow-h')} / 0.14)`,\n // A third more chroma, as the dark surfaces have.\n `oklch(5% calc(${v('knob', 'shadow-c')} * 4 / 3) ${v('knob', 'shadow-h')} / 0.6)`,\n ),\n },\n // What a state lays over the surface under it, after Fluid Functionalism's\n // overlays. `hover`, `tint` and `tint-hover` mix the element's own text\n // color: `currentColor` resolves where the film is drawn, so a hover reads\n // at any elevation, on a tinted band, and on an inverted panel alike. A\n // film that must take its surface's hue instead reads a property on the\n // element (`unfilledHover` reads a surface's `--_fk-state-ink`, falling\n // back to this `ink`): a `var()` substitutes where the token is declared,\n // so a token cannot carry a per-surface ink. `tint` is a see-through fill, which\n // takes on whatever it sits on (lighter when hovered, as Fluid's: the\n // press is what darkens). `edge` is a hairline inside an image, so a pale\n // edge keeps its shape. `ink` is the state ink where no surface set one:\n // the text (`surface`), the accent's ink (`accent`), or the text with the\n // films reading it directly (`neutral`, as before).\n state: {\n hover: `color-mix(in oklab, currentColor ${v('knob', 'state-hover')}, transparent)`,\n // The same ink held down: a press is the hover at 1.75, one strength the\n // `hoverStrength` knob moves for both. `pressedHover` is its twin, and\n // takes the surface's ink where this one takes the text's.\n press: `color-mix(in oklab, currentColor calc(${v('knob', 'state-hover')} * 1.75), transparent)`,\n tint: ld(\n `color-mix(in oklab, currentColor ${v('knob', 'state-tint')}, transparent)`,\n `color-mix(in oklab, currentColor ${v('knob', 'state-tint-dark')}, transparent)`,\n ),\n 'tint-hover': ld(\n `color-mix(in oklab, currentColor calc(${v('knob', 'state-tint')} * 0.8), transparent)`,\n `color-mix(in oklab, currentColor calc(${v('knob', 'state-tint-dark')} * 0.8), transparent)`,\n ),\n edge: `color-mix(in oklab, ${v('text', 'overt')} ${v('knob', 'image-edge')}, transparent)`,\n ink: v('knob', 'state-ink'),\n },\n // A menu's panel and its lit row, which the popup recipes read.\n popup: {\n surface: `color-mix(in oklab, ${share(\n ld(\n `oklch(${v('knob', 'base-l-dark')} calc(${surfaceCDark} * 0.9) ${neutral})`,\n `oklch(${v('knob', 'base-l')} calc(${surfaceC} * 0.9) ${neutral})`,\n ),\n 'popup-invert',\n base,\n )} calc(${v('knob', 'popup-alpha')} * 100%), transparent)`,\n // The other scheme's base, which an inverted panel takes wherever it is raised to.\n inverted: ld(\n `oklch(${v('knob', 'base-l-dark')} calc(${surfaceCDark} * 0.9) ${neutral})`,\n `oklch(${v('knob', 'base-l')} calc(${surfaceC} * 0.9) ${neutral})`,\n ),\n // The text of the opposite scheme: light on an inverted panel in a light one.\n ink: share(text([88, 0.8], [20, 2]), 'popup-invert', v('text', 'default')),\n highlight: share(\n v('accent', 'default'),\n 'popup-bold',\n `color-mix(in oklab, ${v('popup', 'ink')} 8%, transparent)`,\n ),\n // Held down, as a row's hover deepens to its press: the accent darker, the\n // panel's own ink denser.\n press: share(\n v('accent', 'active'),\n 'popup-bold',\n `color-mix(in oklab, ${v('popup', 'ink')} 14%, transparent)`,\n ),\n 'highlight-ink': share(v('accent', 'on-fill'), 'popup-bold', v('popup', 'ink')),\n blur: v('knob', 'popup-blur'),\n },\n success: feedback('success', 55, 0.15, 64),\n warning: feedback('warning', 70, 0.15, 76),\n // Under 65% in the dark, where the text on a fill turns dark: on red that reads muddy.\n error: feedback('error', 60, 0.2, 64),\n info: feedback('info', 65, 0.15, 70),\n // Series colors, `chart-1` to `chart-5` as shadcn names them: a chart\n // assigns them in order, never by rank, so a series keeps its color.\n chart: {\n '1': chartInk(0, [0.575, 0.163], [0.622, 0.161]),\n '2': chartInk(145, [0.671, 0.175], [0.622, 0.173]),\n '3': chartInk(-93, [0.669, 0.141], [0.621, 0.128]),\n '4': chartInk(180, [0.764, 0.161], [0.67, 0.143]),\n '5': chartInk(102, [0.716, 0.141], [0.622, 0.171]),\n },\n // Color scales of ten even steps, for what is not a role: a tag's\n // color, an illustration, a status of the application's own.\n red: colorScale('red'),\n orange: colorScale('orange'),\n yellow: colorScale('yellow'),\n green: colorScale('green'),\n teal: colorScale('teal'),\n blue: colorScale('blue'),\n purple: colorScale('purple'),\n // Code, by the kinds a tokenizer names (`syntax-keyword` is\n // `--fk-syntax-keyword`): each kind in a hue the palette already has, so\n // code follows the brand, and the quiet kinds in the text's own grey.\n syntax: {\n keyword: syntaxInk(v('hue', 'accent')),\n function: syntaxInk(v('hue', 'secondary')),\n type: syntaxInk(v('hue', 'tertiary')),\n string: syntaxInk(v('knob', 'success-h')),\n number: syntaxInk(v('knob', 'warning-h')),\n property: syntaxInk(v('knob', 'info-h')),\n operator: v('text', 'default'),\n punctuation: v('text', 'muted'),\n comment: text([52, 1], [62, 1]),\n },\n})\n\nexport type Palette = typeof palette\n","/**\n * `value` as a literal in a head script's text: `<` escaped, so a key or a\n * name cannot close the script it is written into.\n */\nexport const scriptLiteral = (value: unknown): string =>\n JSON.stringify(value).replaceAll('<', `${String.fromCharCode(92)}u003c`)\n","/**\n * Themes installed by name. A theme of typed knobs (`Theme.make`) holds only\n * knob values, and every token derives from knob variables, so one set of\n * derivations serves every theme: the root declares them with the initial\n * theme's knobs, and each other theme writes its knobs under\n * `:root[data-theme=\"name\"]`, the same element, where the derivations resolve\n * them. Which theme is active is the application's Model's fact; `apply` is\n * the Command's effect that shows it, and `choose` shows it and keeps it,\n * for `script` to show in the head of the next page before the first paint.\n */\nimport { Effect, Schema } from 'effect'\nimport { global, type StyleValue } from '../styleValue.js'\nimport { compose, VAR_PREFIX, type ThemeTokens } from './core.js'\nimport {\n make as makeTheme,\n tokensOf,\n variables,\n type KnobSet,\n type KnobTheme,\n type Standard,\n} from './knobs.js'\nimport { palette, type Palette } from './oklch.js'\nimport { scriptLiteral } from './scriptLiteral.js'\nimport { tokens, type Tokens } from './tokens.js'\n\n/** Every shipped token: the scales, the palette, and the knobs they read. */\nexport type StandardTokens = ReturnType<typeof compose<Tokens, Palette>>\n\nconst shipped = compose(tokens, palette)\n\n/**\n * Every shipped token with `theme`'s knob values, for a page's root: the\n * derivations are the same for every theme, so only the knobs differ. With\n * no theme, every knob at its default.\n */\nexport const standardOf = (theme: KnobTheme<Standard> = makeTheme({})): StandardTokens =>\n compose(shipped, tokensOf(theme))\n\nconst declarations = (theme: ThemeTokens) =>\n Object.entries(theme)\n .flatMap(([group, names]) =>\n Object.entries(names).map(([name, value]) => `${VAR_PREFIX}-${group}-${name}:${value}`),\n )\n .join(';')\n\nconst knobRule = (selector: string, theme: KnobTheme<KnobSet>) =>\n `${selector}{${Object.entries(variables(theme))\n .map(([name, value]) => `${VAR_PREFIX}-knob-${name}:${value}`)\n .join(';')}}`\n\n/** A set of named themes, one of them shown until the Model chooses another. */\nexport interface Themes<Name extends string> {\n /** The names, as a Schema for the Model field that holds the active one. */\n readonly Name: Schema.Literals<ReadonlyArray<Name>>\n readonly names: ReadonlyArray<Name>\n readonly initial: Name\n /** The root element's attribute that names the active theme. */\n readonly attribute: string\n readonly theme: (name: Name) => KnobTheme<Standard>\n /** Every token with the initial theme's knobs: what the root declares, and what `t` reads. */\n readonly root: StandardTokens\n /** Each other theme's knobs, under its attribute on the root element, for the `theme` layer. */\n readonly scoped: StyleValue\n}\n\n/**\n * `themes` installed by their keys, `initial` shown until the Model chooses\n * another. A name is a key, so it is unique, and `Name` is the Schema of the\n * Model field that holds the active one.\n */\nexport const make = <const Record extends { readonly [name: string]: KnobTheme<Standard> }>(\n themes: Record,\n options: { readonly initial: keyof Record & string; readonly attribute?: string },\n): Themes<keyof Record & string> => {\n const names = Object.keys(themes) as ReadonlyArray<keyof Record & string>\n const attribute = options.attribute ?? 'data-theme'\n const theme = (name: keyof Record & string) => themes[name]!\n return {\n Name: Schema.Literals(names),\n names,\n initial: options.initial,\n attribute,\n theme,\n root: standardOf(theme(options.initial)),\n scoped: global(\n names\n .filter(name => name !== options.initial)\n .map(name => knobRule(`:root[${attribute}=\"${name}\"]`, theme(name)))\n .join(''),\n ),\n }\n}\n\n/**\n * Shows `name` on the root element, as a Command's effect: the initial theme\n * removes the attribute, so the root's own declarations apply.\n */\nexport const apply = <Name extends string>(themes: Themes<Name>, name: Name): Effect.Effect<void> =>\n Effect.sync(() => {\n const root = document.documentElement\n if (name === themes.initial) root.removeAttribute(themes.attribute)\n else root.setAttribute(themes.attribute, name)\n })\n\n/** The storage key a chosen theme's name is kept under, unless one is given. */\nexport const THEME_KEY = 'foldkit:theme'\n\n/**\n * The text of a `<script>` for the document's head: it shows the theme whose\n * name is kept under `key`, so a reader who chose one never sees the initial\n * theme for a frame. A kept name that is not one of `themes` (a theme a later\n * build removed), and storage that throws, leave the initial theme.\n */\nexport const script = <Name extends string>(\n themes: Themes<Name>,\n key: string = THEME_KEY,\n): string =>\n `(function(){try{var n=localStorage.getItem(${scriptLiteral(key)});` +\n `if(${scriptLiteral(themes.names.filter(name => name !== themes.initial))}.indexOf(n)!==-1)` +\n `document.documentElement.setAttribute(${scriptLiteral(themes.attribute)},n)}catch(e){}})()`\n\n/**\n * Shows `name`, as `apply` does, and keeps it under `key` for the next visit,\n * as a Command's effect: the initial theme keeps nothing. Storage that throws\n * still shows it on this page.\n */\nexport const choose = <Name extends string>(\n themes: Themes<Name>,\n name: Name,\n key: string = THEME_KEY,\n): Effect.Effect<void> =>\n apply(themes, name).pipe(\n Effect.andThen(\n Effect.sync(() => {\n try {\n if (name === themes.initial) localStorage.removeItem(key)\n else localStorage.setItem(key, name)\n } catch {\n // Storage refused (a private window, a full quota): this visit keeps it.\n }\n }),\n ),\n )\n\n/**\n * `theme` on the elements `selector` matches, below the root: its knobs and\n * every derivation again. A token resolves where it is declared, so knobs\n * alone under a subtree would change nothing derived from them there.\n */\nexport const scope = (theme: KnobTheme<Standard>, selector: string): StyleValue => {\n const { knob: _knob, ...derived } = shipped\n return global(`${selector}{${declarations(derived)}}${knobRule(selector, theme)}`)\n}\n","/**\n * A theme's tokens as `:root` custom properties, for the page stylesheet.\n * Unlayered: the page decides which layer with `Layers.in`.\n */\nimport { global, type StyleValue } from '../styleValue.js'\nimport { VAR_PREFIX, type ThemeTokens } from './core.js'\n\nexport interface RootOptions {\n /** Tokens present in this theme are left out, so a scale shipped in another layer goes out once. */\n readonly omit?: ThemeTokens\n /** Default `'light dark'`, so `lightDark` tokens resolve. */\n readonly colorScheme?: 'light dark' | 'light' | 'dark'\n}\n\n/**\n * Every token as `--fk-group-name:value`, in authored order. `omit` is\n * matched token by token, not group by group: two themes can both carry a\n * `knob` group (the scales' density beside a palette's hues) and only the\n * names `omit` has are skipped.\n */\nconst declarations = (theme: ThemeTokens, omit?: ThemeTokens): ReadonlyArray<string> =>\n Object.entries(theme).flatMap(([group, names]) =>\n Object.entries(names).flatMap(([name, value]) =>\n omit !== undefined && Object.hasOwn(omit[group] ?? {}, name)\n ? []\n : [`${VAR_PREFIX}-${group}-${name}:${value}`],\n ),\n )\n\nexport const root = (theme: ThemeTokens, options?: RootOptions): StyleValue =>\n global(\n `:root{${[...declarations(theme, options?.omit), `color-scheme:${options?.colorScheme ?? 'light dark'}`].join(';')}}`,\n )\n\n/** Some of a theme's tokens, by the theme's own group and token names. */\nexport type Overrides<T extends ThemeTokens> = {\n readonly [G in keyof T]?: { readonly [N in keyof T[G]]?: string }\n}\n\n/**\n * Token overrides under `selector`: a named theme the Model selects with a\n * root attribute (`:root[data-theme=\"ocean\"]`), or a scheme the user chose\n * (`:root[data-color-scheme=\"dark\"]`). Which one is active is the Model's\n * fact; this only says what it means. On the root element an overridden knob\n * re-derives every token; under a subtree it changes only the tokens it\n * overrides itself, since a token resolves where it is declared: scope a\n * theme to a subtree with `Theme.scope`, which declares the derivations there\n * too.\n *\n * `theme` is the theme being overridden and is read only for its type, so a\n * group or token it lacks is a type error rather than a variable nothing reads.\n */\nexport const scoped = <T extends ThemeTokens>(\n _theme: T,\n selector: string,\n overrides: Overrides<T>,\n): StyleValue => {\n const tokens: Record<string, Record<string, string>> = {}\n for (const [group, names] of Object.entries(overrides)) {\n const defined: Record<string, string> = {}\n for (const [name, value] of Object.entries(names ?? {})) {\n if (typeof value === 'string') defined[name] = value\n }\n tokens[group] = defined\n }\n return global(`${selector}{${declarations(tokens).join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qg.mjs","names":["makeTheme","declarations"],"sources":["../src/theme/oklch.ts","../src/theme/scriptLiteral.ts","../src/theme/themes.ts","../src/theme/root.ts"],"sourcesContent":["/**\n * A whole palette from a few knobs, as css-tags derives it: every value\n * except the knobs is a CSS expression over other tokens, so overriding a\n * knob on the element that declares the tokens (`:root`, or a scoped theme's\n * selector) re-derives the rest in the browser. A custom property resolves\n * where it is declared, so a knob overridden on a subtree below `:root`\n * changes nothing: `Theme.scope` declares the derivations there too. Where\n * light and dark schemes need different numbers the value is a `light-dark()` pair, so one theme serves both and a user's\n * choice is a `color-scheme` override.\n */\nimport { define } from './core.js'\nimport { standard, unsetOf } from './knobs.js'\n\nconst v = (group: string, name: string) => `var(--fk-${group}-${name})`\nconst ld = (light: string, dark: string) => `light-dark(${light}, ${dark})`\nconst offset = (amount: number) => `${amount < 0 ? '-' : '+'} ${Math.abs(amount)}`\n/** `oklch(from <color> …)` with the hue kept. */\nconst from = (color: string, l: string, c: string) => `oklch(from ${color} ${l} ${c} h)`\nconst shift = (color: string, dl: number, dc: number) =>\n from(color, `calc(l ${offset(dl)})`, `calc(c ${offset(dc)})`)\nconst scale = (color: string, dl: number, cx: number) =>\n from(color, `calc(l ${offset(dl)})`, `calc(c * ${cx})`)\n/** The same lightness and chroma as `color` on another hue. */\nconst rehue = (color: string, hue: string) => `oklch(from ${color} l c ${hue})`\n/** Near-black or near-white text over `color`. */\nconst contrast = (color: string) =>\n `oklch(from ${color} clamp(0.1, (0.65 / l - 1) * 999, 0.98) min(c, 0.08) h)`\n/** `color` as text on the base surface: dark in a light scheme, light in a dark one. */\nconst ink = (color: string) => ld(from(color, '0.5', 'c'), from(color, '0.8', 'c'))\n/**\n * `color` tinted onto the base surface, the same in both schemes. Mixed in\n * OKLab, not OKLCH: OKLCH interpolates hue, so a mix mostly of the base keeps\n * the base's hue, and a green tinted onto a blue-grey base came out blue.\n */\nconst tint = (color: string, percent: number) =>\n `color-mix(in oklab, ${v('surface', 'base')} ${percent}%, ${color})`\n\nconst neutral = v('hue', 'neutral')\nconst base = v('surface', 'base')\nconst surfaceC = v('knob', 'surface-c')\nconst surfaceCDark = v('knob', 'surface-c-dark')\nconst contrastFactor = v('knob', 'contrast-factor')\n\ntype Step = readonly [lightness: number, chroma: number]\n\n/**\n * How far a step's target lies past the offset it names: at the default\n * contrast (26%) a step sits where its offset says, and the whole knob spans\n * 2.5 times that, so its range is one a reader sees. At a reach of 1 the knob\n * at its top moved the muted surface four points of lightness.\n */\nconst REACH = 2.5\nconst reach = ([lightness, chroma]: Step): Step => [\n Number((lightness * REACH).toFixed(4)),\n Number((1 + (chroma - 1) * REACH).toFixed(4)),\n]\n\n/** A surface step: the base mixed toward a target by `surface-contrast`. */\nconst surfaceStep = (lightStep: Step, darkStep: Step) => {\n const amount = v('knob', 'surface-contrast')\n const [light, dark] = [reach(lightStep), reach(darkStep)]\n const target = ld(scale(base, light[0], light[1]), scale(base, dark[0], dark[1]))\n return `color-mix(in oklch, ${base} calc(100% - ${amount}), ${target} ${amount})`\n}\n\n/** `a` where the 0-or-1 knob `name` is 1, `b` where it is 0. */\nconst share = (a: string, name: string, b: string) =>\n `color-mix(in oklab, ${a} calc(${v('knob', name)} * 100%), ${b})`\n\n/** A text color: fixed lightness, chroma scaled by surface saturation and the contrast factor. */\nconst text = (light: Step, dark: Step) =>\n ld(\n `oklch(${light[0]}% calc(${surfaceC} * ${light[1]} * ${contrastFactor}) ${neutral})`,\n `oklch(${dark[0]}% calc(${surfaceCDark} * ${dark[1]} * ${contrastFactor}) ${neutral})`,\n )\n\n/**\n * A color family, every one the same shape: its fill, the fill hovered and\n * pressed, a tint of it on the base, a line in it that stands off the base\n * (darker in a light scheme, lighter in a dark one), and text on the fill\n * and in the family's color.\n */\nconst family = (name: string, defaultValue: string) => {\n const color = v(name, 'default')\n return {\n default: defaultValue,\n hover: shift(color, -0.06, 0),\n active: shift(color, -0.1, 0.05),\n subtle: tint(color, 85),\n outline: ld(shift(color, -0.05, 0), shift(color, 0.05, 0)),\n 'on-fill': contrast(color),\n ink: ink(color),\n }\n}\n\n/**\n * A code color in `hue`: the same lightness for every kind, so no kind shouts,\n * dark enough to read on a light surface and light enough on a dark one.\n */\nconst syntaxInk = (hue: string) =>\n ld(`oklch(48% ${v('knob', 'syntax-c')} ${hue})`, `oklch(80% ${v('knob', 'syntax-c')} ${hue})`)\n\n/**\n * A chart's series color: a hue a fixed turn from the first, at a lightness\n * and chroma chosen for that hue in each scheme (a yellow sits lighter than a\n * blue to read as strong). The five are the dataviz reference palette's first\n * slots, in its order, which keeps neighbors apart under protan and deutan\n * vision; moving `chart-h` turns them all and keeps the order.\n */\nconst chartInk = (turn: number, light: Step, dark: Step) => {\n const hue = `calc(${v('knob', 'chart-h')} ${offset(turn)})`\n return ld(`oklch(${light[0]} ${light[1]} ${hue})`, `oklch(${dark[0]} ${dark[1]} ${hue})`)\n}\n\n/** A feedback family, lighter in a dark scheme so its fill reads on a dark page. */\nconst feedback = (name: string, l: number, c: number, dark: number) =>\n family(\n name,\n ld(\n `oklch(${l}% ${c} ${v('knob', `${name}-h`)})`,\n `oklch(${dark}% ${c} ${v('knob', `${name}-h`)})`,\n ),\n )\n\n/** The color scales, each named for its hue (a knob, `red-h`). */\ntype ScaleName = 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'purple'\n\n/**\n * One lightness ladder for every scale, near white to near black in even\n * steps, so step 6 of red is as light as step 6 of blue: a step number\n * means the same contrast in any hue (after css-tags' palette).\n */\nconst scaleL = [97, 88.5, 80, 71.5, 63, 54.5, 46, 37.5, 29, 20.5]\n// Chroma swells toward the middle, where a screen can show most of it, and\n// thins at both ends, where a vivid near-white or near-black falls out of gamut.\nconst scaleC = [0.02, 0.05, 0.09, 0.13, 0.16, 0.17, 0.155, 0.125, 0.09, 0.055]\n\n/**\n * A color's ten steps, `1` the lightest, and four `wash`es: step 6 mixed\n * into the page, so a tinted ground follows the scheme and the surface\n * knobs as the page does.\n */\nconst colorScale = (name: ScaleName) => {\n const hue = v('knob', `${name}-h`)\n const step = (index: number) =>\n `oklch(${scaleL[index]}% calc(${scaleC[index]} * ${v('knob', 'scale-c')}) ${hue})`\n const wash = (share: number) =>\n `color-mix(in oklab, ${v(name, '6')} ${share}%, ${v('surface', 'base')})`\n return {\n '1': step(0),\n '2': step(1),\n '3': step(2),\n '4': step(3),\n '5': step(4),\n '6': step(5),\n '7': step(6),\n '8': step(7),\n '9': step(8),\n '10': step(9),\n 'wash-1': wash(8),\n 'wash-2': wash(16),\n 'wash-3': wash(28),\n 'wash-4': wash(44),\n }\n}\n\n/**\n * An outline, the palette's line until the `shape.outlines` knob gives it the\n * text's own ink: `outline-ink` 0 is the line itself, 1 the ink at its strength.\n */\nconst inked = (line: string, strength: 'subtle' | 'default' | 'overt') =>\n `color-mix(in oklch, ${line}, color-mix(in oklch, ${v('text', 'overt')} ${v('knob', `outline-ink-${strength}`)}, transparent) calc(${v('knob', 'outline-ink')} * 100%))`\n\nconst accent = v('accent', 'default')\n\n/**\n * The palette: every color a CSS expression over the knobs' variables. The\n * knobs stand at their defaults here; a theme declares its own values over\n * them (`Theme.standard`).\n */\nexport const palette = define({\n knob: {\n ...unsetOf(standard),\n // How much of the text a state lays over its surface; a hover's is a knob.\n 'state-tint': '8%',\n 'state-tint-dark': '25%',\n 'image-edge': '10%',\n // How much lighter each raised level is in a dark scheme.\n 'raise-dark': '0.027',\n },\n hue: {\n accent: v('knob', 'accent-h'),\n secondary: `calc(${v('knob', 'accent-h')} + ${v('knob', 'secondary-shift')})`,\n tertiary: `calc(${v('knob', 'accent-h')} + ${v('knob', 'tertiary-shift')})`,\n neutral: v('knob', 'neutral-h'),\n },\n surface: {\n base: ld(\n `oklch(${v('knob', 'base-l')} calc(${surfaceC} * 0.9) ${neutral})`,\n `oklch(${v('knob', 'base-l-dark')} calc(${surfaceCDark} * 0.9) ${neutral})`,\n ),\n // A control's resting ground, separate from a neutral surface step so a\n // field can keep its contrast if the steps move: filled fields read it,\n // the page reads base.\n field: v('surface', 'default'),\n // Each step keeps about the base's chroma, so a sidebar, a panel and\n // the page read as one color at a few lightnesses: one with less reads\n // grey on the page, one with more reads as another, bluer color.\n muted: surfaceStep([-0.04, 1.2], [-0.03, 1.05]),\n subtle: surfaceStep([-0.025, 1.15], [-0.015, 1.05]),\n default: surfaceStep([-0.055, 1.25], [0.045, 1.1]),\n overt: surfaceStep([-0.31, 2.25], [0.125, 1.2]),\n // The deepest of the page's color in both schemes: under a dialog's\n // backdrop, a veil of it darkens the page; it was near-white in a dark one.\n bedrock: ld(\n `oklch(8% calc(${surfaceC} * 1.2) ${neutral})`,\n `oklch(6% calc(${surfaceCDark} * 1.2) ${neutral})`,\n ),\n },\n text: {\n default: text([20, 2], [88, 0.8]),\n muted: text([45, 1.5], [65, 1.2]),\n subtle: text([35, 1.8], [75, 1]),\n overt: text([10, 2.2], [95, 0.6]),\n link: shift(accent, 0.1, 0.05),\n 'link-hover': shift(v('text', 'link'), -0.1, 0),\n },\n // Steps from the base, as the surfaces are: darker in a light scheme,\n // lighter in a dark one, and in the base's own hue with a little more of\n // its chroma, which a thin line needs to read as the page's color. Text mixed into the base, as they were, came out grey on a\n // tinted page: the text is near-neutral, so the mix lost the tint.\n outline: {\n subtle: inked(ld(scale(base, -0.07, 1.3), scale(base, 0.065, 1.25)), 'subtle'),\n // Between two parts of one surface (groups of a list, a panel's\n // header): a step past `subtle`, which a dark page all but hides.\n divider: inked(ld(scale(base, -0.1, 1.35), scale(base, 0.095, 1.3)), 'subtle'),\n default: inked(ld(scale(base, -0.13, 1.4), scale(base, 0.12, 1.35)), 'default'),\n overt: inked(ld(scale(base, -0.27, 1.6), scale(base, 0.23, 1.5)), 'overt'),\n // The accent as it is: darker and more saturated, the ring was the\n // harshest color on the page.\n focus: accent,\n },\n accent: family(\n 'accent',\n ld(\n `oklch(${v('knob', 'accent-l')} ${v('knob', 'accent-c')} ${v('hue', 'accent')})`,\n `oklch(${v('knob', 'accent-l-dark')} ${v('knob', 'accent-c-dark')} ${v('hue', 'accent')})`,\n ),\n ),\n secondary: family('secondary', rehue(accent, v('hue', 'secondary'))),\n tertiary: family('tertiary', rehue(accent, v('hue', 'tertiary'))),\n // A near-black of the shadow's hue: faint on a light surface, and denser\n // on a dark one, where a light shadow would read as a glow.\n shadow: {\n color: ld(\n `oklch(25% ${v('knob', 'shadow-c')} ${v('knob', 'shadow-h')} / 0.14)`,\n // A third more chroma, as the dark surfaces have.\n `oklch(5% calc(${v('knob', 'shadow-c')} * 4 / 3) ${v('knob', 'shadow-h')} / 0.6)`,\n ),\n },\n // What a state lays over the surface under it, after Fluid Functionalism's\n // overlays. `hover`, `tint` and `tint-hover` mix the element's own text\n // color: `currentColor` resolves where the film is drawn, so a hover reads\n // at any elevation, on a tinted band, and on an inverted panel alike. A\n // film that must take its surface's hue instead reads a property on the\n // element (`unfilledHover` reads a surface's `--_fk-state-ink`, falling\n // back to this `ink`): a `var()` substitutes where the token is declared,\n // so a token cannot carry a per-surface ink. `tint` is a see-through fill, which\n // takes on whatever it sits on (lighter when hovered, as Fluid's: the\n // press is what darkens). `edge` is a hairline inside an image, so a pale\n // edge keeps its shape. `ink` is the state ink where no surface set one:\n // the text (`surface`), the accent's ink (`accent`), or the text with the\n // films reading it directly (`neutral`, as before).\n state: {\n hover: `color-mix(in oklab, currentColor ${v('knob', 'state-hover')}, transparent)`,\n // The same ink held down: a press is the hover at 1.75, one strength the\n // `hoverStrength` knob moves for both. `pressedHover` is its twin, and\n // takes the surface's ink where this one takes the text's.\n press: `color-mix(in oklab, currentColor calc(${v('knob', 'state-hover')} * 1.75), transparent)`,\n tint: ld(\n `color-mix(in oklab, currentColor ${v('knob', 'state-tint')}, transparent)`,\n `color-mix(in oklab, currentColor ${v('knob', 'state-tint-dark')}, transparent)`,\n ),\n 'tint-hover': ld(\n `color-mix(in oklab, currentColor calc(${v('knob', 'state-tint')} * 0.8), transparent)`,\n `color-mix(in oklab, currentColor calc(${v('knob', 'state-tint-dark')} * 0.8), transparent)`,\n ),\n edge: `color-mix(in oklab, ${v('text', 'overt')} ${v('knob', 'image-edge')}, transparent)`,\n ink: v('knob', 'state-ink'),\n },\n // A menu's panel and its lit row, which the popup recipes read.\n popup: {\n surface: `color-mix(in oklab, ${share(\n ld(\n `oklch(${v('knob', 'base-l-dark')} calc(${surfaceCDark} * 0.9) ${neutral})`,\n `oklch(${v('knob', 'base-l')} calc(${surfaceC} * 0.9) ${neutral})`,\n ),\n 'popup-invert',\n base,\n )} calc(${v('knob', 'popup-alpha')} * 100%), transparent)`,\n // The other scheme's base, which an inverted panel takes wherever it is raised to.\n inverted: ld(\n `oklch(${v('knob', 'base-l-dark')} calc(${surfaceCDark} * 0.9) ${neutral})`,\n `oklch(${v('knob', 'base-l')} calc(${surfaceC} * 0.9) ${neutral})`,\n ),\n // The text of the opposite scheme: light on an inverted panel in a light one.\n ink: share(text([88, 0.8], [20, 2]), 'popup-invert', v('text', 'default')),\n highlight: share(\n v('accent', 'default'),\n 'popup-bold',\n `color-mix(in oklab, ${v('popup', 'ink')} 8%, transparent)`,\n ),\n // Held down, as a row's hover deepens to its press: the accent darker, the\n // panel's own ink denser.\n press: share(\n v('accent', 'active'),\n 'popup-bold',\n `color-mix(in oklab, ${v('popup', 'ink')} 14%, transparent)`,\n ),\n 'highlight-ink': share(v('accent', 'on-fill'), 'popup-bold', v('popup', 'ink')),\n blur: v('knob', 'popup-blur'),\n },\n success: feedback('success', 55, 0.15, 64),\n warning: feedback('warning', 70, 0.15, 76),\n // Under 65% in the dark, where the text on a fill turns dark: on red that reads muddy.\n error: feedback('error', 60, 0.2, 64),\n info: feedback('info', 65, 0.15, 70),\n // Series colors, `chart-1` to `chart-5` as shadcn names them: a chart\n // assigns them in order, never by rank, so a series keeps its color.\n chart: {\n '1': chartInk(0, [0.575, 0.163], [0.622, 0.161]),\n '2': chartInk(145, [0.671, 0.175], [0.622, 0.173]),\n '3': chartInk(-93, [0.669, 0.141], [0.621, 0.128]),\n '4': chartInk(180, [0.764, 0.161], [0.67, 0.143]),\n '5': chartInk(102, [0.716, 0.141], [0.622, 0.171]),\n },\n // Color scales of ten even steps, for what is not a role: a tag's\n // color, an illustration, a status of the application's own.\n red: colorScale('red'),\n orange: colorScale('orange'),\n yellow: colorScale('yellow'),\n green: colorScale('green'),\n teal: colorScale('teal'),\n blue: colorScale('blue'),\n purple: colorScale('purple'),\n // Code, by the kinds a tokenizer names (`syntax-keyword` is\n // `--fk-syntax-keyword`): each kind in a hue the palette already has, so\n // code follows the brand, and the quiet kinds in the text's own grey.\n syntax: {\n keyword: syntaxInk(v('hue', 'accent')),\n function: syntaxInk(v('hue', 'secondary')),\n type: syntaxInk(v('hue', 'tertiary')),\n string: syntaxInk(v('knob', 'success-h')),\n number: syntaxInk(v('knob', 'warning-h')),\n property: syntaxInk(v('knob', 'info-h')),\n operator: v('text', 'default'),\n punctuation: v('text', 'muted'),\n comment: text([52, 1], [62, 1]),\n },\n})\n\nexport type Palette = typeof palette\n","/**\n * `value` as a literal in a head script's text: `<` escaped, so a key or a\n * name cannot close the script it is written into.\n */\nexport const scriptLiteral = (value: unknown): string =>\n JSON.stringify(value).replaceAll('<', `${String.fromCharCode(92)}u003c`)\n","/**\n * Themes installed by name. A theme of typed knobs (`Theme.make`) holds only\n * knob values, and every token derives from knob variables, so one set of\n * derivations serves every theme: the root declares them with the initial\n * theme's knobs, and each other theme writes its knobs under\n * `:root[data-theme=\"name\"]`, the same element, where the derivations resolve\n * them. Which theme is active is the application's Model's fact; `apply` is\n * the Command's effect that shows it, and `choose` shows it and keeps it,\n * for `script` to show in the head of the next page before the first paint.\n */\nimport { Effect, Schema } from 'effect'\nimport { global, type StyleValue } from '../styleValue.js'\nimport { compose, VAR_PREFIX, type ThemeTokens } from './core.js'\nimport {\n make as makeTheme,\n tokensOf,\n variables,\n type KnobSet,\n type KnobTheme,\n type Standard,\n} from './knobs.js'\nimport { palette, type Palette } from './oklch.js'\nimport { scriptLiteral } from './scriptLiteral.js'\nimport { tokens, type Tokens } from './tokens.js'\n\n/** Every shipped token: the scales, the palette, and the knobs they read. */\nexport type StandardTokens = ReturnType<typeof compose<Tokens, Palette>>\n\nconst shipped = compose(tokens, palette)\n\n/**\n * Every shipped token with `theme`'s knob values, for a page's root: the\n * derivations are the same for every theme, so only the knobs differ. With\n * no theme, every knob at its default.\n */\nexport const standardOf = (theme: KnobTheme<Standard> = makeTheme({})): StandardTokens =>\n compose(shipped, tokensOf(theme))\n\nconst declarations = (theme: ThemeTokens) =>\n Object.entries(theme)\n .flatMap(([group, names]) =>\n Object.entries(names).map(([name, value]) => `${VAR_PREFIX}-${group}-${name}:${value}`),\n )\n .join(';')\n\nconst knobRule = (selector: string, theme: KnobTheme<KnobSet>) =>\n `${selector}{${Object.entries(variables(theme))\n .map(([name, value]) => `${VAR_PREFIX}-knob-${name}:${value}`)\n .join(';')}}`\n\n/** A set of named themes, one of them shown until the Model chooses another. */\nexport interface Themes<Name extends string> {\n /** The names, as a Schema for the Model field that holds the active one. */\n readonly Name: Schema.Literals<ReadonlyArray<Name>>\n readonly names: ReadonlyArray<Name>\n readonly initial: Name\n /** The root element's attribute that names the active theme. */\n readonly attribute: string\n readonly theme: (name: Name) => KnobTheme<Standard>\n /** Every token with the initial theme's knobs: what the root declares, and what `t` reads. */\n readonly root: StandardTokens\n /** Each other theme's knobs, under its attribute on the root element, for the `theme` layer. */\n readonly scoped: StyleValue\n}\n\n/**\n * `themes` installed by their keys, `initial` shown until the Model chooses\n * another. A name is a key, so it is unique, and `Name` is the Schema of the\n * Model field that holds the active one.\n */\nexport const make = <const Record extends { readonly [name: string]: KnobTheme<Standard> }>(\n themes: Record,\n options: { readonly initial: keyof Record & string; readonly attribute?: string },\n): Themes<keyof Record & string> => {\n const names = Object.keys(themes) as ReadonlyArray<keyof Record & string>\n const attribute = options.attribute ?? 'data-theme'\n const theme = (name: keyof Record & string) => themes[name]!\n return {\n Name: Schema.Literals(names),\n names,\n initial: options.initial,\n attribute,\n theme,\n root: standardOf(theme(options.initial)),\n scoped: global(\n names\n .filter(name => name !== options.initial)\n .map(name => knobRule(`:root[${attribute}=\"${name}\"]`, theme(name)))\n .join(''),\n ),\n }\n}\n\n/**\n * Shows `name` on the root element, as a Command's effect: the initial theme\n * removes the attribute, so the root's own declarations apply.\n */\nexport const apply = <Name extends string>(themes: Themes<Name>, name: Name): Effect.Effect<void> =>\n Effect.sync(() => {\n const root = document.documentElement\n if (name === themes.initial) root.removeAttribute(themes.attribute)\n else root.setAttribute(themes.attribute, name)\n })\n\n/** The storage key a chosen theme's name is kept under, unless one is given. */\nexport const THEME_KEY = 'foldkit:theme'\n\n/**\n * The text of a `<script>` for the document's head: it shows the theme whose\n * name is kept under `key`, so a reader who chose one never sees the initial\n * theme for a frame. A kept name that is not one of `themes` (a theme a later\n * build removed), and storage that throws, leave the initial theme.\n */\nexport const script = <Name extends string>(\n themes: Themes<Name>,\n key: string = THEME_KEY,\n): string =>\n `(function(){try{var n=localStorage.getItem(${scriptLiteral(key)});` +\n `if(${scriptLiteral(themes.names.filter(name => name !== themes.initial))}.indexOf(n)!==-1)` +\n `document.documentElement.setAttribute(${scriptLiteral(themes.attribute)},n)}catch(e){}})()`\n\n/**\n * Shows `name`, as `apply` does, and keeps it under `key` for the next visit,\n * as a Command's effect: the initial theme keeps nothing. Storage that throws\n * still shows it on this page.\n */\nexport const choose = <Name extends string>(\n themes: Themes<Name>,\n name: Name,\n key: string = THEME_KEY,\n): Effect.Effect<void> =>\n apply(themes, name).pipe(\n Effect.andThen(\n Effect.sync(() => {\n try {\n if (name === themes.initial) localStorage.removeItem(key)\n else localStorage.setItem(key, name)\n } catch {\n // Storage refused (a private window, a full quota): this visit keeps it.\n }\n }),\n ),\n )\n\n/**\n * `theme` on the elements `selector` matches, below the root: its knobs and\n * every derivation again. A token resolves where it is declared, so knobs\n * alone under a subtree would change nothing derived from them there.\n */\nexport const scope = (theme: KnobTheme<Standard>, selector: string): StyleValue => {\n const { knob: _knob, ...derived } = shipped\n return global(`${selector}{${declarations(derived)}}${knobRule(selector, theme)}`)\n}\n","/**\n * A theme's tokens as `:root` custom properties, for the page stylesheet.\n * Unlayered: the page decides which layer with `Layers.in`.\n */\nimport { global, type StyleValue } from '../styleValue.js'\nimport { VAR_PREFIX, type ThemeTokens } from './core.js'\n\nexport interface RootOptions {\n /** Tokens present in this theme are left out, so a scale shipped in another layer goes out once. */\n readonly omit?: ThemeTokens\n /** Default `'light dark'`, so `lightDark` tokens resolve. */\n readonly colorScheme?: 'light dark' | 'light' | 'dark'\n}\n\n/**\n * Every token as `--fk-group-name:value`, in authored order. `omit` is\n * matched token by token, not group by group: two themes can both carry a\n * `knob` group (the scales' density beside a palette's hues) and only the\n * names `omit` has are skipped.\n */\nconst declarations = (theme: ThemeTokens, omit?: ThemeTokens): ReadonlyArray<string> =>\n Object.entries(theme).flatMap(([group, names]) =>\n Object.entries(names).flatMap(([name, value]) =>\n omit !== undefined && Object.hasOwn(omit[group] ?? {}, name)\n ? []\n : [`${VAR_PREFIX}-${group}-${name}:${value}`],\n ),\n )\n\nexport const root = (theme: ThemeTokens, options?: RootOptions): StyleValue =>\n global(\n `:root{${[...declarations(theme, options?.omit), `color-scheme:${options?.colorScheme ?? 'light dark'}`].join(';')}}`,\n )\n\n/** Some of a theme's tokens, by the theme's own group and token names. */\nexport type Overrides<T extends ThemeTokens> = {\n readonly [G in keyof T]?: { readonly [N in keyof T[G]]?: string }\n}\n\n/**\n * Token overrides under `selector`: a named theme the Model selects with a\n * root attribute (`:root[data-theme=\"ocean\"]`), or a scheme the user chose\n * (`:root[data-color-scheme=\"dark\"]`). Which one is active is the Model's\n * fact; this only says what it means. On the root element an overridden knob\n * re-derives every token; under a subtree it changes only the tokens it\n * overrides itself, since a token resolves where it is declared: scope a\n * theme to a subtree with `Theme.scope`, which declares the derivations there\n * too.\n *\n * `theme` is the theme being overridden and is read only for its type, so a\n * group or token it lacks is a type error rather than a variable nothing reads.\n */\nexport const scoped = <T extends ThemeTokens>(\n _theme: T,\n selector: string,\n overrides: Overrides<T>,\n): StyleValue => {\n const tokens: Record<string, Record<string, string>> = {}\n for (const [group, names] of Object.entries(overrides)) {\n const defined: Record<string, string> = {}\n for (const [name, value] of Object.entries(names ?? {})) {\n if (typeof value === 'string') defined[name] = value\n }\n tokens[group] = defined\n }\n return global(`${selector}{${declarations(tokens).join(';')}}`)\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAM,KAAK,OAAe,SAAiB,YAAY,MAAM,GAAG,KAAK;AACrE,MAAM,MAAM,OAAe,SAAiB,cAAc,MAAM,IAAI,KAAK;AACzE,MAAM,UAAU,WAAmB,GAAG,SAAS,IAAI,MAAM,IAAI,GAAG,KAAK,IAAI,MAAM;;AAE/E,MAAM,QAAQ,OAAe,GAAW,MAAc,cAAc,MAAM,GAAG,EAAE,GAAG,EAAE;AACpF,MAAM,SAAS,OAAe,IAAY,OACxC,KAAK,OAAO,UAAU,OAAO,EAAE,EAAE,IAAI,UAAU,OAAO,EAAE,EAAE,EAAE;AAC9D,MAAM,SAAS,OAAe,IAAY,OACxC,KAAK,OAAO,UAAU,OAAO,EAAE,EAAE,IAAI,YAAY,GAAG,EAAE;;AAExD,MAAM,SAAS,OAAe,QAAgB,cAAc,MAAM,OAAO,IAAI;;AAE7E,MAAM,YAAY,UAChB,cAAc,MAAM;;AAEtB,MAAM,OAAO,UAAkB,GAAG,KAAK,OAAO,OAAO,GAAG,GAAG,KAAK,OAAO,OAAO,GAAG,CAAC;;;;;;AAMlF,MAAM,QAAQ,OAAe,YAC3B,uBAAuB,EAAE,WAAW,MAAM,EAAE,GAAG,QAAQ,KAAK,MAAM;AAEpE,MAAM,UAAU,EAAE,OAAO,SAAS;AAClC,MAAM,OAAO,EAAE,WAAW,MAAM;AAChC,MAAM,WAAW,EAAE,QAAQ,WAAW;AACtC,MAAM,eAAe,EAAE,QAAQ,gBAAgB;AAC/C,MAAM,iBAAiB,EAAE,QAAQ,iBAAiB;;;;;;;AAUlD,MAAM,QAAQ;AACd,MAAM,SAAS,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