@lgtm-hq/turbo-themes 0.17.2 → 0.18.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/dist/adapters/tailwind/{colors-Z-_izgsf.js → colors-DBLa1Wbq.js} +51 -2
- package/dist/adapters/tailwind/colors.js +1 -1
- package/dist/adapters/tailwind/preset.js +2 -2
- package/dist/tokens/style-dictionary/themes.json +2 -2
- package/dist/tokens/style-dictionary/tokens.json +2 -2
- package/package.json +2 -1
- package/packages/adapters/tailwind/dist/{colors-Z-_izgsf.js → colors-DBLa1Wbq.js} +51 -2
- package/packages/adapters/tailwind/dist/colors-DBLa1Wbq.js.map +1 -0
- package/packages/adapters/tailwind/dist/colors.js +1 -1
- package/packages/adapters/tailwind/dist/preset.js +2 -2
- package/packages/core/dist/index.d.ts +1 -0
- package/packages/core/dist/index.d.ts.map +1 -1
- package/packages/core/dist/index.js +1 -0
- package/packages/core/dist/index.js.map +1 -1
- package/packages/core/dist/themes/metadata.d.ts +44 -0
- package/packages/core/dist/themes/metadata.d.ts.map +1 -0
- package/packages/core/dist/themes/metadata.js +106 -0
- package/packages/core/dist/themes/metadata.js.map +1 -0
- package/packages/core/dist/themes/tokens.json +2 -2
- package/packages/core/dist/themes/types.d.ts +0 -3
- package/packages/core/dist/themes/types.d.ts.map +1 -1
- package/packages/css/dist/index.d.ts +19 -3
- package/packages/css/dist/index.js +37 -1
- package/packages/css/dist/index.js.map +1 -1
- package/packages/css/dist/turbo-themes-all.css +2225 -0
- package/packages/theme-selector/dist/index.js +77 -27
- package/packages/theme-selector/dist/index.js.map +1 -1
- package/packages/adapters/tailwind/dist/colors-Z-_izgsf.js.map +0 -1
|
@@ -14,7 +14,7 @@ const flavors = Object.values(tokens.themes).map((theme) => ({
|
|
|
14
14
|
tokens: theme.tokens
|
|
15
15
|
}));
|
|
16
16
|
const themesById = /* @__PURE__ */ Object.fromEntries(flavors.map((flavor) => [flavor.id, flavor]));
|
|
17
|
-
/* @__PURE__ */ Object.fromEntries(Object.entries(tokens.byVendor).map(([vendorId, vendor]) => [
|
|
17
|
+
const packages = /* @__PURE__ */ Object.fromEntries(Object.entries(tokens.byVendor).map(([vendorId, vendor]) => [
|
|
18
18
|
vendorId,
|
|
19
19
|
{
|
|
20
20
|
id: vendorId,
|
|
@@ -28,6 +28,55 @@ function getTheme(id) {
|
|
|
28
28
|
}
|
|
29
29
|
const themeIds = /* @__PURE__ */ flavors.map((f) => f.id);
|
|
30
30
|
[...new Set(flavors.map((f) => f.vendor))];
|
|
31
|
+
/* @__PURE__ */ Object.fromEntries(flavors.map((f) => [f.id, f.label]));
|
|
32
|
+
/* @__PURE__ */ Object.fromEntries(flavors.map((f) => [f.id, f.appearance]));
|
|
33
|
+
const VENDOR_ORDER = [
|
|
34
|
+
"catppuccin",
|
|
35
|
+
"dracula",
|
|
36
|
+
"gruvbox",
|
|
37
|
+
"github",
|
|
38
|
+
"bulma",
|
|
39
|
+
"nord",
|
|
40
|
+
"solarized",
|
|
41
|
+
"rose-pine",
|
|
42
|
+
"tokyo-night"
|
|
43
|
+
];
|
|
44
|
+
const _packageKeys = Object.keys(packages);
|
|
45
|
+
const _missingFromOrder = _packageKeys.filter((id) => !VENDOR_ORDER.includes(id));
|
|
46
|
+
if (_missingFromOrder.length > 0) {
|
|
47
|
+
console.warn(`[metadata] VENDOR_ORDER is missing vendor IDs present in packages: ${_missingFromOrder.join(", ")}. Append them to VENDOR_ORDER so their themes are included in VENDOR_GROUPS.`);
|
|
48
|
+
}
|
|
49
|
+
const flavorById = /* @__PURE__ */ new Map(flavors.map((f) => [f.id, f]));
|
|
50
|
+
const shortLabelCache = /* @__PURE__ */ new Map();
|
|
51
|
+
function getShortLabel(themeId) {
|
|
52
|
+
const cached = shortLabelCache.get(themeId);
|
|
53
|
+
if (cached !== void 0)
|
|
54
|
+
return cached;
|
|
55
|
+
const flavor = flavorById.get(themeId);
|
|
56
|
+
if (!flavor)
|
|
57
|
+
return themeId;
|
|
58
|
+
const vendorPkg = packages[flavor.vendor];
|
|
59
|
+
if (!vendorPkg) {
|
|
60
|
+
shortLabelCache.set(themeId, flavor.label);
|
|
61
|
+
return flavor.label;
|
|
62
|
+
}
|
|
63
|
+
if (vendorPkg.flavors.length === 1) {
|
|
64
|
+
shortLabelCache.set(themeId, flavor.label);
|
|
65
|
+
return flavor.label;
|
|
66
|
+
}
|
|
67
|
+
const displayName = vendorPkg.name.replace(/\s*\(synced\)\s*/i, "");
|
|
68
|
+
const label = flavor.label;
|
|
69
|
+
let result;
|
|
70
|
+
if (label.toLowerCase().startsWith(displayName.toLowerCase())) {
|
|
71
|
+
const stripped = label.slice(displayName.length).trim();
|
|
72
|
+
result = stripped || label;
|
|
73
|
+
} else {
|
|
74
|
+
result = label;
|
|
75
|
+
}
|
|
76
|
+
shortLabelCache.set(themeId, result);
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
/* @__PURE__ */ Object.fromEntries(flavors.map((f) => [f.id, getShortLabel(f.id)]));
|
|
31
80
|
function createColorMappings(themeIds2) {
|
|
32
81
|
const mappings = {};
|
|
33
82
|
themeIds2.forEach((themeId) => {
|
|
@@ -140,4 +189,4 @@ export {
|
|
|
140
189
|
getTheme as g,
|
|
141
190
|
themeIds as t
|
|
142
191
|
};
|
|
143
|
-
//# sourceMappingURL=colors-
|
|
192
|
+
//# sourceMappingURL=colors-DBLa1Wbq.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as themeIds, c as createColorMappings } from "./colors-
|
|
2
|
-
import { g, a } from "./colors-
|
|
1
|
+
import { t as themeIds, c as createColorMappings } from "./colors-DBLa1Wbq.js";
|
|
2
|
+
import { g, a } from "./colors-DBLa1Wbq.js";
|
|
3
3
|
const defaultOptions = {
|
|
4
4
|
themes: [...themeIds],
|
|
5
5
|
darkMode: true,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://design-tokens.org/schema.json",
|
|
3
3
|
"$description": "Turbo Themes - Design tokens for 24 themes",
|
|
4
|
-
"$version": "0.
|
|
5
|
-
"$generated": "2026-02-07T10:
|
|
4
|
+
"$version": "0.18.0",
|
|
5
|
+
"$generated": "2026-02-07T10:42:12.506Z",
|
|
6
6
|
"meta": {
|
|
7
7
|
"themeIds": [
|
|
8
8
|
"bulma-dark",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://design-tokens.org/schema.json",
|
|
3
3
|
"$description": "Turbo Themes - Flat tokens for 24 themes",
|
|
4
|
-
"$version": "0.
|
|
5
|
-
"$generated": "2026-02-07T10:
|
|
4
|
+
"$version": "0.18.0",
|
|
5
|
+
"$generated": "2026-02-07T10:42:12.509Z",
|
|
6
6
|
"meta": {
|
|
7
7
|
"themeIds": [
|
|
8
8
|
"bulma-dark",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lgtm-hq/turbo-themes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Universal theme packs and an accessible theme selector.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"workspaces": [
|
|
9
9
|
"packages/*",
|
|
10
10
|
"packages/adapters/*",
|
|
11
|
+
"apps/site",
|
|
11
12
|
"examples/react",
|
|
12
13
|
"examples/vue",
|
|
13
14
|
"examples/bootstrap"
|
|
@@ -14,7 +14,7 @@ const flavors = Object.values(tokens.themes).map((theme) => ({
|
|
|
14
14
|
tokens: theme.tokens
|
|
15
15
|
}));
|
|
16
16
|
const themesById = /* @__PURE__ */ Object.fromEntries(flavors.map((flavor) => [flavor.id, flavor]));
|
|
17
|
-
/* @__PURE__ */ Object.fromEntries(Object.entries(tokens.byVendor).map(([vendorId, vendor]) => [
|
|
17
|
+
const packages = /* @__PURE__ */ Object.fromEntries(Object.entries(tokens.byVendor).map(([vendorId, vendor]) => [
|
|
18
18
|
vendorId,
|
|
19
19
|
{
|
|
20
20
|
id: vendorId,
|
|
@@ -28,6 +28,55 @@ function getTheme(id) {
|
|
|
28
28
|
}
|
|
29
29
|
const themeIds = /* @__PURE__ */ flavors.map((f) => f.id);
|
|
30
30
|
[...new Set(flavors.map((f) => f.vendor))];
|
|
31
|
+
/* @__PURE__ */ Object.fromEntries(flavors.map((f) => [f.id, f.label]));
|
|
32
|
+
/* @__PURE__ */ Object.fromEntries(flavors.map((f) => [f.id, f.appearance]));
|
|
33
|
+
const VENDOR_ORDER = [
|
|
34
|
+
"catppuccin",
|
|
35
|
+
"dracula",
|
|
36
|
+
"gruvbox",
|
|
37
|
+
"github",
|
|
38
|
+
"bulma",
|
|
39
|
+
"nord",
|
|
40
|
+
"solarized",
|
|
41
|
+
"rose-pine",
|
|
42
|
+
"tokyo-night"
|
|
43
|
+
];
|
|
44
|
+
const _packageKeys = Object.keys(packages);
|
|
45
|
+
const _missingFromOrder = _packageKeys.filter((id) => !VENDOR_ORDER.includes(id));
|
|
46
|
+
if (_missingFromOrder.length > 0) {
|
|
47
|
+
console.warn(`[metadata] VENDOR_ORDER is missing vendor IDs present in packages: ${_missingFromOrder.join(", ")}. Append them to VENDOR_ORDER so their themes are included in VENDOR_GROUPS.`);
|
|
48
|
+
}
|
|
49
|
+
const flavorById = /* @__PURE__ */ new Map(flavors.map((f) => [f.id, f]));
|
|
50
|
+
const shortLabelCache = /* @__PURE__ */ new Map();
|
|
51
|
+
function getShortLabel(themeId) {
|
|
52
|
+
const cached = shortLabelCache.get(themeId);
|
|
53
|
+
if (cached !== void 0)
|
|
54
|
+
return cached;
|
|
55
|
+
const flavor = flavorById.get(themeId);
|
|
56
|
+
if (!flavor)
|
|
57
|
+
return themeId;
|
|
58
|
+
const vendorPkg = packages[flavor.vendor];
|
|
59
|
+
if (!vendorPkg) {
|
|
60
|
+
shortLabelCache.set(themeId, flavor.label);
|
|
61
|
+
return flavor.label;
|
|
62
|
+
}
|
|
63
|
+
if (vendorPkg.flavors.length === 1) {
|
|
64
|
+
shortLabelCache.set(themeId, flavor.label);
|
|
65
|
+
return flavor.label;
|
|
66
|
+
}
|
|
67
|
+
const displayName = vendorPkg.name.replace(/\s*\(synced\)\s*/i, "");
|
|
68
|
+
const label = flavor.label;
|
|
69
|
+
let result;
|
|
70
|
+
if (label.toLowerCase().startsWith(displayName.toLowerCase())) {
|
|
71
|
+
const stripped = label.slice(displayName.length).trim();
|
|
72
|
+
result = stripped || label;
|
|
73
|
+
} else {
|
|
74
|
+
result = label;
|
|
75
|
+
}
|
|
76
|
+
shortLabelCache.set(themeId, result);
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
/* @__PURE__ */ Object.fromEntries(flavors.map((f) => [f.id, getShortLabel(f.id)]));
|
|
31
80
|
function createColorMappings(themeIds2) {
|
|
32
81
|
const mappings = {};
|
|
33
82
|
themeIds2.forEach((themeId) => {
|
|
@@ -140,4 +189,4 @@ export {
|
|
|
140
189
|
getTheme as g,
|
|
141
190
|
themeIds as t
|
|
142
191
|
};
|
|
143
|
-
//# sourceMappingURL=colors-
|
|
192
|
+
//# sourceMappingURL=colors-DBLa1Wbq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors-DBLa1Wbq.js","sources":["../../../core/dist/tokens/index.js","../../../core/dist/themes/metadata.js","../colors.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n/**\n * Platform-agnostic design tokens export\n *\n * This module exports pure theme data (colors, typography, etc.) without\n * any DOM, CSS, or platform-specific code. Use this for:\n *\n * - React Native apps\n * - Flutter apps (via JSON export)\n * - iOS/Android native apps\n * - Any platform that needs theme colors\n *\n * For web apps, you can also import the CSS files directly:\n * import '@lgtm-hq/turbo-themes/css/catppuccin-mocha.css'\n */\n// Import tokens data (copied from dist/tokens.json during build)\nimport tokensData from '../themes/tokens.json' with { type: 'json' };\nconst tokens = tokensData;\n/**\n * All available theme flavors as a flat array\n */\nexport const flavors = Object.values(tokens.themes).map((theme) => ({\n id: theme.id,\n label: theme.label,\n vendor: theme.vendor,\n appearance: theme.appearance,\n ...(theme.iconUrl !== undefined && { iconUrl: theme.iconUrl }),\n tokens: theme.tokens,\n}));\n/**\n * Theme flavors indexed by ID for quick lookup\n */\nexport const themesById = /*#__PURE__*/ Object.fromEntries(flavors.map((flavor) => [flavor.id, flavor]));\n/**\n * All available theme packages (grouped by vendor)\n */\nexport const packages = /*#__PURE__*/ Object.fromEntries(Object.entries(tokens.byVendor).map(([vendorId, vendor]) => [\n vendorId,\n {\n id: vendorId,\n name: vendor.name,\n homepage: vendor.homepage,\n flavors: vendor.themes.map((themeId) => themesById[themeId]).filter(Boolean),\n },\n]));\n/**\n * Get a theme by ID\n * @param id - Theme identifier (e.g., 'catppuccin-mocha')\n * @returns The theme flavor or undefined if not found\n */\nexport function getTheme(id) {\n return themesById[id];\n}\n/**\n * Get theme tokens by ID (convenience function)\n * @param id - Theme identifier (e.g., 'catppuccin-mocha')\n * @returns The theme tokens or undefined if not found\n */\nexport function getTokens(id) {\n return themesById[id]?.tokens;\n}\n/**\n * Get all themes matching an appearance (light/dark)\n * @param appearance - 'light' or 'dark'\n * @returns Array of matching theme flavors\n */\nexport function getThemesByAppearance(appearance) {\n return flavors.filter((f) => f.appearance === appearance);\n}\n/**\n * Get all themes from a specific vendor\n * @param vendor - Vendor name (e.g., 'catppuccin', 'github')\n * @returns Array of matching theme flavors\n */\nexport function getThemesByVendor(vendor) {\n return flavors.filter((f) => f.vendor === vendor);\n}\n/**\n * List of all available theme IDs\n */\nexport const themeIds = /*#__PURE__*/ flavors.map((f) => f.id);\n/**\n * List of all available vendors\n */\nexport const vendors = /*#__PURE__*/ [...new Set(flavors.map((f) => f.vendor))];\n//# sourceMappingURL=index.js.map","// SPDX-License-Identifier: MIT\n/**\n * Consolidated theme metadata derived from tokens.json.\n *\n * All display metadata (names, appearances, vendor groups) is computed from\n * the canonical token data at module evaluation time. Consumers should import\n * from here instead of maintaining their own hardcoded copies.\n */\nimport { flavors, themeIds, packages } from '../tokens/index.js';\n/** Default theme applied when no preference is stored. */\nexport const DEFAULT_THEME = 'catppuccin-mocha';\n/** All valid theme IDs (re-export for convenience). */\nexport const VALID_THEMES = themeIds;\n/** Set of valid theme IDs for O(1) lookup. */\nexport const VALID_THEME_SET = /*#__PURE__*/ new Set(themeIds);\n/** Full human-readable label for each theme (e.g., \"Catppuccin Mocha\"). */\nexport const THEME_NAMES = /*#__PURE__*/ Object.fromEntries(flavors.map((f) => [f.id, f.label]));\n/** Appearance (light/dark) for each theme. */\nexport const THEME_APPEARANCES = \n/*#__PURE__*/ Object.fromEntries(flavors.map((f) => [f.id, f.appearance]));\n/**\n * Ordered list of vendor IDs controlling display order in dropdowns.\n * New vendors should be appended here.\n */\nexport const VENDOR_ORDER = [\n 'catppuccin',\n 'dracula',\n 'gruvbox',\n 'github',\n 'bulma',\n 'nord',\n 'solarized',\n 'rose-pine',\n 'tokyo-night',\n];\n/**\n * Ordered array of vendor groups derived from packages + VENDOR_ORDER.\n * The \"(synced)\" suffix is stripped from display names.\n */\n// Dev-time validation: warn if packages has vendors not listed in VENDOR_ORDER\nconst _packageKeys = Object.keys(packages);\nconst _missingFromOrder = _packageKeys.filter((id) => !VENDOR_ORDER.includes(id));\nif (_missingFromOrder.length > 0) {\n console.warn(`[metadata] VENDOR_ORDER is missing vendor IDs present in packages: ${_missingFromOrder.join(', ')}. ` +\n 'Append them to VENDOR_ORDER so their themes are included in VENDOR_GROUPS.');\n}\nexport const VENDOR_GROUPS = /*#__PURE__*/ VENDOR_ORDER.filter((id) => id in packages).map((id) => {\n const pkg = packages[id];\n return {\n id,\n displayName: pkg.name.replace(/\\s*\\(synced\\)\\s*/i, ''),\n themeIds: pkg.flavors\n .filter((f) => Boolean(f))\n .map((f) => f.id),\n };\n});\n/** O(1) flavor lookup by ID, built once at module evaluation time. */\nconst flavorById = /*#__PURE__*/ new Map(flavors.map((f) => [f.id, f]));\n/** Cache for computed short labels. */\nconst shortLabelCache = new Map();\n/**\n * Strip the vendor prefix from a theme label to produce a short label.\n *\n * For single-flavor vendors (e.g., \"Dracula\", \"Nord\") the full label is returned.\n * For multi-flavor vendors the vendor name prefix is stripped:\n * \"Catppuccin Mocha\" -> \"Mocha\"\n * \"Gruvbox Dark Hard\" -> \"Dark Hard\"\n *\n * @param themeId - A valid theme ID\n * @returns The short display label, or the full label if the theme is not found\n */\nexport function getShortLabel(themeId) {\n const cached = shortLabelCache.get(themeId);\n if (cached !== undefined)\n return cached;\n const flavor = flavorById.get(themeId);\n if (!flavor)\n return themeId;\n const vendorPkg = packages[flavor.vendor];\n if (!vendorPkg) {\n shortLabelCache.set(themeId, flavor.label);\n return flavor.label;\n }\n // Single-flavor vendors keep their full label\n if (vendorPkg.flavors.length === 1) {\n shortLabelCache.set(themeId, flavor.label);\n return flavor.label;\n }\n // Strip vendor display name prefix (case-insensitive, handles accented chars)\n const displayName = vendorPkg.name.replace(/\\s*\\(synced\\)\\s*/i, '');\n const label = flavor.label;\n let result;\n if (label.toLowerCase().startsWith(displayName.toLowerCase())) {\n const stripped = label.slice(displayName.length).trim();\n result = stripped || label;\n }\n else {\n result = label;\n }\n shortLabelCache.set(themeId, result);\n return result;\n}\n/** Pre-computed short labels for all themes. */\nexport const THEME_SHORT_LABELS = \n/*#__PURE__*/ Object.fromEntries(flavors.map((f) => [f.id, getShortLabel(f.id)]));\n//# sourceMappingURL=metadata.js.map","// SPDX-License-Identifier: MIT\n/**\n * Color mappings for Tailwind preset\n *\n * Generates semantic color classes for each theme variant.\n */\n\nimport { getTheme, themeIds } from '@lgtm-hq/turbo-themes-core';\n\ntype ThemeColors = {\n primary: string;\n surface: string;\n background: string;\n foreground: string;\n accent: string;\n success: string;\n warning: string;\n danger: string;\n info: string;\n border: string;\n};\n\n/**\n * Create color mappings for the given theme IDs\n * Generates classes like `bg-theme-{id}`, `text-theme-{id}-primary`, etc.\n */\nexport function createColorMappings(themeIds: readonly string[]) {\n const mappings: Record<string, ThemeColors> = {};\n\n themeIds.forEach((themeId) => {\n const theme = getTheme(themeId);\n if (!theme) return;\n\n const themeKey = themeId.replace(/[^a-zA-Z0-9]/g, '-');\n\n // Theme-specific color mappings\n mappings[`theme-${themeKey}`] = {\n primary: theme.tokens.brand.primary,\n surface: theme.tokens.background.surface,\n background: theme.tokens.background.base,\n foreground: theme.tokens.text.primary,\n accent: theme.tokens.accent.link,\n success: theme.tokens.state.success,\n warning: theme.tokens.state.warning,\n danger: theme.tokens.state.danger,\n info: theme.tokens.state.info,\n border: theme.tokens.border.default,\n };\n });\n\n return mappings;\n}\n\n/**\n * Get all available theme color mappings\n */\nexport function getAllThemeColors() {\n return createColorMappings(themeIds);\n}\n\n/**\n * Create CSS custom properties for a theme\n */\nexport function createThemeCssVariables(themeId: string): string {\n const theme = getTheme(themeId);\n if (!theme) return '';\n\n const tokens = theme.tokens;\n const lines: string[] = [];\n\n // Helper to add CSS variable\n const addVar = (name: string, value: string) => {\n lines.push(` --turbo-${name}: ${value};`);\n };\n\n // Background\n addVar('bg-base', tokens.background.base);\n addVar('bg-surface', tokens.background.surface);\n addVar('bg-surface-alt', tokens.background.overlay);\n\n // Text\n addVar('text-primary', tokens.text.primary);\n addVar('text-secondary', tokens.text.secondary);\n addVar('text-inverse', tokens.text.inverse);\n\n // Brand\n addVar('brand-primary', tokens.brand.primary);\n\n // State\n addVar('state-info', tokens.state.info);\n addVar('state-success', tokens.state.success);\n addVar('state-warning', tokens.state.warning);\n addVar('state-danger', tokens.state.danger);\n\n // Border\n addVar('border-default', tokens.border.default);\n\n // Accent\n addVar('accent-link', tokens.accent.link);\n\n // Content\n addVar('heading-h1', tokens.content.heading.h1);\n addVar('heading-h2', tokens.content.heading.h2);\n addVar('heading-h3', tokens.content.heading.h3);\n addVar('heading-h4', tokens.content.heading.h4);\n addVar('heading-h5', tokens.content.heading.h5);\n addVar('heading-h6', tokens.content.heading.h6);\n\n addVar('body-primary', tokens.content.body.primary);\n addVar('body-secondary', tokens.content.body.secondary);\n addVar('link-default', tokens.content.link.default);\n\n addVar('selection-fg', tokens.content.selection.fg);\n addVar('selection-bg', tokens.content.selection.bg);\n\n addVar('blockquote-border', tokens.content.blockquote.border);\n addVar('blockquote-fg', tokens.content.blockquote.fg);\n addVar('blockquote-bg', tokens.content.blockquote.bg);\n\n addVar('code-inline-fg', tokens.content.codeInline.fg);\n addVar('code-inline-bg', tokens.content.codeInline.bg);\n addVar('code-block-fg', tokens.content.codeBlock.fg);\n addVar('code-block-bg', tokens.content.codeBlock.bg);\n\n addVar('table-border', tokens.content.table.border);\n addVar('table-stripe', tokens.content.table.stripe);\n addVar('table-thead-bg', tokens.content.table.theadBg);\n if (tokens.content.table.cellBg) {\n addVar('table-cell-bg', tokens.content.table.cellBg);\n }\n if (tokens.content.table.headerFg) {\n addVar('table-header-fg', tokens.content.table.headerFg);\n }\n\n // Typography\n addVar('font-sans', tokens.typography.fonts.sans);\n addVar('font-mono', tokens.typography.fonts.mono);\n\n // Layout tokens (always present from shared tokens)\n if (tokens.spacing) {\n addVar('spacing-xs', tokens.spacing.xs);\n addVar('spacing-sm', tokens.spacing.sm);\n addVar('spacing-md', tokens.spacing.md);\n addVar('spacing-lg', tokens.spacing.lg);\n addVar('spacing-xl', tokens.spacing.xl);\n }\n\n if (tokens.elevation) {\n addVar('elevation-none', tokens.elevation.none);\n addVar('elevation-sm', tokens.elevation.sm);\n addVar('elevation-md', tokens.elevation.md);\n addVar('elevation-lg', tokens.elevation.lg);\n addVar('elevation-xl', tokens.elevation.xl);\n }\n\n if (tokens.animation) {\n addVar('animation-duration-fast', tokens.animation.durationFast);\n addVar('animation-duration-normal', tokens.animation.durationNormal);\n addVar('animation-duration-slow', tokens.animation.durationSlow);\n addVar('animation-easing-default', tokens.animation.easingDefault);\n addVar('animation-easing-emphasized', tokens.animation.easingEmphasized);\n }\n\n if (tokens.opacity) {\n addVar('opacity-disabled', tokens.opacity.disabled.toString());\n addVar('opacity-hover', tokens.opacity.hover.toString());\n addVar('opacity-pressed', tokens.opacity.pressed.toString());\n }\n\n return `[data-theme=\"${themeId}\"] {\\n${lines.join('\\n')}\\n}`;\n}\n"],"names":["themeIds","tokens"],"mappings":";;;;;;AAiBA,MAAM,SAAS;AAIR,MAAM,UAAU,OAAO,OAAO,OAAO,MAAM,EAAE,IAAI,CAAC,WAAW;AAAA,EAChE,IAAI,MAAM;AAAA,EACV,OAAO,MAAM;AAAA,EACb,QAAQ,MAAM;AAAA,EACd,YAAY,MAAM;AAAA,EAClB,GAAI,MAAM,YAAY,UAAa,EAAE,SAAS,MAAM;EACpD,QAAQ,MAAM;AAClB,EAAE;AAIU,MAAC,aAA2B,uBAAO,YAAY,QAAQ,IAAI,CAAC,WAAW,CAAC,OAAO,IAAI,MAAM,CAAC,CAAC;AAIhG,MAAM,WAAyB,uBAAO,YAAY,OAAO,QAAQ,OAAO,QAAQ,EAAE,IAAI,CAAC,CAAC,UAAU,MAAM,MAAM;AAAA,EACjH;AAAA,EACA;AAAA,IACI,IAAI;AAAA,IACJ,MAAM,OAAO;AAAA,IACb,UAAU,OAAO;AAAA,IACjB,SAAS,OAAO,OAAO,IAAI,CAAC,YAAY,WAAW,OAAO,CAAC,EAAE,OAAO,OAAO;AAAA,EACnF;AACA,CAAC,CAAC;AAMK,SAAS,SAAS,IAAI;AACzB,SAAO,WAAW,EAAE;AACxB;AA4BY,MAAC,WAAyB,wBAAQ,IAAI,CAAC,MAAM,EAAE,EAAE;AAIxB,CAAC,GAAG,IAAI,IAAI,QAAQ,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;ACpErC,uBAAO,YAAY,QAAQ,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAGjF,uBAAO,YAAY,QAAQ,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;AAKlE,MAAM,eAAe;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA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|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as themeIds, c as createColorMappings } from "./colors-
|
|
2
|
-
import { g, a } from "./colors-
|
|
1
|
+
import { t as themeIds, c as createColorMappings } from "./colors-DBLa1Wbq.js";
|
|
2
|
+
import { g, a } from "./colors-DBLa1Wbq.js";
|
|
3
3
|
const defaultOptions = {
|
|
4
4
|
themes: [...themeIds],
|
|
5
5
|
darkMode: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B;;;;GAIG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B;;;;GAIG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consolidated theme metadata derived from tokens.json.
|
|
3
|
+
*
|
|
4
|
+
* All display metadata (names, appearances, vendor groups) is computed from
|
|
5
|
+
* the canonical token data at module evaluation time. Consumers should import
|
|
6
|
+
* from here instead of maintaining their own hardcoded copies.
|
|
7
|
+
*/
|
|
8
|
+
/** Default theme applied when no preference is stored. */
|
|
9
|
+
export declare const DEFAULT_THEME: "catppuccin-mocha";
|
|
10
|
+
/** All valid theme IDs (re-export for convenience). */
|
|
11
|
+
export declare const VALID_THEMES: readonly string[];
|
|
12
|
+
/** Set of valid theme IDs for O(1) lookup. */
|
|
13
|
+
export declare const VALID_THEME_SET: ReadonlySet<string>;
|
|
14
|
+
/** Full human-readable label for each theme (e.g., "Catppuccin Mocha"). */
|
|
15
|
+
export declare const THEME_NAMES: Readonly<Record<string, string>>;
|
|
16
|
+
/** Appearance (light/dark) for each theme. */
|
|
17
|
+
export declare const THEME_APPEARANCES: Readonly<Record<string, 'light' | 'dark'>>;
|
|
18
|
+
/**
|
|
19
|
+
* Ordered list of vendor IDs controlling display order in dropdowns.
|
|
20
|
+
* New vendors should be appended here.
|
|
21
|
+
*/
|
|
22
|
+
export declare const VENDOR_ORDER: readonly string[];
|
|
23
|
+
/** A vendor group with its display name and ordered theme IDs. */
|
|
24
|
+
export interface VendorGroup {
|
|
25
|
+
id: string;
|
|
26
|
+
displayName: string;
|
|
27
|
+
themeIds: string[];
|
|
28
|
+
}
|
|
29
|
+
export declare const VENDOR_GROUPS: readonly VendorGroup[];
|
|
30
|
+
/**
|
|
31
|
+
* Strip the vendor prefix from a theme label to produce a short label.
|
|
32
|
+
*
|
|
33
|
+
* For single-flavor vendors (e.g., "Dracula", "Nord") the full label is returned.
|
|
34
|
+
* For multi-flavor vendors the vendor name prefix is stripped:
|
|
35
|
+
* "Catppuccin Mocha" -> "Mocha"
|
|
36
|
+
* "Gruvbox Dark Hard" -> "Dark Hard"
|
|
37
|
+
*
|
|
38
|
+
* @param themeId - A valid theme ID
|
|
39
|
+
* @returns The short display label, or the full label if the theme is not found
|
|
40
|
+
*/
|
|
41
|
+
export declare function getShortLabel(themeId: string): string;
|
|
42
|
+
/** Pre-computed short labels for all themes. */
|
|
43
|
+
export declare const THEME_SHORT_LABELS: Readonly<Record<string, string>>;
|
|
44
|
+
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/themes/metadata.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAKH,0DAA0D;AAC1D,eAAO,MAAM,aAAa,EAAG,kBAA2B,CAAC;AAEzD,uDAAuD;AACvD,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAAa,CAAC;AAExD,8CAA8C;AAC9C,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAAmC,CAAC;AAEpF,2EAA2E;AAC3E,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExD,CAAC;AAEF,8CAA8C;AAC9C,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,CACG,CAAC;AAE7E;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAUzC,CAAC;AAEF,kEAAkE;AAClE,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAgBD,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAW9C,CAAC;AAUH;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAiCrD;AAED,gDAAgD;AAChD,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CACmB,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
/**
|
|
3
|
+
* Consolidated theme metadata derived from tokens.json.
|
|
4
|
+
*
|
|
5
|
+
* All display metadata (names, appearances, vendor groups) is computed from
|
|
6
|
+
* the canonical token data at module evaluation time. Consumers should import
|
|
7
|
+
* from here instead of maintaining their own hardcoded copies.
|
|
8
|
+
*/
|
|
9
|
+
import { flavors, themeIds, packages } from '../tokens/index.js';
|
|
10
|
+
/** Default theme applied when no preference is stored. */
|
|
11
|
+
export const DEFAULT_THEME = 'catppuccin-mocha';
|
|
12
|
+
/** All valid theme IDs (re-export for convenience). */
|
|
13
|
+
export const VALID_THEMES = themeIds;
|
|
14
|
+
/** Set of valid theme IDs for O(1) lookup. */
|
|
15
|
+
export const VALID_THEME_SET = /*#__PURE__*/ new Set(themeIds);
|
|
16
|
+
/** Full human-readable label for each theme (e.g., "Catppuccin Mocha"). */
|
|
17
|
+
export const THEME_NAMES = /*#__PURE__*/ Object.fromEntries(flavors.map((f) => [f.id, f.label]));
|
|
18
|
+
/** Appearance (light/dark) for each theme. */
|
|
19
|
+
export const THEME_APPEARANCES =
|
|
20
|
+
/*#__PURE__*/ Object.fromEntries(flavors.map((f) => [f.id, f.appearance]));
|
|
21
|
+
/**
|
|
22
|
+
* Ordered list of vendor IDs controlling display order in dropdowns.
|
|
23
|
+
* New vendors should be appended here.
|
|
24
|
+
*/
|
|
25
|
+
export const VENDOR_ORDER = [
|
|
26
|
+
'catppuccin',
|
|
27
|
+
'dracula',
|
|
28
|
+
'gruvbox',
|
|
29
|
+
'github',
|
|
30
|
+
'bulma',
|
|
31
|
+
'nord',
|
|
32
|
+
'solarized',
|
|
33
|
+
'rose-pine',
|
|
34
|
+
'tokyo-night',
|
|
35
|
+
];
|
|
36
|
+
/**
|
|
37
|
+
* Ordered array of vendor groups derived from packages + VENDOR_ORDER.
|
|
38
|
+
* The "(synced)" suffix is stripped from display names.
|
|
39
|
+
*/
|
|
40
|
+
// Dev-time validation: warn if packages has vendors not listed in VENDOR_ORDER
|
|
41
|
+
const _packageKeys = Object.keys(packages);
|
|
42
|
+
const _missingFromOrder = _packageKeys.filter((id) => !VENDOR_ORDER.includes(id));
|
|
43
|
+
if (_missingFromOrder.length > 0) {
|
|
44
|
+
console.warn(`[metadata] VENDOR_ORDER is missing vendor IDs present in packages: ${_missingFromOrder.join(', ')}. ` +
|
|
45
|
+
'Append them to VENDOR_ORDER so their themes are included in VENDOR_GROUPS.');
|
|
46
|
+
}
|
|
47
|
+
export const VENDOR_GROUPS = /*#__PURE__*/ VENDOR_ORDER.filter((id) => id in packages).map((id) => {
|
|
48
|
+
const pkg = packages[id];
|
|
49
|
+
return {
|
|
50
|
+
id,
|
|
51
|
+
displayName: pkg.name.replace(/\s*\(synced\)\s*/i, ''),
|
|
52
|
+
themeIds: pkg.flavors
|
|
53
|
+
.filter((f) => Boolean(f))
|
|
54
|
+
.map((f) => f.id),
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
/** O(1) flavor lookup by ID, built once at module evaluation time. */
|
|
58
|
+
const flavorById = /*#__PURE__*/ new Map(flavors.map((f) => [f.id, f]));
|
|
59
|
+
/** Cache for computed short labels. */
|
|
60
|
+
const shortLabelCache = new Map();
|
|
61
|
+
/**
|
|
62
|
+
* Strip the vendor prefix from a theme label to produce a short label.
|
|
63
|
+
*
|
|
64
|
+
* For single-flavor vendors (e.g., "Dracula", "Nord") the full label is returned.
|
|
65
|
+
* For multi-flavor vendors the vendor name prefix is stripped:
|
|
66
|
+
* "Catppuccin Mocha" -> "Mocha"
|
|
67
|
+
* "Gruvbox Dark Hard" -> "Dark Hard"
|
|
68
|
+
*
|
|
69
|
+
* @param themeId - A valid theme ID
|
|
70
|
+
* @returns The short display label, or the full label if the theme is not found
|
|
71
|
+
*/
|
|
72
|
+
export function getShortLabel(themeId) {
|
|
73
|
+
const cached = shortLabelCache.get(themeId);
|
|
74
|
+
if (cached !== undefined)
|
|
75
|
+
return cached;
|
|
76
|
+
const flavor = flavorById.get(themeId);
|
|
77
|
+
if (!flavor)
|
|
78
|
+
return themeId;
|
|
79
|
+
const vendorPkg = packages[flavor.vendor];
|
|
80
|
+
if (!vendorPkg) {
|
|
81
|
+
shortLabelCache.set(themeId, flavor.label);
|
|
82
|
+
return flavor.label;
|
|
83
|
+
}
|
|
84
|
+
// Single-flavor vendors keep their full label
|
|
85
|
+
if (vendorPkg.flavors.length === 1) {
|
|
86
|
+
shortLabelCache.set(themeId, flavor.label);
|
|
87
|
+
return flavor.label;
|
|
88
|
+
}
|
|
89
|
+
// Strip vendor display name prefix (case-insensitive, handles accented chars)
|
|
90
|
+
const displayName = vendorPkg.name.replace(/\s*\(synced\)\s*/i, '');
|
|
91
|
+
const label = flavor.label;
|
|
92
|
+
let result;
|
|
93
|
+
if (label.toLowerCase().startsWith(displayName.toLowerCase())) {
|
|
94
|
+
const stripped = label.slice(displayName.length).trim();
|
|
95
|
+
result = stripped || label;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
result = label;
|
|
99
|
+
}
|
|
100
|
+
shortLabelCache.set(themeId, result);
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
/** Pre-computed short labels for all themes. */
|
|
104
|
+
export const THEME_SHORT_LABELS =
|
|
105
|
+
/*#__PURE__*/ Object.fromEntries(flavors.map((f) => [f.id, getShortLabel(f.id)]));
|
|
106
|
+
//# sourceMappingURL=metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/themes/metadata.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B;;;;;;GAMG;AAGH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEjE,0DAA0D;AAC1D,MAAM,CAAC,MAAM,aAAa,GAAG,kBAA2B,CAAC;AAEzD,uDAAuD;AACvD,MAAM,CAAC,MAAM,YAAY,GAAsB,QAAQ,CAAC;AAExD,8CAA8C;AAC9C,MAAM,CAAC,MAAM,eAAe,GAAwB,aAAa,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,CA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M,CAAC,KAAK,CAAC,CAAC;QAC3C,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,8EAA8E;IAC9E,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;IACpE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAE3B,IAAI,MAAc,CAAC;IACnB,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;QAC9D,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QACxD,MAAM,GAAG,QAAQ,IAAI,KAAK,CAAC;IAC7B,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,KAAK,CAAC;IACjB,CAAC;IAED,eAAe,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,gDAAgD;AAChD,MAAM,CAAC,MAAM,kBAAkB;AAC7B,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://design-tokens.org/schema.json",
|
|
3
3
|
"$description": "Turbo Themes - Flat tokens for 24 themes",
|
|
4
|
-
"$version": "0.
|
|
5
|
-
"$generated": "2026-02-07T10:
|
|
4
|
+
"$version": "0.18.0",
|
|
5
|
+
"$generated": "2026-02-07T10:42:12.509Z",
|
|
6
6
|
"meta": {
|
|
7
7
|
"themeIds": [
|
|
8
8
|
"bulma-dark",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/themes/types.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/themes/types.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,UAAU,E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AAE,WAAW,CAAC;IACrB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB"}
|
|
@@ -141,6 +141,25 @@ export declare function generateSyntaxVarsFromTokens(tokens: ThemeTokens): strin
|
|
|
141
141
|
*/
|
|
142
142
|
export declare function generateThemeCss(flavor: ThemeFlavor): string;
|
|
143
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Generates a CSS file containing only `[data-theme]` selectors for all themes.
|
|
146
|
+
*
|
|
147
|
+
* Unlike `generateCombinedCss()`, this does NOT include a `:root` block.
|
|
148
|
+
* Designed for CSS-only theme switching where a blocking script sets
|
|
149
|
+
* `data-theme` on `<html>` — no stylesheet swapping required, eliminating FOUC.
|
|
150
|
+
*
|
|
151
|
+
* @param flavors - Array of all theme flavors
|
|
152
|
+
* @returns CSS string with all `[data-theme]` selectors
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```ts
|
|
156
|
+
* const css = generateThemesOnlyCss(flavors);
|
|
157
|
+
* // [data-theme="catppuccin-mocha"] { ... }
|
|
158
|
+
* // [data-theme="dracula"] { ... }
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
export declare function generateThemesOnlyCss(flavors: readonly ThemeFlavor[]): string;
|
|
162
|
+
|
|
144
163
|
export declare interface ThemeFlavor {
|
|
145
164
|
id: string;
|
|
146
165
|
label: string;
|
|
@@ -170,9 +189,6 @@ export declare interface ThemeTokens {
|
|
|
170
189
|
success: string;
|
|
171
190
|
warning: string;
|
|
172
191
|
danger: string;
|
|
173
|
-
infoText?: string;
|
|
174
|
-
successText?: string;
|
|
175
|
-
warningText?: string;
|
|
176
192
|
dangerText?: string;
|
|
177
193
|
};
|
|
178
194
|
border: {
|
|
@@ -530,6 +530,41 @@ function generateCombinedCss(flavors, defaultFlavorId = "catppuccin-mocha") {
|
|
|
530
530
|
${coreCss}
|
|
531
531
|
${themeCss}`;
|
|
532
532
|
}
|
|
533
|
+
function generateThemesOnlyCss(flavors) {
|
|
534
|
+
if (!flavors || flavors.length === 0) {
|
|
535
|
+
throw new Error("No flavors provided");
|
|
536
|
+
}
|
|
537
|
+
const allImports = [];
|
|
538
|
+
const themeBlocks = [];
|
|
539
|
+
for (const flavor of flavors) {
|
|
540
|
+
const css = generateThemeCss(flavor);
|
|
541
|
+
const lines = css.split("\n");
|
|
542
|
+
const imports = [];
|
|
543
|
+
const rest = [];
|
|
544
|
+
for (const line of lines) {
|
|
545
|
+
if (line.startsWith("@import ")) {
|
|
546
|
+
imports.push(line);
|
|
547
|
+
} else {
|
|
548
|
+
rest.push(line);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
for (const imp of imports) {
|
|
552
|
+
if (!allImports.includes(imp)) {
|
|
553
|
+
allImports.push(imp);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
themeBlocks.push(rest.join("\n"));
|
|
557
|
+
}
|
|
558
|
+
const header = `/* Turbo Themes - All Theme Selectors (no :root defaults) */
|
|
559
|
+
/* Load alongside turbo-core.css + turbo-base.css for FOUC-free theme switching */
|
|
560
|
+
/* Generated automatically - do not edit */`;
|
|
561
|
+
const importBlock = allImports.length > 0 ? `${allImports.join("\n")}
|
|
562
|
+
|
|
563
|
+
` : "";
|
|
564
|
+
return `${importBlock}${header}
|
|
565
|
+
|
|
566
|
+
${themeBlocks.join("\n")}`;
|
|
567
|
+
}
|
|
533
568
|
const CSS_RESET = `/* Turbo Themes - Minimal Reset */
|
|
534
569
|
*,
|
|
535
570
|
*::before,
|
|
@@ -797,6 +832,7 @@ export {
|
|
|
797
832
|
generateSyntaxBaseCss,
|
|
798
833
|
generateSyntaxCss,
|
|
799
834
|
generateSyntaxVarsFromTokens,
|
|
800
|
-
generateThemeCss
|
|
835
|
+
generateThemeCss,
|
|
836
|
+
generateThemesOnlyCss
|
|
801
837
|
};
|
|
802
838
|
//# sourceMappingURL=index.js.map
|