@tetsustudio/tokens 0.0.0-stage → 0.2.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tetsu Studio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,89 @@
1
- # Temporary Holding Version
1
+ # @tetsustudio/tokens
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The Tetsu design-token contract: plain CSS custom properties, the visual styles
4
+ (`data-style`), their palettes, and a validator for new themes.
5
+
6
+ ```sh
7
+ npm install @tetsustudio/tokens
8
+ ```
9
+
10
+ ## Use
11
+
12
+ ```css
13
+ /* Any app */
14
+ @import '@tetsustudio/tokens/css';
15
+
16
+ /* Tailwind v4 apps, after tailwindcss */
17
+ @import 'tailwindcss';
18
+ @import '@tetsustudio/tokens/css';
19
+ @import '@tetsustudio/tokens/tailwind.css';
20
+ ```
21
+
22
+ ```html
23
+ <html data-style="tetsu" class="dark">
24
+ ```
25
+
26
+ Styles: `original`, `recto`, `papel`, `bloque`, `caramelo`, `tetsu`, `vidrio`.
27
+ Each one ships a default light and dark palette; `class="dark"` switches mode.
28
+
29
+ ## Gallery themes
30
+
31
+ Every style of [style.tetsustudio.com](https://style.tetsustudio.com) ships as
32
+ a theme: brasa, chicle, hambre, laca, musgo, origami, plano, tetsu, vidrio, and
33
+ the app styles original, recto, papel, bloque and caramelo.
34
+
35
+ ```css
36
+ @import '@tetsustudio/tokens/css';
37
+ @import '@tetsustudio/tokens/themes/vidrio.css';
38
+ ```
39
+
40
+ ```html
41
+ <html data-style="vidrio"> <!-- class="dark" for dark mode -->
42
+ ```
43
+
44
+ A theme loads its Google Fonts and sets colors (light and dark), shape and
45
+ fonts. Its rules are unlayered, so they win over the base palettes. The list is
46
+ exported as `GALLERY_THEMES`; `npm run sync-themes` refreshes it from the
47
+ gallery repo.
48
+
49
+ ## The contract
50
+
51
+ A theme sets five variables, in light and in dark:
52
+
53
+ | Variable | Role |
54
+ | --- | --- |
55
+ | `--background` | Page ground |
56
+ | `--surface` | Raised areas: inputs, popovers, muted blocks |
57
+ | `--foreground` | Text |
58
+ | `--brand` | Accent, focus ring, primary button in most styles |
59
+ | `--brand-foreground` | Text on `--brand` |
60
+
61
+ Everything else (`--border`, `--muted-foreground`, `--primary`, the shadcn
62
+ variables, sidebar and chart colors) derives from them with `color-mix()`. A
63
+ theme may also override shape (`--radius`, `--shape-full`, `--shape-lg`,
64
+ `--style-border`), type (`--font-sans`, `--font-heading`, `--font-mono`) and
65
+ status colors (`--destructive`, `--success`, `--warning`, `--info` and their
66
+ `-foreground`).
67
+
68
+ Fonts are not bundled: load them in the app and set `--font-inter`,
69
+ `--font-nunito`, `--font-jetbrains`, `--font-newsreader`, `--font-archivo`,
70
+ `--font-archivo-black` or `--font-fredoka` as needed; without them each style
71
+ falls back to a system stack.
72
+
73
+ ## Validate a theme
74
+
75
+ ```sh
76
+ npx tetsu-validate-theme theme.css my-style
77
+ ```
78
+
79
+ Fails when a required variable is missing (light or dark) or when contrast is
80
+ below AA: text on background and surface 4.5, text on brand 4.5, brand on
81
+ surface 3. The same checks are exported as `parseThemeCss` and `validateTheme`.
82
+
83
+ ## JavaScript
84
+
85
+ ```ts
86
+ import { STYLE_IDS, VISUAL_STYLES, COLOR_THEME_PRESETS, applyPalette } from '@tetsustudio/tokens'
87
+ ```
88
+
89
+ MIT © Tetsu Studio
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ // Usage: tetsu-validate-theme <theme.css> <style-id>
3
+ // Exits 1 and lists the problems when the theme breaks the token contract.
4
+ import { readFileSync } from 'node:fs'
5
+ import { parseThemeCss, validateTheme } from '../dist/index.js'
6
+
7
+ const [file, styleId] = process.argv.slice(2)
8
+ if (!file || !styleId) {
9
+ console.error('Usage: tetsu-validate-theme <theme.css> <style-id>')
10
+ process.exit(2)
11
+ }
12
+ const problems = validateTheme(parseThemeCss(readFileSync(file, 'utf8'), styleId))
13
+ if (problems.length === 0) {
14
+ console.log(`${styleId}: theme OK`)
15
+ } else {
16
+ for (const p of problems) console.error(`${styleId} (${p.mode}): ${p.message}`)
17
+ process.exit(1)
18
+ }
@@ -0,0 +1,25 @@
1
+ /** Variables every theme must set, in light and in dark. */
2
+ export declare const REQUIRED_THEME_VARIABLES: readonly ["--background", "--surface", "--foreground", "--brand", "--brand-foreground"];
3
+ /** Variables a theme may override; everything else derives from the required five. */
4
+ export declare const OPTIONAL_THEME_VARIABLES: readonly ["--radius", "--shape-full", "--shape-lg", "--style-border", "--muted-foreground", "--border", "--input", "--primary", "--primary-foreground", "--destructive", "--destructive-foreground", "--success", "--success-foreground", "--warning", "--warning-foreground", "--info", "--info-foreground", "--font-sans", "--font-heading", "--font-mono"];
5
+ /** WCAG AA for normal text. */
6
+ export declare const MIN_TEXT_CONTRAST = 4.5;
7
+ /** WCAG AA for large text and UI parts, used for brand on surface. */
8
+ export declare const MIN_UI_CONTRAST = 3;
9
+ export type ThemeVariables = Record<string, string>;
10
+ export interface ParsedTheme {
11
+ light: ThemeVariables;
12
+ dark: ThemeVariables;
13
+ }
14
+ export interface ThemeProblem {
15
+ mode: 'light' | 'dark';
16
+ message: string;
17
+ }
18
+ /**
19
+ * Reads the light and dark variables of one style from a theme.css. Light is
20
+ * every rule whose selector names `[data-style='<id>']` without `.dark`; dark is
21
+ * every rule that names both.
22
+ */
23
+ export declare function parseThemeCss(css: string, styleId: string): ParsedTheme;
24
+ /** Checks a theme against the contract: required variables and contrast. */
25
+ export declare function validateTheme(theme: ParsedTheme): ThemeProblem[];
@@ -0,0 +1,108 @@
1
+ import { contrastRatio } from './styles.js';
2
+ /** Variables every theme must set, in light and in dark. */
3
+ export const REQUIRED_THEME_VARIABLES = [
4
+ '--background',
5
+ '--surface',
6
+ '--foreground',
7
+ '--brand',
8
+ '--brand-foreground',
9
+ ];
10
+ /** Variables a theme may override; everything else derives from the required five. */
11
+ export const OPTIONAL_THEME_VARIABLES = [
12
+ '--radius',
13
+ '--shape-full',
14
+ '--shape-lg',
15
+ '--style-border',
16
+ '--muted-foreground',
17
+ '--border',
18
+ '--input',
19
+ '--primary',
20
+ '--primary-foreground',
21
+ '--destructive',
22
+ '--destructive-foreground',
23
+ '--success',
24
+ '--success-foreground',
25
+ '--warning',
26
+ '--warning-foreground',
27
+ '--info',
28
+ '--info-foreground',
29
+ '--font-sans',
30
+ '--font-heading',
31
+ '--font-mono',
32
+ ];
33
+ /** WCAG AA for normal text. */
34
+ export const MIN_TEXT_CONTRAST = 4.5;
35
+ /** WCAG AA for large text and UI parts, used for brand on surface. */
36
+ export const MIN_UI_CONTRAST = 3;
37
+ const HEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
38
+ function normalizeHex(value) {
39
+ const hex = value.trim().toLowerCase();
40
+ if (!HEX.test(hex))
41
+ return null;
42
+ if (hex.length === 4)
43
+ return `#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`;
44
+ return hex;
45
+ }
46
+ function declarations(body) {
47
+ const result = {};
48
+ for (const match of body.matchAll(/(--[\w-]+)\s*:\s*([^;]+);/g)) {
49
+ result[match[1]] = match[2].trim();
50
+ }
51
+ return result;
52
+ }
53
+ /**
54
+ * Reads the light and dark variables of one style from a theme.css. Light is
55
+ * every rule whose selector names `[data-style='<id>']` without `.dark`; dark is
56
+ * every rule that names both.
57
+ */
58
+ export function parseThemeCss(css, styleId) {
59
+ const light = {};
60
+ const dark = {};
61
+ const withoutComments = css.replace(/\/\*[\s\S]*?\*\//g, '');
62
+ for (const match of withoutComments.matchAll(/([^{}]+)\{([^{}]*)\}/g)) {
63
+ const selector = match[1].replace(/\s+/g, ' ');
64
+ const names = new RegExp(`data-style=['"]?${styleId}['"]?\\]`).test(selector);
65
+ if (!names)
66
+ continue;
67
+ Object.assign(selector.includes('.dark') ? dark : light, declarations(match[2]));
68
+ }
69
+ return { light, dark };
70
+ }
71
+ /** Checks a theme against the contract: required variables and contrast. */
72
+ export function validateTheme(theme) {
73
+ const problems = [];
74
+ for (const mode of ['light', 'dark']) {
75
+ // Dark inherits whatever the light block set and dark does not override.
76
+ const vars = mode === 'light' ? theme.light : { ...theme.light, ...theme.dark };
77
+ for (const name of REQUIRED_THEME_VARIABLES) {
78
+ if (!vars[name])
79
+ problems.push({ mode, message: `missing ${name}` });
80
+ }
81
+ if (mode === 'dark' && Object.keys(theme.dark).length === 0) {
82
+ problems.push({ mode, message: 'no dark block (selector with .dark and the style id)' });
83
+ continue;
84
+ }
85
+ const pair = (a, b, min) => {
86
+ const x = vars[a] && normalizeHex(vars[a]);
87
+ const y = vars[b] && normalizeHex(vars[b]);
88
+ if (!vars[a] || !vars[b])
89
+ return;
90
+ if (!x || !y) {
91
+ problems.push({ mode, message: `${a} and ${b} must be hex colors to check contrast` });
92
+ return;
93
+ }
94
+ const ratio = contrastRatio(x, y);
95
+ if (ratio < min) {
96
+ problems.push({
97
+ mode,
98
+ message: `${a} on ${b} contrast ${ratio.toFixed(2)} is below ${min}`,
99
+ });
100
+ }
101
+ };
102
+ pair('--foreground', '--background', MIN_TEXT_CONTRAST);
103
+ pair('--foreground', '--surface', MIN_TEXT_CONTRAST);
104
+ pair('--brand-foreground', '--brand', MIN_TEXT_CONTRAST);
105
+ pair('--brand', '--surface', MIN_UI_CONTRAST);
106
+ }
107
+ return problems;
108
+ }
@@ -0,0 +1,78 @@
1
+ /* Tetsu token contract. A theme sets four tones (--background, --surface,
2
+ --foreground, --brand) plus --brand-foreground; every other color derives
3
+ from them with color-mix(), so applying a theme only overrides those five.
4
+ Shape and type come from the style (css/styles.css). Everything is plain CSS
5
+ custom properties: it works with or without Tailwind. */
6
+
7
+ @layer base {
8
+ :root {
9
+ --background: #ffffff;
10
+ --surface: #fafafa;
11
+ --foreground: #000000;
12
+ --brand: #3b82f6;
13
+ --brand-foreground: #ffffff;
14
+
15
+ --card: var(--background);
16
+ --card-foreground: var(--foreground);
17
+ --popover: var(--surface);
18
+ --popover-foreground: var(--foreground);
19
+ --primary: var(--foreground);
20
+ --primary-foreground: var(--background);
21
+ --secondary: var(--surface);
22
+ --secondary-foreground: var(--foreground);
23
+ --muted: var(--surface);
24
+ --muted-foreground: color-mix(in srgb, var(--foreground) 55%, var(--background));
25
+ --accent: color-mix(in srgb, var(--foreground) 6%, var(--background));
26
+ --accent-foreground: var(--foreground);
27
+ --border: color-mix(in srgb, var(--foreground) 12%, var(--background));
28
+ --input: color-mix(in srgb, var(--foreground) 12%, var(--background));
29
+ --ring: var(--brand);
30
+
31
+ /* Status colors. Text on them uses the matching -foreground. */
32
+ --destructive: #ef4444;
33
+ --destructive-foreground: #ffffff;
34
+ --success: #16a34a;
35
+ --success-foreground: #ffffff;
36
+ --warning: #d97706;
37
+ --warning-foreground: #ffffff;
38
+ --info: #2563eb;
39
+ --info-foreground: #ffffff;
40
+
41
+ --sidebar: var(--background);
42
+ --sidebar-foreground: var(--foreground);
43
+ --sidebar-primary: var(--primary);
44
+ --sidebar-primary-foreground: var(--primary-foreground);
45
+ --sidebar-accent: var(--accent);
46
+ --sidebar-accent-foreground: var(--accent-foreground);
47
+ --sidebar-border: var(--border);
48
+ --sidebar-ring: var(--ring);
49
+
50
+ --chart-1: oklch(0.87 0 0);
51
+ --chart-2: oklch(0.556 0 0);
52
+ --chart-3: oklch(0.439 0 0);
53
+ --chart-4: oklch(0.371 0 0);
54
+ --chart-5: oklch(0.269 0 0);
55
+
56
+ --radius: 0.75rem;
57
+
58
+ /* Fonts: apps that load their own fonts (next/font, @font-face) set
59
+ --font-inter and friends; without them the system stack is used. */
60
+ --font-sans: var(--font-inter, ui-sans-serif, system-ui, sans-serif);
61
+ --font-heading: var(--font-nunito, ui-sans-serif, system-ui, sans-serif);
62
+ --font-mono: var(--font-jetbrains, ui-monospace, SFMono-Regular, Menlo, monospace);
63
+ }
64
+
65
+ .dark {
66
+ --background: #090909;
67
+ --surface: #171717;
68
+ --foreground: #ffffff;
69
+ --destructive: #f87171;
70
+ --destructive-foreground: #111111;
71
+ --success: #4ade80;
72
+ --success-foreground: #111111;
73
+ --warning: #fbbf24;
74
+ --warning-foreground: #111111;
75
+ --info: #60a5fa;
76
+ --info-foreground: #111111;
77
+ }
78
+ }
@@ -0,0 +1,3 @@
1
+ @import './base.css';
2
+ @import './styles.css';
3
+ @import './palettes.css';
@@ -0,0 +1,101 @@
1
+ /* Generated by scripts/build-css.mjs from src/styles.ts. Do not edit. */
2
+ @layer base {
3
+ html[data-style='original'] {
4
+ --background: #ffffff;
5
+ --surface: #fafafa;
6
+ --foreground: #000000;
7
+ --brand: #3b82f6;
8
+ --brand-foreground: #111111;
9
+ }
10
+ html[data-style='original'].dark {
11
+ --background: #090909;
12
+ --surface: #171717;
13
+ --foreground: #ffffff;
14
+ --brand: #3b82f6;
15
+ --brand-foreground: #111111;
16
+ }
17
+ html[data-style='recto'] {
18
+ --background: #ffffff;
19
+ --surface: #f4f4f5;
20
+ --foreground: #0a0a0a;
21
+ --brand: #0a0a0a;
22
+ --brand-foreground: #ffffff;
23
+ }
24
+ html[data-style='recto'].dark {
25
+ --background: #0a0a0a;
26
+ --surface: #171717;
27
+ --foreground: #fafafa;
28
+ --brand: #fafafa;
29
+ --brand-foreground: #111111;
30
+ }
31
+ html[data-style='papel'] {
32
+ --background: #eef0ea;
33
+ --surface: #f9faf6;
34
+ --foreground: #14213a;
35
+ --brand: #2740b0;
36
+ --brand-foreground: #ffffff;
37
+ }
38
+ html[data-style='papel'].dark {
39
+ --background: #10182a;
40
+ --surface: #1a2439;
41
+ --foreground: #e9edf2;
42
+ --brand: #8ea6ff;
43
+ --brand-foreground: #111111;
44
+ }
45
+ html[data-style='bloque'] {
46
+ --background: #ffe34d;
47
+ --surface: #fffdf0;
48
+ --foreground: #111111;
49
+ --brand: #d81b63;
50
+ --brand-foreground: #ffffff;
51
+ }
52
+ html[data-style='bloque'].dark {
53
+ --background: #141414;
54
+ --surface: #232323;
55
+ --foreground: #f6f5ee;
56
+ --brand: #d9ff3f;
57
+ --brand-foreground: #111111;
58
+ }
59
+ html[data-style='caramelo'] {
60
+ --background: #f5efff;
61
+ --surface: #ffffff;
62
+ --foreground: #2a1a4a;
63
+ --brand: #7235e0;
64
+ --brand-foreground: #ffffff;
65
+ }
66
+ html[data-style='caramelo'].dark {
67
+ --background: #1a1230;
68
+ --surface: #271c44;
69
+ --foreground: #f1eaff;
70
+ --brand: #b999ff;
71
+ --brand-foreground: #111111;
72
+ }
73
+ html[data-style='tetsu'] {
74
+ --background: #ffffff;
75
+ --surface: #f4f4f2;
76
+ --foreground: #0b0b0c;
77
+ --brand: #e2470f;
78
+ --brand-foreground: #111111;
79
+ }
80
+ html[data-style='tetsu'].dark {
81
+ --background: #070708;
82
+ --surface: #0e0f11;
83
+ --foreground: #f2f2ee;
84
+ --brand: #ff5a1f;
85
+ --brand-foreground: #111111;
86
+ }
87
+ html[data-style='vidrio'] {
88
+ --background: #f3f4f1;
89
+ --surface: #ffffff;
90
+ --foreground: #16191d;
91
+ --brand: #1747ff;
92
+ --brand-foreground: #ffffff;
93
+ }
94
+ html[data-style='vidrio'].dark {
95
+ --background: #0e1013;
96
+ --surface: #15181c;
97
+ --foreground: #eceeef;
98
+ --brand: #6e8bff;
99
+ --brand-foreground: #111111;
100
+ }
101
+ }
@@ -0,0 +1,213 @@
1
+ /* Visual styles: shape and type per <html data-style="...">. Tokens go in @layer
2
+ base; rules that must beat Tailwind utilities (heading weight, button
3
+ shadows) stay unlayered. Original has no block: it is the :root default. */
4
+
5
+ @layer base {
6
+ :root {
7
+ /* rounded-full, rounded-lg and border read these variables (see @theme in
8
+ tailwind.css). For a true circle in any style: rounded-[50%]. */
9
+ --shape-full: 9999px;
10
+ --shape-lg: 12px;
11
+ --style-border: 1px;
12
+ --switch-thumb-on: #ffffff;
13
+ --switch-thumb-off: #ffffff;
14
+ }
15
+
16
+ html[data-style='recto'],
17
+ html[data-style='papel'],
18
+ html[data-style='bloque'],
19
+ html[data-style='caramelo'],
20
+ html[data-style='vidrio'] {
21
+ --primary: var(--brand);
22
+ --primary-foreground: var(--brand-foreground);
23
+ --switch-thumb-on: var(--brand-foreground);
24
+ }
25
+
26
+ html[data-style='recto'] {
27
+ --radius: 0rem;
28
+ --shape-full: 0px;
29
+ --shape-lg: 0px;
30
+ --muted-foreground: color-mix(in srgb, var(--foreground) 62%, var(--background));
31
+ --font-heading: var(--font-inter, ui-sans-serif, system-ui, sans-serif);
32
+ font-size: 93.75%;
33
+ }
34
+
35
+ html[data-style='papel'] {
36
+ --radius: 0.1875rem;
37
+ --shape-full: 3px;
38
+ --shape-lg: 4px;
39
+ --muted-foreground: color-mix(in srgb, var(--foreground) 72%, var(--background));
40
+ --input: color-mix(in srgb, var(--foreground) 40%, var(--background));
41
+ --font-sans: var(--font-newsreader, Georgia, serif);
42
+ --font-heading: var(--font-newsreader, Georgia, serif);
43
+ }
44
+
45
+ html[data-style='bloque'] {
46
+ --radius: 0rem;
47
+ --shape-full: 0px;
48
+ --shape-lg: 0px;
49
+ --style-border: 2px;
50
+ --border: var(--foreground);
51
+ --input: var(--foreground);
52
+ --switch-thumb-off: var(--background);
53
+ --muted-foreground: color-mix(in srgb, var(--foreground) 82%, var(--background));
54
+ --font-sans: var(--font-archivo, ui-sans-serif, sans-serif);
55
+ --font-heading: var(--font-archivo-black, Impact, sans-serif);
56
+ }
57
+
58
+ html[data-style='caramelo'] {
59
+ --radius: 1.25rem;
60
+ --shape-lg: 20px;
61
+ --muted-foreground: color-mix(in srgb, var(--foreground) 72%, var(--background));
62
+ --border: color-mix(in srgb, var(--foreground) 14%, var(--background));
63
+ --font-sans: var(--font-nunito, ui-rounded, sans-serif);
64
+ --font-heading: var(--font-fredoka, ui-rounded, sans-serif);
65
+ }
66
+
67
+ /* Tetsu (style.tetsustudio.com/s/tetsu): controls 4px, buttons stay pills,
68
+ Inter for headings too. The primary stays inverted like Original, so the
69
+ switch thumb takes the ground color, readable on every ember/steel accent. */
70
+ html[data-style='tetsu'] {
71
+ --radius: 0.25rem;
72
+ --shape-lg: 4px;
73
+ --muted-foreground: color-mix(in srgb, var(--foreground) 62%, var(--background));
74
+ --switch-thumb-on: var(--background);
75
+ --font-heading: var(--font-inter, ui-sans-serif, system-ui, sans-serif);
76
+ }
77
+
78
+ /* Vidrio (style.tetsustudio.com/s/vidrio): 6px controls, 2px panels, Funnel
79
+ loaded at runtime (googleFonts in lib/visual-styles.ts). */
80
+ html[data-style='vidrio'] {
81
+ --radius: 0.125rem;
82
+ --shape-full: 6px;
83
+ --shape-lg: 2px;
84
+ --muted-foreground: color-mix(in srgb, var(--foreground) 68%, var(--background));
85
+ --font-sans: 'Funnel Sans', var(--font-inter, ui-sans-serif, system-ui, sans-serif);
86
+ --font-heading: 'Funnel Display', 'Funnel Sans', var(--font-inter, ui-sans-serif, system-ui, sans-serif);
87
+ --font-mono: 'Martian Mono', var(--font-jetbrains, ui-monospace, monospace);
88
+ }
89
+
90
+ /* In light mode a white thumb barely shows on the track; in dark it does. */
91
+ html[data-style='recto']:not(.dark),
92
+ html[data-style='caramelo']:not(.dark),
93
+ html[data-style='tetsu']:not(.dark),
94
+ html[data-style='vidrio']:not(.dark) {
95
+ --switch-thumb-off: var(--muted-foreground);
96
+ }
97
+
98
+ html[data-style='papel']:not(.dark) {
99
+ --switch-thumb-off: var(--foreground);
100
+ }
101
+ }
102
+
103
+ html[data-style='recto'] [data-slot='table-head'] {
104
+ font-family: var(--font-mono);
105
+ }
106
+
107
+ html[data-style='papel'] :is(h1, h2, h3) {
108
+ font-family: var(--font-heading);
109
+ font-weight: 500;
110
+ }
111
+
112
+ html[data-style='bloque'] :is(h1, h2, h3) {
113
+ font-family: var(--font-heading);
114
+ font-weight: 400;
115
+ text-transform: uppercase;
116
+ letter-spacing: -0.01em;
117
+ }
118
+
119
+ /* A trigger (menu, popover) has its own data-slot; when it looks like a button it has data-variant. */
120
+ html[data-style='bloque']
121
+ :is([data-slot='button'], [data-slot$='-trigger']):is(
122
+ [data-variant='default'],
123
+ [data-variant='outline'],
124
+ [data-variant='secondary']
125
+ ) {
126
+ border-color: var(--foreground);
127
+ box-shadow: 3px 3px 0 var(--foreground);
128
+ font-weight: 700;
129
+ letter-spacing: 0.03em;
130
+ text-transform: uppercase;
131
+ }
132
+
133
+ html[data-style='bloque']
134
+ :is([data-slot='button'], [data-slot$='-trigger']):is(
135
+ [data-variant='default'],
136
+ [data-variant='outline'],
137
+ [data-variant='secondary']
138
+ ):hover {
139
+ box-shadow: 5px 5px 0 var(--foreground);
140
+ transform: translate(-2px, -2px);
141
+ }
142
+
143
+ html[data-style='bloque']
144
+ :is(
145
+ [data-slot='dialog-content'],
146
+ [data-slot='popover-content'],
147
+ [data-slot='select-content'],
148
+ [data-slot='dropdown-menu-content']
149
+ ) {
150
+ border: 2px solid var(--foreground);
151
+ box-shadow: 6px 6px 0 var(--foreground);
152
+ }
153
+
154
+ html[data-style='caramelo'] :is(h1, h2, h3) {
155
+ font-family: var(--font-heading);
156
+ font-weight: 600;
157
+ }
158
+
159
+ html[data-style='caramelo']
160
+ :is([data-slot='button'], [data-slot$='-trigger']):is(
161
+ [data-variant='default'],
162
+ [data-variant='secondary']
163
+ ) {
164
+ box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 24%, transparent);
165
+ }
166
+
167
+ html[data-style='caramelo']
168
+ :is([data-slot='button'], [data-slot$='-trigger']):is(
169
+ [data-variant='default'],
170
+ [data-variant='secondary']
171
+ ):hover {
172
+ box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 34%, transparent);
173
+ transform: translateY(-1px);
174
+ }
175
+
176
+ html[data-style='tetsu'] :is(h1, h2, h3) {
177
+ font-family: var(--font-heading);
178
+ font-weight: 600;
179
+ letter-spacing: -0.03em;
180
+ }
181
+
182
+ html[data-style='tetsu'] [data-slot='table-head'] {
183
+ font-family: var(--font-mono);
184
+ }
185
+
186
+ html[data-style='vidrio'] :is(h1, h2) {
187
+ font-family: var(--font-heading);
188
+ font-weight: 300;
189
+ letter-spacing: -0.01em;
190
+ }
191
+
192
+ html[data-style='vidrio'] h3 {
193
+ font-family: var(--font-heading);
194
+ font-weight: 500;
195
+ }
196
+
197
+ html[data-style='vidrio']
198
+ :is(
199
+ [data-slot='dialog-content'],
200
+ [data-slot='popover-content'],
201
+ [data-slot='select-content'],
202
+ [data-slot='dropdown-menu-content']
203
+ ) {
204
+ box-shadow:
205
+ 0 1px 0 var(--border),
206
+ 0 12px 32px -12px rgb(22 25 29 / 0.18);
207
+ }
208
+
209
+ @media (prefers-reduced-motion: reduce) {
210
+ html[data-style] :is([data-slot='button'], [data-slot$='-trigger'])[data-variant]:hover {
211
+ transform: none !important;
212
+ }
213
+ }