@lit-material/tokens 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 bohdaq
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 ADDED
@@ -0,0 +1,28 @@
1
+ # @lit-material/tokens
2
+
3
+ Material Design 3 design tokens (color, shape, type scale, elevation, state-layer
4
+ opacity, motion) as plain CSS custom properties, for
5
+ [lit-material](https://github.com/bohdaq/lit-material) components.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ npm install @lit-material/tokens
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ Link the stylesheet once at the document root — CSS custom properties inherit through
16
+ shadow DOM boundaries, so every `lit-material` component picks it up automatically:
17
+
18
+ ```html
19
+ <link rel="stylesheet" href="node_modules/@lit-material/tokens/css/index.css" />
20
+ ```
21
+
22
+ Dark mode follows `prefers-color-scheme` automatically (via CSS `light-dark()`). To force
23
+ a scheme regardless of OS preference, set `color-scheme="light"` or `color-scheme="dark"`
24
+ on `<html>` or any ancestor element.
25
+
26
+ ## License
27
+
28
+ MIT
@@ -0,0 +1,13 @@
1
+ /**
2
+ * `@lit-material/tokens` ships its tokens as plain CSS custom properties
3
+ * (see `./css/index.css`), meant to be linked once at the document root.
4
+ * This module exists for tooling that wants typed references to token names
5
+ * rather than importing the CSS directly.
6
+ */
7
+ export declare const colorTokens: readonly ["--md-sys-color-primary", "--md-sys-color-on-primary", "--md-sys-color-primary-container", "--md-sys-color-on-primary-container", "--md-sys-color-secondary", "--md-sys-color-on-secondary", "--md-sys-color-secondary-container", "--md-sys-color-on-secondary-container", "--md-sys-color-tertiary", "--md-sys-color-on-tertiary", "--md-sys-color-tertiary-container", "--md-sys-color-on-tertiary-container", "--md-sys-color-error", "--md-sys-color-on-error", "--md-sys-color-error-container", "--md-sys-color-on-error-container", "--md-sys-color-background", "--md-sys-color-on-background", "--md-sys-color-surface", "--md-sys-color-on-surface", "--md-sys-color-surface-variant", "--md-sys-color-on-surface-variant", "--md-sys-color-surface-container-lowest", "--md-sys-color-surface-container-low", "--md-sys-color-surface-container", "--md-sys-color-surface-container-high", "--md-sys-color-surface-container-highest", "--md-sys-color-outline", "--md-sys-color-outline-variant", "--md-sys-color-shadow", "--md-sys-color-scrim", "--md-sys-color-inverse-surface", "--md-sys-color-inverse-on-surface", "--md-sys-color-inverse-primary"];
8
+ export declare const shapeTokens: readonly ["--md-sys-shape-corner-none", "--md-sys-shape-corner-extra-small", "--md-sys-shape-corner-small", "--md-sys-shape-corner-medium", "--md-sys-shape-corner-large", "--md-sys-shape-corner-extra-large", "--md-sys-shape-corner-full"];
9
+ export declare const stateTokens: readonly ["--md-sys-state-hover-state-layer-opacity", "--md-sys-state-focus-state-layer-opacity", "--md-sys-state-pressed-state-layer-opacity", "--md-sys-state-dragged-state-layer-opacity", "--md-sys-state-disabled-container-opacity", "--md-sys-state-disabled-content-opacity"];
10
+ export type ColorToken = (typeof colorTokens)[number];
11
+ export type ShapeToken = (typeof shapeTokens)[number];
12
+ export type StateToken = (typeof stateTokens)[number];
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,WAAW,onCAmCd,CAAC;AAEX,eAAO,MAAM,WAAW,+OAQd,CAAC;AAEX,eAAO,MAAM,WAAW,uRAOd,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AACtD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AACtD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,60 @@
1
+ /**
2
+ * `@lit-material/tokens` ships its tokens as plain CSS custom properties
3
+ * (see `./css/index.css`), meant to be linked once at the document root.
4
+ * This module exists for tooling that wants typed references to token names
5
+ * rather than importing the CSS directly.
6
+ */
7
+ export const colorTokens = [
8
+ "--md-sys-color-primary",
9
+ "--md-sys-color-on-primary",
10
+ "--md-sys-color-primary-container",
11
+ "--md-sys-color-on-primary-container",
12
+ "--md-sys-color-secondary",
13
+ "--md-sys-color-on-secondary",
14
+ "--md-sys-color-secondary-container",
15
+ "--md-sys-color-on-secondary-container",
16
+ "--md-sys-color-tertiary",
17
+ "--md-sys-color-on-tertiary",
18
+ "--md-sys-color-tertiary-container",
19
+ "--md-sys-color-on-tertiary-container",
20
+ "--md-sys-color-error",
21
+ "--md-sys-color-on-error",
22
+ "--md-sys-color-error-container",
23
+ "--md-sys-color-on-error-container",
24
+ "--md-sys-color-background",
25
+ "--md-sys-color-on-background",
26
+ "--md-sys-color-surface",
27
+ "--md-sys-color-on-surface",
28
+ "--md-sys-color-surface-variant",
29
+ "--md-sys-color-on-surface-variant",
30
+ "--md-sys-color-surface-container-lowest",
31
+ "--md-sys-color-surface-container-low",
32
+ "--md-sys-color-surface-container",
33
+ "--md-sys-color-surface-container-high",
34
+ "--md-sys-color-surface-container-highest",
35
+ "--md-sys-color-outline",
36
+ "--md-sys-color-outline-variant",
37
+ "--md-sys-color-shadow",
38
+ "--md-sys-color-scrim",
39
+ "--md-sys-color-inverse-surface",
40
+ "--md-sys-color-inverse-on-surface",
41
+ "--md-sys-color-inverse-primary",
42
+ ];
43
+ export const shapeTokens = [
44
+ "--md-sys-shape-corner-none",
45
+ "--md-sys-shape-corner-extra-small",
46
+ "--md-sys-shape-corner-small",
47
+ "--md-sys-shape-corner-medium",
48
+ "--md-sys-shape-corner-large",
49
+ "--md-sys-shape-corner-extra-large",
50
+ "--md-sys-shape-corner-full",
51
+ ];
52
+ export const stateTokens = [
53
+ "--md-sys-state-hover-state-layer-opacity",
54
+ "--md-sys-state-focus-state-layer-opacity",
55
+ "--md-sys-state-pressed-state-layer-opacity",
56
+ "--md-sys-state-dragged-state-layer-opacity",
57
+ "--md-sys-state-disabled-container-opacity",
58
+ "--md-sys-state-disabled-content-opacity",
59
+ ];
60
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,wBAAwB;IACxB,2BAA2B;IAC3B,kCAAkC;IAClC,qCAAqC;IACrC,0BAA0B;IAC1B,6BAA6B;IAC7B,oCAAoC;IACpC,uCAAuC;IACvC,yBAAyB;IACzB,4BAA4B;IAC5B,mCAAmC;IACnC,sCAAsC;IACtC,sBAAsB;IACtB,yBAAyB;IACzB,gCAAgC;IAChC,mCAAmC;IACnC,2BAA2B;IAC3B,8BAA8B;IAC9B,wBAAwB;IACxB,2BAA2B;IAC3B,gCAAgC;IAChC,mCAAmC;IACnC,yCAAyC;IACzC,sCAAsC;IACtC,kCAAkC;IAClC,uCAAuC;IACvC,0CAA0C;IAC1C,wBAAwB;IACxB,gCAAgC;IAChC,uBAAuB;IACvB,sBAAsB;IACtB,gCAAgC;IAChC,mCAAmC;IACnC,gCAAgC;CACxB,CAAC;AAEX,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,4BAA4B;IAC5B,mCAAmC;IACnC,6BAA6B;IAC7B,8BAA8B;IAC9B,6BAA6B;IAC7B,mCAAmC;IACnC,4BAA4B;CACpB,CAAC;AAEX,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,0CAA0C;IAC1C,0CAA0C;IAC1C,4CAA4C;IAC5C,4CAA4C;IAC5C,2CAA2C;IAC3C,yCAAyC;CACjC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@lit-material/tokens",
3
+ "version": "0.0.1",
4
+ "description": "Material Design 3 design tokens (color, type, shape, elevation, motion) for lit-material components.",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "bohdaq",
8
+ "email": "bohdaq@gmail.com",
9
+ "url": "https://github.com/bohdaq"
10
+ },
11
+ "homepage": "https://github.com/bohdaq/lit-material#readme",
12
+ "bugs": "https://github.com/bohdaq/lit-material/issues",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+ssh://git@github.com/bohdaq/lit-material.git",
16
+ "directory": "packages/tokens"
17
+ },
18
+ "keywords": [
19
+ "lit",
20
+ "web-components",
21
+ "lit-material",
22
+ "material-design",
23
+ "material-design-3",
24
+ "design-tokens",
25
+ "css-custom-properties"
26
+ ],
27
+ "type": "module",
28
+ "main": "./dist/index.js",
29
+ "types": "./dist/index.d.ts",
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "default": "./dist/index.js"
34
+ },
35
+ "./css/*": "./src/css/*"
36
+ },
37
+ "files": [
38
+ "dist",
39
+ "src/css"
40
+ ],
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "devDependencies": {
45
+ "typescript": "^5.7.0"
46
+ },
47
+ "scripts": {
48
+ "build": "tsc -p tsconfig.json",
49
+ "typecheck": "tsc -p tsconfig.json --noEmit"
50
+ }
51
+ }
@@ -0,0 +1,63 @@
1
+ /*
2
+ * Material Design 3 baseline color scheme (light + dark), via the CSS
3
+ * `light-dark()` function. https://m3.material.io/styles/color/roles
4
+ *
5
+ * `color-scheme: light dark` (the default below) means "follow the OS/user
6
+ * preference". To force a scheme regardless of preference, set
7
+ * `color-scheme="light"` or `color-scheme="dark"` as an attribute on <html>
8
+ * (or any ancestor) — see the overrides at the bottom of this file.
9
+ */
10
+ :host,
11
+ :root {
12
+ color-scheme: light dark;
13
+
14
+ --md-sys-color-primary: light-dark(#6750a4, #d0bcff);
15
+ --md-sys-color-on-primary: light-dark(#ffffff, #381e72);
16
+ --md-sys-color-primary-container: light-dark(#eaddff, #4f378b);
17
+ --md-sys-color-on-primary-container: light-dark(#21005d, #eaddff);
18
+
19
+ --md-sys-color-secondary: light-dark(#625b71, #ccc2dc);
20
+ --md-sys-color-on-secondary: light-dark(#ffffff, #332d41);
21
+ --md-sys-color-secondary-container: light-dark(#e8def8, #4a4458);
22
+ --md-sys-color-on-secondary-container: light-dark(#1d192b, #e8def8);
23
+
24
+ --md-sys-color-tertiary: light-dark(#7d5260, #efb8c8);
25
+ --md-sys-color-on-tertiary: light-dark(#ffffff, #492532);
26
+ --md-sys-color-tertiary-container: light-dark(#ffd8e4, #633b48);
27
+ --md-sys-color-on-tertiary-container: light-dark(#31111d, #ffd8e4);
28
+
29
+ --md-sys-color-error: light-dark(#b3261e, #f2b8b5);
30
+ --md-sys-color-on-error: light-dark(#ffffff, #601410);
31
+ --md-sys-color-error-container: light-dark(#f9dedc, #8c1d18);
32
+ --md-sys-color-on-error-container: light-dark(#410e0b, #f9dedc);
33
+
34
+ --md-sys-color-background: light-dark(#fffbfe, #1c1b1f);
35
+ --md-sys-color-on-background: light-dark(#1c1b1f, #e6e1e5);
36
+ --md-sys-color-surface: light-dark(#fffbfe, #1c1b1f);
37
+ --md-sys-color-on-surface: light-dark(#1c1b1f, #e6e1e5);
38
+ --md-sys-color-surface-variant: light-dark(#e7e0ec, #49454f);
39
+ --md-sys-color-on-surface-variant: light-dark(#49454f, #cac4d0);
40
+
41
+ --md-sys-color-surface-container-lowest: light-dark(#ffffff, #0f0d13);
42
+ --md-sys-color-surface-container-low: light-dark(#f7f2fa, #1d1b20);
43
+ --md-sys-color-surface-container: light-dark(#f3edf7, #211f26);
44
+ --md-sys-color-surface-container-high: light-dark(#ece6f0, #2b2930);
45
+ --md-sys-color-surface-container-highest: light-dark(#e6e0e9, #36343b);
46
+
47
+ --md-sys-color-outline: light-dark(#79747e, #938f99);
48
+ --md-sys-color-outline-variant: light-dark(#c4c7c5, #444746);
49
+ --md-sys-color-shadow: #000000;
50
+ --md-sys-color-scrim: #000000;
51
+
52
+ --md-sys-color-inverse-surface: light-dark(#313033, #e6e1e5);
53
+ --md-sys-color-inverse-on-surface: light-dark(#f4eff4, #313033);
54
+ --md-sys-color-inverse-primary: light-dark(#d0bcff, #6750a4);
55
+ }
56
+
57
+ :root[color-scheme="light"] {
58
+ color-scheme: light;
59
+ }
60
+
61
+ :root[color-scheme="dark"] {
62
+ color-scheme: dark;
63
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Material Design 3 elevation levels, expressed as box-shadow.
3
+ * https://m3.material.io/styles/elevation/tokens
4
+ */
5
+ :host,
6
+ :root {
7
+ --md-sys-elevation-level0: none;
8
+ --md-sys-elevation-level1:
9
+ 0px 1px 2px 0px rgba(0, 0, 0, 0.3),
10
+ 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
11
+ --md-sys-elevation-level2:
12
+ 0px 1px 2px 0px rgba(0, 0, 0, 0.3),
13
+ 0px 2px 6px 2px rgba(0, 0, 0, 0.15);
14
+ --md-sys-elevation-level3:
15
+ 0px 1px 3px 0px rgba(0, 0, 0, 0.3),
16
+ 0px 4px 8px 3px rgba(0, 0, 0, 0.15);
17
+ --md-sys-elevation-level4:
18
+ 0px 2px 3px 0px rgba(0, 0, 0, 0.3),
19
+ 0px 6px 10px 4px rgba(0, 0, 0, 0.15);
20
+ --md-sys-elevation-level5:
21
+ 0px 4px 4px 0px rgba(0, 0, 0, 0.3),
22
+ 0px 8px 12px 6px rgba(0, 0, 0, 0.15);
23
+ }
@@ -0,0 +1,11 @@
1
+ /*
2
+ * Material Design 3 baseline tokens for lit-material.
3
+ * Import this once at the document root — CSS custom properties inherit
4
+ * through shadow boundaries, so every lit-material component picks it up.
5
+ */
6
+ @import "./color.css";
7
+ @import "./shape.css";
8
+ @import "./typescale.css";
9
+ @import "./elevation.css";
10
+ @import "./state.css";
11
+ @import "./motion.css";
@@ -0,0 +1,11 @@
1
+ /*
2
+ * Material Design 3 motion — easing and duration tokens (subset).
3
+ * https://m3.material.io/styles/motion/easing-and-duration/tokens-specs
4
+ */
5
+ :host,
6
+ :root {
7
+ --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
8
+ --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
9
+ --md-sys-motion-duration-short2: 100ms;
10
+ --md-sys-motion-duration-medium1: 250ms;
11
+ }
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Material Design 3 shape scale.
3
+ * https://m3.material.io/styles/shape/shape-scale-tokens
4
+ */
5
+ :host,
6
+ :root {
7
+ --md-sys-shape-corner-none: 0px;
8
+ --md-sys-shape-corner-extra-small: 4px;
9
+ --md-sys-shape-corner-small: 8px;
10
+ --md-sys-shape-corner-medium: 12px;
11
+ --md-sys-shape-corner-large: 16px;
12
+ --md-sys-shape-corner-extra-large: 28px;
13
+ --md-sys-shape-corner-full: 9999px;
14
+ }
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Material Design 3 state layer opacities (hover/focus/pressed/dragged) and
3
+ * disabled-content/container opacities.
4
+ * https://m3.material.io/foundations/interaction/states/state-layers
5
+ */
6
+ :host,
7
+ :root {
8
+ --md-sys-state-hover-state-layer-opacity: 0.08;
9
+ --md-sys-state-focus-state-layer-opacity: 0.1;
10
+ --md-sys-state-pressed-state-layer-opacity: 0.1;
11
+ --md-sys-state-dragged-state-layer-opacity: 0.16;
12
+ --md-sys-state-disabled-container-opacity: 0.12;
13
+ --md-sys-state-disabled-content-opacity: 0.38;
14
+ }
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Material Design 3 type scale — subset used by Phase 1 components.
3
+ * https://m3.material.io/styles/typography/type-scale-tokens
4
+ */
5
+ :host,
6
+ :root {
7
+ --md-sys-typescale-label-large-font: Roboto, system-ui, sans-serif;
8
+ --md-sys-typescale-label-large-weight: 500;
9
+ --md-sys-typescale-label-large-size: 0.875rem;
10
+ --md-sys-typescale-label-large-line-height: 1.25rem;
11
+ --md-sys-typescale-label-large-tracking: 0.00625rem;
12
+
13
+ --md-sys-typescale-label-medium-font: Roboto, system-ui, sans-serif;
14
+ --md-sys-typescale-label-medium-weight: 500;
15
+ --md-sys-typescale-label-medium-size: 0.75rem;
16
+ --md-sys-typescale-label-medium-line-height: 1rem;
17
+ --md-sys-typescale-label-medium-tracking: 0.03125rem;
18
+ }