@symblight/md-colors 0.1.0 → 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/README.md +72 -25
- package/dist/cli.js +157 -0
- package/dist/client.cjs +6492 -0
- package/dist/client.cjs.map +7 -0
- package/dist/client.esm.js +98 -673
- package/dist/client.esm.js.map +4 -4
- package/dist/client.js +3 -3
- package/dist/client.js.map +4 -4
- package/dist/index.js +108 -20
- package/dist/index.js.map +3 -3
- package/package.json +9 -4
package/dist/index.js
CHANGED
|
@@ -1,22 +1,81 @@
|
|
|
1
1
|
// tokens.mjs
|
|
2
2
|
import {
|
|
3
3
|
argbFromHex,
|
|
4
|
-
themeFromSourceColor,
|
|
5
4
|
hexFromArgb,
|
|
6
5
|
MaterialDynamicColors,
|
|
7
|
-
|
|
6
|
+
SchemeTonalSpot,
|
|
8
7
|
Hct
|
|
9
8
|
} from "@material/material-color-utilities";
|
|
10
9
|
import { converter, formatCss } from "culori";
|
|
11
10
|
var oklch = converter("oklch");
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
var DEFAULT_SOURCE_COLOR = "#1D5D78";
|
|
12
|
+
var HEX_RE = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
13
|
+
var COLOR_ROLES = (
|
|
14
|
+
/** @type {const} */
|
|
15
|
+
[
|
|
16
|
+
"primary",
|
|
17
|
+
"onPrimary",
|
|
18
|
+
"primaryContainer",
|
|
19
|
+
"onPrimaryContainer",
|
|
20
|
+
"inversePrimary",
|
|
21
|
+
"primaryFixed",
|
|
22
|
+
"primaryFixedDim",
|
|
23
|
+
"onPrimaryFixed",
|
|
24
|
+
"onPrimaryFixedVariant",
|
|
25
|
+
"secondary",
|
|
26
|
+
"onSecondary",
|
|
27
|
+
"secondaryContainer",
|
|
28
|
+
"onSecondaryContainer",
|
|
29
|
+
"secondaryFixed",
|
|
30
|
+
"secondaryFixedDim",
|
|
31
|
+
"onSecondaryFixed",
|
|
32
|
+
"onSecondaryFixedVariant",
|
|
33
|
+
"tertiary",
|
|
34
|
+
"onTertiary",
|
|
35
|
+
"tertiaryContainer",
|
|
36
|
+
"onTertiaryContainer",
|
|
37
|
+
"tertiaryFixed",
|
|
38
|
+
"tertiaryFixedDim",
|
|
39
|
+
"onTertiaryFixed",
|
|
40
|
+
"onTertiaryFixedVariant",
|
|
41
|
+
"error",
|
|
42
|
+
"onError",
|
|
43
|
+
"errorContainer",
|
|
44
|
+
"onErrorContainer",
|
|
45
|
+
"surface",
|
|
46
|
+
"onSurface",
|
|
47
|
+
"surfaceVariant",
|
|
48
|
+
"onSurfaceVariant",
|
|
49
|
+
"surfaceDim",
|
|
50
|
+
"surfaceBright",
|
|
51
|
+
"surfaceContainerLowest",
|
|
52
|
+
"surfaceContainerLow",
|
|
53
|
+
"surfaceContainer",
|
|
54
|
+
"surfaceContainerHigh",
|
|
55
|
+
"surfaceContainerHighest",
|
|
56
|
+
"surfaceTint",
|
|
57
|
+
"inverseSurface",
|
|
58
|
+
"inverseOnSurface",
|
|
59
|
+
"outline",
|
|
60
|
+
"outlineVariant",
|
|
61
|
+
"shadow",
|
|
62
|
+
"scrim",
|
|
63
|
+
"background",
|
|
64
|
+
"onBackground"
|
|
65
|
+
]
|
|
66
|
+
);
|
|
67
|
+
function resolveConfig({ sourceColor = DEFAULT_SOURCE_COLOR, scheme = "light" } = {}) {
|
|
68
|
+
if (typeof sourceColor !== "string" || !HEX_RE.test(sourceColor)) {
|
|
69
|
+
throw new TypeError(`sourceColor must be a hex color like "#6750A4", got ${JSON.stringify(sourceColor)}`);
|
|
70
|
+
}
|
|
71
|
+
if (scheme !== "light" && scheme !== "dark") {
|
|
72
|
+
throw new TypeError(`scheme must be "light" or "dark", got ${JSON.stringify(scheme)}`);
|
|
73
|
+
}
|
|
74
|
+
return { sourceColor, scheme: (
|
|
75
|
+
/** @type {ColorScheme} */
|
|
76
|
+
scheme
|
|
77
|
+
) };
|
|
78
|
+
}
|
|
20
79
|
function setSchemeProperties(scheme, suffix = "") {
|
|
21
80
|
let result = {};
|
|
22
81
|
for (const [key, value] of Object.entries(scheme)) {
|
|
@@ -29,22 +88,51 @@ function setSchemeProperties(scheme, suffix = "") {
|
|
|
29
88
|
}
|
|
30
89
|
return result;
|
|
31
90
|
}
|
|
32
|
-
function generateTokens(config = {
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
Hct.fromInt(argbFromHex(
|
|
36
|
-
|
|
91
|
+
function generateTokens(config = {}) {
|
|
92
|
+
const { sourceColor, scheme } = resolveConfig(config);
|
|
93
|
+
const dynamicScheme = new SchemeTonalSpot(
|
|
94
|
+
Hct.fromInt(argbFromHex(sourceColor)),
|
|
95
|
+
scheme === "dark",
|
|
37
96
|
0
|
|
38
97
|
);
|
|
39
98
|
let palette = {};
|
|
40
|
-
for (const
|
|
41
|
-
palette[
|
|
99
|
+
for (const role of COLOR_ROLES) {
|
|
100
|
+
palette[role] = MaterialDynamicColors[role].getArgb(dynamicScheme);
|
|
42
101
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
102
|
+
return setSchemeProperties(palette);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// create-theme-file.mjs
|
|
106
|
+
import path from "node:path";
|
|
107
|
+
import fs from "node:fs/promises";
|
|
108
|
+
import { fileURLToPath } from "node:url";
|
|
109
|
+
function template(variables) {
|
|
110
|
+
return `:root {
|
|
111
|
+
${variables}
|
|
112
|
+
}`;
|
|
113
|
+
}
|
|
114
|
+
function normalizeCSSVariablesContent(variables = {}) {
|
|
115
|
+
let str = "";
|
|
116
|
+
for (const cssVar in variables) {
|
|
117
|
+
str += `${cssVar}: ${variables[cssVar]};
|
|
118
|
+
`;
|
|
119
|
+
}
|
|
120
|
+
return str;
|
|
121
|
+
}
|
|
122
|
+
async function generateCSSFile(config = {}) {
|
|
123
|
+
const { output, ...tokenConfig } = config;
|
|
124
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
125
|
+
const __dirname = path.dirname(__filename);
|
|
126
|
+
const outputPath = output ? path.resolve(output) : path.join(__dirname, "colors.css");
|
|
127
|
+
const tokens = generateTokens(tokenConfig);
|
|
128
|
+
const stringTokens = normalizeCSSVariablesContent(tokens);
|
|
129
|
+
const themeBody = template(stringTokens);
|
|
130
|
+
await fs.writeFile(outputPath, themeBody);
|
|
131
|
+
return outputPath;
|
|
46
132
|
}
|
|
47
133
|
export {
|
|
134
|
+
DEFAULT_SOURCE_COLOR,
|
|
135
|
+
generateCSSFile,
|
|
48
136
|
generateTokens,
|
|
49
137
|
setSchemeProperties
|
|
50
138
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../tokens.mjs"],
|
|
4
|
-
"sourcesContent": ["import {\n argbFromHex,\n
|
|
5
|
-
"mappings": ";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,
|
|
3
|
+
"sources": ["../tokens.mjs", "../create-theme-file.mjs"],
|
|
4
|
+
"sourcesContent": ["import {\n argbFromHex,\n hexFromArgb,\n MaterialDynamicColors,\n SchemeTonalSpot,\n Hct,\n} from \"@material/material-color-utilities\";\nimport { converter, formatCss } from \"culori\";\n\n/**\n * Color scheme variant.\n * @typedef {\"light\" | \"dark\"} ColorScheme\n */\n\n/**\n * Options for {@link generateTokens}.\n * @typedef {object} TokenConfig\n * @property {string} sourceColor - Seed color as a hex string (e.g. `\"#6750A4\"`).\n * @property {ColorScheme} scheme - Color scheme variant.\n */\n\n/**\n * Map of `--md-sys-color-*` CSS custom property names to oklch color strings.\n * @typedef {Record<string, string>} ColorTokens\n */\n\n/**\n * Converts an sRGB hex string to a culori oklch color object.\n * @type {(color: string) => { mode: \"oklch\", l: number, c: number, h?: number, alpha?: number } | undefined}\n */\nlet oklch = converter(\"oklch\");\n\n/** Seed color used when none is given. */\nexport const DEFAULT_SOURCE_COLOR = \"#1D5D78\";\n\n/** Matches `#rgb` and `#rrggbb` hex colors. */\nconst HEX_RE = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;\n\n/**\n * MD3 color roles emitted as tokens, in output order. Names match the static\n * members of {@link MaterialDynamicColors} and are kebab-cased into\n * `--md-sys-color-*` names. `background`, `onBackground` and `surfaceVariant`\n * are deprecated in M3 but kept for compatibility.\n *\n * @see https://m3.material.io/styles/color/roles\n */\nconst COLOR_ROLES = /** @type {const} */ ([\n \"primary\",\n \"onPrimary\",\n \"primaryContainer\",\n \"onPrimaryContainer\",\n \"inversePrimary\",\n \"primaryFixed\",\n \"primaryFixedDim\",\n \"onPrimaryFixed\",\n \"onPrimaryFixedVariant\",\n \"secondary\",\n \"onSecondary\",\n \"secondaryContainer\",\n \"onSecondaryContainer\",\n \"secondaryFixed\",\n \"secondaryFixedDim\",\n \"onSecondaryFixed\",\n \"onSecondaryFixedVariant\",\n \"tertiary\",\n \"onTertiary\",\n \"tertiaryContainer\",\n \"onTertiaryContainer\",\n \"tertiaryFixed\",\n \"tertiaryFixedDim\",\n \"onTertiaryFixed\",\n \"onTertiaryFixedVariant\",\n \"error\",\n \"onError\",\n \"errorContainer\",\n \"onErrorContainer\",\n \"surface\",\n \"onSurface\",\n \"surfaceVariant\",\n \"onSurfaceVariant\",\n \"surfaceDim\",\n \"surfaceBright\",\n \"surfaceContainerLowest\",\n \"surfaceContainerLow\",\n \"surfaceContainer\",\n \"surfaceContainerHigh\",\n \"surfaceContainerHighest\",\n \"surfaceTint\",\n \"inverseSurface\",\n \"inverseOnSurface\",\n \"outline\",\n \"outlineVariant\",\n \"shadow\",\n \"scrim\",\n \"background\",\n \"onBackground\",\n]);\n\n/**\n * Validates and normalizes a partial token config, filling in defaults per\n * field. Accepts unchecked strings (e.g. CLI input).\n *\n * @param {{ sourceColor?: string, scheme?: string }} [config]\n * @returns {TokenConfig}\n * @throws {TypeError} If `sourceColor` is not a hex color or `scheme` is not `\"light\"` / `\"dark\"`.\n */\nexport function resolveConfig({ sourceColor = DEFAULT_SOURCE_COLOR, scheme = \"light\" } = {}) {\n if (typeof sourceColor !== \"string\" || !HEX_RE.test(sourceColor)) {\n throw new TypeError(`sourceColor must be a hex color like \"#6750A4\", got ${JSON.stringify(sourceColor)}`);\n }\n if (scheme !== \"light\" && scheme !== \"dark\") {\n throw new TypeError(`scheme must be \"light\" or \"dark\", got ${JSON.stringify(scheme)}`);\n }\n return { sourceColor, scheme: /** @type {ColorScheme} */ (scheme) };\n}\n\n/**\n * Converts a Material color scheme object into a map of CSS custom property\n * names to oklch color values.\n *\n * Each camelCase key is converted to kebab-case and prefixed with\n * `--md-sys-color-`. An optional suffix can be appended to the variable name.\n *\n * @param {Record<string, number>} scheme - Map of token names to ARGB integers.\n * @param {string} [suffix=\"\"] - Optional suffix appended to every variable name.\n * @returns {ColorTokens} Map of CSS variable names to oklch strings.\n *\n * @example\n * const vars = setSchemeProperties({ primary: 0xff1d5d78 });\n * // { \"--md-sys-color-primary\": \"oklch(\u2026)\" }\n */\nexport function setSchemeProperties(scheme, suffix = \"\") {\n /** @type {ColorTokens} */\n let result = {};\n for (const [key, value] of Object.entries(scheme)) {\n const token = key.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n const color = hexFromArgb(value);\n const converted = oklch(color);\n const name = formatCss(converted);\n const variableName = `--md-sys-color-${token}${suffix}`;\n result[variableName] = name;\n }\n\n return result;\n}\n\n/**\n * Generates the full set of Material Design 3 color tokens for a given source\n * color and color scheme.\n *\n * Every role is resolved from a single tonal-spot {@link SchemeTonalSpot}\n * (the M3 default variant), so surface tones keep their spec ordering. All\n * color values are expressed as oklch CSS strings so they can be used directly\n * in `var(--md-sys-color-*)` declarations.\n *\n * @param {Partial<TokenConfig>} [config] - Missing fields default to\n * `sourceColor: \"#1D5D78\"` and `scheme: \"light\"`.\n * @returns {ColorTokens} Map of CSS variable names to oklch color strings.\n * @throws {TypeError} If `sourceColor` is not a hex color or `scheme` is not `\"light\"` / `\"dark\"`.\n *\n * @example\n * const tokens = generateTokens({ sourceColor: \"#6750A4\", scheme: \"dark\" });\n * // { \"--md-sys-color-primary\": \"oklch(\u2026)\", \u2026 }\n */\nexport function generateTokens(config = {}) {\n const { sourceColor, scheme } = resolveConfig(config);\n const dynamicScheme = new SchemeTonalSpot(\n Hct.fromInt(argbFromHex(sourceColor)),\n scheme === \"dark\",\n 0\n );\n\n /** @type {Record<string, number>} */\n let palette = {};\n for (const role of COLOR_ROLES) {\n palette[role] = MaterialDynamicColors[role].getArgb(dynamicScheme);\n }\n\n return setSchemeProperties(palette);\n}\n", "import path from \"node:path\";\nimport fs from \"node:fs/promises\";\nimport { fileURLToPath } from \"node:url\";\n\nimport * as tokensUtils from \"./tokens.mjs\";\n\n/** @typedef {import(\"./tokens.mjs\").ColorScheme} ColorScheme */\n/** @typedef {import(\"./tokens.mjs\").ColorTokens} ColorTokens */\n\n/**\n * Options for {@link generateCSSFile}.\n * @typedef {object} CSSFileConfig\n * @property {string} [sourceColor=\"#1D5D78\"] - Seed color as a hex string.\n * @property {ColorScheme} [scheme=\"light\"] - Color scheme variant.\n * @property {string} [output] - Absolute or relative output path for the CSS file.\n * Relative paths resolve against `process.cwd()`. Defaults to `colors.css`\n * next to this module.\n */\n\n/**\n * Wraps serialized declarations in a `:root` rule.\n *\n * @param {string} variables - Declarations produced by {@link normalizeCSSVariablesContent}.\n * @returns {string} A complete `:root { \u2026 }` rule.\n */\nfunction template(variables) {\n return `:root {\n ${variables}\n }`;\n}\n\n/**\n * Serializes a token map into newline-separated CSS declarations.\n *\n * @param {ColorTokens} [variables={}] - Map of CSS variable names to values.\n * @returns {string} One `name: value;` declaration per line.\n *\n * @example\n * normalizeCSSVariablesContent({ \"--md-sys-color-primary\": \"oklch(\u2026)\" });\n * // \"--md-sys-color-primary: oklch(\u2026);\\n\"\n */\nfunction normalizeCSSVariablesContent(variables = {}) {\n let str = \"\";\n for (const cssVar in variables) {\n str += `${cssVar}: ${variables[cssVar]};\\n`;\n }\n return str;\n}\n\n/**\n * Generates a `colors.css` file containing `:root`-scoped MD3 color tokens\n * derived from the given source color and scheme.\n *\n * @param {CSSFileConfig} [config]\n * @returns {Promise<string>} Resolves with the absolute path of the written file.\n * @throws {TypeError} If `sourceColor` is not a hex color or `scheme` is not `\"light\"` / `\"dark\"`.\n * Rejects if the file cannot be written.\n *\n * @example\n * import { generateCSSFile } from \"@symblight/md-colors\";\n * await generateCSSFile({ sourceColor: \"#6750A4\", scheme: \"dark\", output: \"./theme/colors.css\" });\n */\nexport async function generateCSSFile(config = {}) {\n const { output, ...tokenConfig } = config;\n\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = path.dirname(__filename);\n const outputPath = output\n ? path.resolve(output)\n : path.join(__dirname, \"colors.css\");\n\n const tokens = tokensUtils.generateTokens(tokenConfig);\n const stringTokens = normalizeCSSVariablesContent(tokens);\n const themeBody = template(stringTokens);\n\n await fs.writeFile(outputPath, themeBody);\n return outputPath;\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symblight/md-colors",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Material Design 3 color token generator — CSS custom property output in oklch format",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
|
+
"unpkg": "./dist/client.js",
|
|
9
|
+
"bin": {
|
|
10
|
+
"md-colors": "./dist/cli.js"
|
|
11
|
+
},
|
|
8
12
|
"exports": {
|
|
9
13
|
".": {
|
|
10
14
|
"import": "./dist/index.js"
|
|
11
15
|
},
|
|
12
16
|
"./client": {
|
|
13
17
|
"import": "./dist/client.esm.js",
|
|
14
|
-
"
|
|
15
|
-
}
|
|
18
|
+
"require": "./dist/client.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./client.iife": "./dist/client.js"
|
|
16
21
|
},
|
|
17
22
|
"files": [
|
|
18
23
|
"dist",
|
|
@@ -21,7 +26,7 @@
|
|
|
21
26
|
],
|
|
22
27
|
"scripts": {
|
|
23
28
|
"build": "node build.mjs",
|
|
24
|
-
"generate-theme": "node
|
|
29
|
+
"generate-theme": "node cli.mjs",
|
|
25
30
|
"prepublishOnly": "npm run build",
|
|
26
31
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
|
27
32
|
},
|