@bug-on/md3-tailwind 0.1.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/.turbo/turbo-build.log +20 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +177 -0
- package/dist/index.mjs +146 -0
- package/package.json +37 -0
- package/src/index.ts +173 -0
- package/tsconfig.json +14 -0
- package/tsup.config.ts +9 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
> @bug-on/md3-tailwind@0.1.0 build /home/runner/work/bug-on-md3-expressive/bug-on-md3-expressive/packages/tailwind
|
|
3
|
+
> tsup
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.1
|
|
8
|
+
[34mCLI[39m Using tsup config: /home/runner/work/bug-on-md3-expressive/bug-on-md3-expressive/packages/tailwind/tsup.config.ts
|
|
9
|
+
[34mCLI[39m Target: es2017
|
|
10
|
+
[34mCLI[39m Cleaning output folder
|
|
11
|
+
[34mESM[39m Build start
|
|
12
|
+
[34mCJS[39m Build start
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m6.95 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 38ms
|
|
15
|
+
[32mCJS[39m [1mdist/index.js [22m[32m8.44 KB[39m
|
|
16
|
+
[32mCJS[39m ⚡️ Build success in 39ms
|
|
17
|
+
[34mDTS[39m Build start
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 1550ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m62.00 B[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m62.00 B[39m
|
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
default: () => index_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
var import_plugin = __toESM(require("tailwindcss/plugin"));
|
|
37
|
+
var md3Plugin = (0, import_plugin.default)(({ addBase, addComponents, addUtilities }) => {
|
|
38
|
+
addBase({
|
|
39
|
+
":root": {
|
|
40
|
+
"--color-m3-primary": "var(--md-sys-color-primary)",
|
|
41
|
+
"--color-m3-on-primary": "var(--md-sys-color-on-primary)",
|
|
42
|
+
"--color-m3-primary-container": "var(--md-sys-color-primary-container)",
|
|
43
|
+
"--color-m3-on-primary-container": "var(--md-sys-color-on-primary-container)",
|
|
44
|
+
"--color-m3-secondary": "var(--md-sys-color-secondary)",
|
|
45
|
+
"--color-m3-on-secondary": "var(--md-sys-color-on-secondary)",
|
|
46
|
+
"--color-m3-secondary-container": "var(--md-sys-color-secondary-container)",
|
|
47
|
+
"--color-m3-on-secondary-container": "var(--md-sys-color-on-secondary-container)",
|
|
48
|
+
"--color-m3-tertiary": "var(--md-sys-color-tertiary)",
|
|
49
|
+
"--color-m3-on-tertiary": "var(--md-sys-color-on-tertiary)",
|
|
50
|
+
"--color-m3-tertiary-container": "var(--md-sys-color-tertiary-container)",
|
|
51
|
+
"--color-m3-on-tertiary-container": "var(--md-sys-color-on-tertiary-container)",
|
|
52
|
+
"--color-m3-error": "var(--md-sys-color-error)",
|
|
53
|
+
"--color-m3-on-error": "var(--md-sys-color-on-error)",
|
|
54
|
+
"--color-m3-error-container": "var(--md-sys-color-error-container)",
|
|
55
|
+
"--color-m3-on-error-container": "var(--md-sys-color-on-error-container)",
|
|
56
|
+
"--color-m3-surface": "var(--md-sys-color-surface)",
|
|
57
|
+
"--color-m3-surface-dim": "var(--md-sys-color-surface-dim)",
|
|
58
|
+
"--color-m3-surface-bright": "var(--md-sys-color-surface-bright)",
|
|
59
|
+
"--color-m3-on-surface": "var(--md-sys-color-on-surface)",
|
|
60
|
+
"--color-m3-surface-variant": "var(--md-sys-color-surface-variant)",
|
|
61
|
+
"--color-m3-on-surface-variant": "var(--md-sys-color-on-surface-variant)",
|
|
62
|
+
"--color-m3-surface-container-lowest": "var(--md-sys-color-surface-container-lowest)",
|
|
63
|
+
"--color-m3-surface-container-low": "var(--md-sys-color-surface-container-low)",
|
|
64
|
+
"--color-m3-surface-container": "var(--md-sys-color-surface-container)",
|
|
65
|
+
"--color-m3-surface-container-high": "var(--md-sys-color-surface-container-high)",
|
|
66
|
+
"--color-m3-surface-container-highest": "var(--md-sys-color-surface-container-highest)",
|
|
67
|
+
"--color-m3-inverse-surface": "var(--md-sys-color-inverse-surface)",
|
|
68
|
+
"--color-m3-inverse-on-surface": "var(--md-sys-color-inverse-on-surface)",
|
|
69
|
+
"--color-m3-inverse-primary": "var(--md-sys-color-inverse-primary)",
|
|
70
|
+
"--color-m3-outline": "var(--md-sys-color-outline)",
|
|
71
|
+
"--color-m3-outline-variant": "var(--md-sys-color-outline-variant)",
|
|
72
|
+
"--color-m3-shadow": "var(--md-sys-color-shadow)",
|
|
73
|
+
"--color-m3-scrim": "var(--md-sys-color-scrim)",
|
|
74
|
+
"--color-m3-surface-tint": "var(--md-sys-color-surface-tint)",
|
|
75
|
+
"--color-m3-indicator-active": "var(--md-sys-color-indicator-active)",
|
|
76
|
+
"--color-m3-indicator-container": "var(--md-sys-color-indicator-container)",
|
|
77
|
+
"--color-m3-indicator-contained-active": "var(--md-sys-color-indicator-contained-active)",
|
|
78
|
+
"--color-m3-indicator-contained-container": "var(--md-sys-color-indicator-contained-container)",
|
|
79
|
+
"--color-m3-indicator-track": "var(--md-sys-color-indicator-track)",
|
|
80
|
+
"--color-m3-indicator-stop": "var(--md-sys-color-indicator-stop)",
|
|
81
|
+
"--radius-m3-none": "var(--md-sys-shape-corner-none, 0px)",
|
|
82
|
+
"--radius-m3-xs": "var(--md-sys-shape-corner-extra-small, 4px)",
|
|
83
|
+
"--radius-m3-sm": "var(--md-sys-shape-corner-small, 8px)",
|
|
84
|
+
"--radius-m3-md": "var(--md-sys-shape-corner-medium, 12px)",
|
|
85
|
+
"--radius-m3-lg": "var(--md-sys-shape-corner-large, 16px)",
|
|
86
|
+
"--radius-m3-xl": "var(--md-sys-shape-corner-extra-large, 28px)",
|
|
87
|
+
"--radius-m3-full": "var(--md-sys-shape-corner-full, 9999px)"
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
addComponents({
|
|
91
|
+
".md-icon": {
|
|
92
|
+
fontFamily: "var(--md-icon-font, 'Material Symbols Outlined')",
|
|
93
|
+
fontWeight: "normal",
|
|
94
|
+
fontStyle: "normal",
|
|
95
|
+
fontSize: "var(--md-icon-size, 24px)",
|
|
96
|
+
lineHeight: "1",
|
|
97
|
+
display: "inline-block",
|
|
98
|
+
whiteSpace: "nowrap",
|
|
99
|
+
wordWrap: "normal",
|
|
100
|
+
direction: "ltr",
|
|
101
|
+
textRendering: "optimizeLegibility",
|
|
102
|
+
"-webkit-font-smoothing": "antialiased",
|
|
103
|
+
fontVariationSettings: "'FILL' var(--md-icon-fill, 0), 'wght' var(--md-icon-weight, 400), 'GRAD' var(--md-icon-grade, 0), 'opsz' var(--md-icon-opsz, 24)"
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
addUtilities({
|
|
107
|
+
".elevation-0": { boxShadow: "none" },
|
|
108
|
+
".elevation-1": {
|
|
109
|
+
boxShadow: "0px 1px 2px 0px rgba(0,0,0,.3), 0px 1px 3px 1px rgba(0,0,0,.15)"
|
|
110
|
+
},
|
|
111
|
+
".elevation-2": {
|
|
112
|
+
boxShadow: "0px 1px 2px 0px rgba(0,0,0,.3), 0px 2px 6px 2px rgba(0,0,0,.15)"
|
|
113
|
+
},
|
|
114
|
+
".elevation-3": {
|
|
115
|
+
boxShadow: "0px 1px 3px 0px rgba(0,0,0,.3), 0px 4px 8px 3px rgba(0,0,0,.15)"
|
|
116
|
+
},
|
|
117
|
+
".elevation-4": {
|
|
118
|
+
boxShadow: "0px 2px 3px 0px rgba(0,0,0,.3), 0px 6px 10px 4px rgba(0,0,0,.15)"
|
|
119
|
+
},
|
|
120
|
+
".elevation-5": {
|
|
121
|
+
boxShadow: "0px 4px 4px 0px rgba(0,0,0,.3), 0px 8px 12px 6px rgba(0,0,0,.15)"
|
|
122
|
+
},
|
|
123
|
+
// ── Icon variant utilities ─────────────────────────────────────────────
|
|
124
|
+
// Set --md-icon-font to switch between Material Symbols font families.
|
|
125
|
+
".icon-outlined": {
|
|
126
|
+
"--md-icon-font": "'Material Symbols Outlined'",
|
|
127
|
+
fontFamily: "'Material Symbols Outlined'"
|
|
128
|
+
},
|
|
129
|
+
".icon-rounded": {
|
|
130
|
+
"--md-icon-font": "'Material Symbols Rounded'",
|
|
131
|
+
fontFamily: "'Material Symbols Rounded'"
|
|
132
|
+
},
|
|
133
|
+
".icon-sharp": {
|
|
134
|
+
"--md-icon-font": "'Material Symbols Sharp'",
|
|
135
|
+
fontFamily: "'Material Symbols Sharp'"
|
|
136
|
+
},
|
|
137
|
+
// ── Fill axis utilities ────────────────────────────────────────────────
|
|
138
|
+
".icon-fill-0": { "--md-icon-fill": "0" },
|
|
139
|
+
".icon-fill-1": { "--md-icon-fill": "1" },
|
|
140
|
+
// ── Weight axis utilities ──────────────────────────────────────────────
|
|
141
|
+
".icon-weight-100": { "--md-icon-weight": "100" },
|
|
142
|
+
".icon-weight-200": { "--md-icon-weight": "200" },
|
|
143
|
+
".icon-weight-300": { "--md-icon-weight": "300" },
|
|
144
|
+
".icon-weight-400": { "--md-icon-weight": "400" },
|
|
145
|
+
".icon-weight-500": { "--md-icon-weight": "500" },
|
|
146
|
+
".icon-weight-600": { "--md-icon-weight": "600" },
|
|
147
|
+
".icon-weight-700": { "--md-icon-weight": "700" },
|
|
148
|
+
// ── Grade axis utilities ───────────────────────────────────────────────
|
|
149
|
+
// Named aliases match common usage patterns from MD3 spec.
|
|
150
|
+
".icon-grade-low": { "--md-icon-grade": "-25" },
|
|
151
|
+
".icon-grade-default": { "--md-icon-grade": "0" },
|
|
152
|
+
".icon-grade-high": { "--md-icon-grade": "200" },
|
|
153
|
+
// ── Optical size + font-size combined utilities ────────────────────────
|
|
154
|
+
// opsz axis must match the rendered size for best optical quality.
|
|
155
|
+
".icon-size-20": {
|
|
156
|
+
"--md-icon-size": "20px",
|
|
157
|
+
"--md-icon-opsz": "20",
|
|
158
|
+
fontSize: "20px"
|
|
159
|
+
},
|
|
160
|
+
".icon-size-24": {
|
|
161
|
+
"--md-icon-size": "24px",
|
|
162
|
+
"--md-icon-opsz": "24",
|
|
163
|
+
fontSize: "24px"
|
|
164
|
+
},
|
|
165
|
+
".icon-size-40": {
|
|
166
|
+
"--md-icon-size": "40px",
|
|
167
|
+
"--md-icon-opsz": "40",
|
|
168
|
+
fontSize: "40px"
|
|
169
|
+
},
|
|
170
|
+
".icon-size-48": {
|
|
171
|
+
"--md-icon-size": "48px",
|
|
172
|
+
"--md-icon-opsz": "48",
|
|
173
|
+
fontSize: "48px"
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
var index_default = md3Plugin;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import plugin from "tailwindcss/plugin";
|
|
3
|
+
var md3Plugin = plugin(({ addBase, addComponents, addUtilities }) => {
|
|
4
|
+
addBase({
|
|
5
|
+
":root": {
|
|
6
|
+
"--color-m3-primary": "var(--md-sys-color-primary)",
|
|
7
|
+
"--color-m3-on-primary": "var(--md-sys-color-on-primary)",
|
|
8
|
+
"--color-m3-primary-container": "var(--md-sys-color-primary-container)",
|
|
9
|
+
"--color-m3-on-primary-container": "var(--md-sys-color-on-primary-container)",
|
|
10
|
+
"--color-m3-secondary": "var(--md-sys-color-secondary)",
|
|
11
|
+
"--color-m3-on-secondary": "var(--md-sys-color-on-secondary)",
|
|
12
|
+
"--color-m3-secondary-container": "var(--md-sys-color-secondary-container)",
|
|
13
|
+
"--color-m3-on-secondary-container": "var(--md-sys-color-on-secondary-container)",
|
|
14
|
+
"--color-m3-tertiary": "var(--md-sys-color-tertiary)",
|
|
15
|
+
"--color-m3-on-tertiary": "var(--md-sys-color-on-tertiary)",
|
|
16
|
+
"--color-m3-tertiary-container": "var(--md-sys-color-tertiary-container)",
|
|
17
|
+
"--color-m3-on-tertiary-container": "var(--md-sys-color-on-tertiary-container)",
|
|
18
|
+
"--color-m3-error": "var(--md-sys-color-error)",
|
|
19
|
+
"--color-m3-on-error": "var(--md-sys-color-on-error)",
|
|
20
|
+
"--color-m3-error-container": "var(--md-sys-color-error-container)",
|
|
21
|
+
"--color-m3-on-error-container": "var(--md-sys-color-on-error-container)",
|
|
22
|
+
"--color-m3-surface": "var(--md-sys-color-surface)",
|
|
23
|
+
"--color-m3-surface-dim": "var(--md-sys-color-surface-dim)",
|
|
24
|
+
"--color-m3-surface-bright": "var(--md-sys-color-surface-bright)",
|
|
25
|
+
"--color-m3-on-surface": "var(--md-sys-color-on-surface)",
|
|
26
|
+
"--color-m3-surface-variant": "var(--md-sys-color-surface-variant)",
|
|
27
|
+
"--color-m3-on-surface-variant": "var(--md-sys-color-on-surface-variant)",
|
|
28
|
+
"--color-m3-surface-container-lowest": "var(--md-sys-color-surface-container-lowest)",
|
|
29
|
+
"--color-m3-surface-container-low": "var(--md-sys-color-surface-container-low)",
|
|
30
|
+
"--color-m3-surface-container": "var(--md-sys-color-surface-container)",
|
|
31
|
+
"--color-m3-surface-container-high": "var(--md-sys-color-surface-container-high)",
|
|
32
|
+
"--color-m3-surface-container-highest": "var(--md-sys-color-surface-container-highest)",
|
|
33
|
+
"--color-m3-inverse-surface": "var(--md-sys-color-inverse-surface)",
|
|
34
|
+
"--color-m3-inverse-on-surface": "var(--md-sys-color-inverse-on-surface)",
|
|
35
|
+
"--color-m3-inverse-primary": "var(--md-sys-color-inverse-primary)",
|
|
36
|
+
"--color-m3-outline": "var(--md-sys-color-outline)",
|
|
37
|
+
"--color-m3-outline-variant": "var(--md-sys-color-outline-variant)",
|
|
38
|
+
"--color-m3-shadow": "var(--md-sys-color-shadow)",
|
|
39
|
+
"--color-m3-scrim": "var(--md-sys-color-scrim)",
|
|
40
|
+
"--color-m3-surface-tint": "var(--md-sys-color-surface-tint)",
|
|
41
|
+
"--color-m3-indicator-active": "var(--md-sys-color-indicator-active)",
|
|
42
|
+
"--color-m3-indicator-container": "var(--md-sys-color-indicator-container)",
|
|
43
|
+
"--color-m3-indicator-contained-active": "var(--md-sys-color-indicator-contained-active)",
|
|
44
|
+
"--color-m3-indicator-contained-container": "var(--md-sys-color-indicator-contained-container)",
|
|
45
|
+
"--color-m3-indicator-track": "var(--md-sys-color-indicator-track)",
|
|
46
|
+
"--color-m3-indicator-stop": "var(--md-sys-color-indicator-stop)",
|
|
47
|
+
"--radius-m3-none": "var(--md-sys-shape-corner-none, 0px)",
|
|
48
|
+
"--radius-m3-xs": "var(--md-sys-shape-corner-extra-small, 4px)",
|
|
49
|
+
"--radius-m3-sm": "var(--md-sys-shape-corner-small, 8px)",
|
|
50
|
+
"--radius-m3-md": "var(--md-sys-shape-corner-medium, 12px)",
|
|
51
|
+
"--radius-m3-lg": "var(--md-sys-shape-corner-large, 16px)",
|
|
52
|
+
"--radius-m3-xl": "var(--md-sys-shape-corner-extra-large, 28px)",
|
|
53
|
+
"--radius-m3-full": "var(--md-sys-shape-corner-full, 9999px)"
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
addComponents({
|
|
57
|
+
".md-icon": {
|
|
58
|
+
fontFamily: "var(--md-icon-font, 'Material Symbols Outlined')",
|
|
59
|
+
fontWeight: "normal",
|
|
60
|
+
fontStyle: "normal",
|
|
61
|
+
fontSize: "var(--md-icon-size, 24px)",
|
|
62
|
+
lineHeight: "1",
|
|
63
|
+
display: "inline-block",
|
|
64
|
+
whiteSpace: "nowrap",
|
|
65
|
+
wordWrap: "normal",
|
|
66
|
+
direction: "ltr",
|
|
67
|
+
textRendering: "optimizeLegibility",
|
|
68
|
+
"-webkit-font-smoothing": "antialiased",
|
|
69
|
+
fontVariationSettings: "'FILL' var(--md-icon-fill, 0), 'wght' var(--md-icon-weight, 400), 'GRAD' var(--md-icon-grade, 0), 'opsz' var(--md-icon-opsz, 24)"
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
addUtilities({
|
|
73
|
+
".elevation-0": { boxShadow: "none" },
|
|
74
|
+
".elevation-1": {
|
|
75
|
+
boxShadow: "0px 1px 2px 0px rgba(0,0,0,.3), 0px 1px 3px 1px rgba(0,0,0,.15)"
|
|
76
|
+
},
|
|
77
|
+
".elevation-2": {
|
|
78
|
+
boxShadow: "0px 1px 2px 0px rgba(0,0,0,.3), 0px 2px 6px 2px rgba(0,0,0,.15)"
|
|
79
|
+
},
|
|
80
|
+
".elevation-3": {
|
|
81
|
+
boxShadow: "0px 1px 3px 0px rgba(0,0,0,.3), 0px 4px 8px 3px rgba(0,0,0,.15)"
|
|
82
|
+
},
|
|
83
|
+
".elevation-4": {
|
|
84
|
+
boxShadow: "0px 2px 3px 0px rgba(0,0,0,.3), 0px 6px 10px 4px rgba(0,0,0,.15)"
|
|
85
|
+
},
|
|
86
|
+
".elevation-5": {
|
|
87
|
+
boxShadow: "0px 4px 4px 0px rgba(0,0,0,.3), 0px 8px 12px 6px rgba(0,0,0,.15)"
|
|
88
|
+
},
|
|
89
|
+
// ── Icon variant utilities ─────────────────────────────────────────────
|
|
90
|
+
// Set --md-icon-font to switch between Material Symbols font families.
|
|
91
|
+
".icon-outlined": {
|
|
92
|
+
"--md-icon-font": "'Material Symbols Outlined'",
|
|
93
|
+
fontFamily: "'Material Symbols Outlined'"
|
|
94
|
+
},
|
|
95
|
+
".icon-rounded": {
|
|
96
|
+
"--md-icon-font": "'Material Symbols Rounded'",
|
|
97
|
+
fontFamily: "'Material Symbols Rounded'"
|
|
98
|
+
},
|
|
99
|
+
".icon-sharp": {
|
|
100
|
+
"--md-icon-font": "'Material Symbols Sharp'",
|
|
101
|
+
fontFamily: "'Material Symbols Sharp'"
|
|
102
|
+
},
|
|
103
|
+
// ── Fill axis utilities ────────────────────────────────────────────────
|
|
104
|
+
".icon-fill-0": { "--md-icon-fill": "0" },
|
|
105
|
+
".icon-fill-1": { "--md-icon-fill": "1" },
|
|
106
|
+
// ── Weight axis utilities ──────────────────────────────────────────────
|
|
107
|
+
".icon-weight-100": { "--md-icon-weight": "100" },
|
|
108
|
+
".icon-weight-200": { "--md-icon-weight": "200" },
|
|
109
|
+
".icon-weight-300": { "--md-icon-weight": "300" },
|
|
110
|
+
".icon-weight-400": { "--md-icon-weight": "400" },
|
|
111
|
+
".icon-weight-500": { "--md-icon-weight": "500" },
|
|
112
|
+
".icon-weight-600": { "--md-icon-weight": "600" },
|
|
113
|
+
".icon-weight-700": { "--md-icon-weight": "700" },
|
|
114
|
+
// ── Grade axis utilities ───────────────────────────────────────────────
|
|
115
|
+
// Named aliases match common usage patterns from MD3 spec.
|
|
116
|
+
".icon-grade-low": { "--md-icon-grade": "-25" },
|
|
117
|
+
".icon-grade-default": { "--md-icon-grade": "0" },
|
|
118
|
+
".icon-grade-high": { "--md-icon-grade": "200" },
|
|
119
|
+
// ── Optical size + font-size combined utilities ────────────────────────
|
|
120
|
+
// opsz axis must match the rendered size for best optical quality.
|
|
121
|
+
".icon-size-20": {
|
|
122
|
+
"--md-icon-size": "20px",
|
|
123
|
+
"--md-icon-opsz": "20",
|
|
124
|
+
fontSize: "20px"
|
|
125
|
+
},
|
|
126
|
+
".icon-size-24": {
|
|
127
|
+
"--md-icon-size": "24px",
|
|
128
|
+
"--md-icon-opsz": "24",
|
|
129
|
+
fontSize: "24px"
|
|
130
|
+
},
|
|
131
|
+
".icon-size-40": {
|
|
132
|
+
"--md-icon-size": "40px",
|
|
133
|
+
"--md-icon-opsz": "40",
|
|
134
|
+
fontSize: "40px"
|
|
135
|
+
},
|
|
136
|
+
".icon-size-48": {
|
|
137
|
+
"--md-icon-size": "48px",
|
|
138
|
+
"--md-icon-opsz": "48",
|
|
139
|
+
fontSize: "48px"
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
var index_default = md3Plugin;
|
|
144
|
+
export {
|
|
145
|
+
index_default as default
|
|
146
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bug-on/md3-tailwind",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Tailwind CSS v4 plugin for Material Design 3 Expressive",
|
|
5
|
+
"author": "Bug Ổn",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/nguyentruongton/bug-on-md3-expressive.git",
|
|
10
|
+
"directory": "packages/tailwind"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"react",
|
|
14
|
+
"tailwind",
|
|
15
|
+
"material-design-3",
|
|
16
|
+
"md3",
|
|
17
|
+
"ui-library",
|
|
18
|
+
"components",
|
|
19
|
+
"bug-on"
|
|
20
|
+
],
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"module": "./dist/index.mjs",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"tailwindcss": ">=4.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"tailwindcss": "4.2.2",
|
|
29
|
+
"tsup": "^8.4.0",
|
|
30
|
+
"typescript": "5.8.3"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsup",
|
|
34
|
+
"dev": "tsup --watch",
|
|
35
|
+
"clean": "rm -rf dist"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import plugin from "tailwindcss/plugin";
|
|
2
|
+
|
|
3
|
+
const md3Plugin = plugin(({ addBase, addComponents, addUtilities }) => {
|
|
4
|
+
addBase({
|
|
5
|
+
":root": {
|
|
6
|
+
"--color-m3-primary": "var(--md-sys-color-primary)",
|
|
7
|
+
"--color-m3-on-primary": "var(--md-sys-color-on-primary)",
|
|
8
|
+
"--color-m3-primary-container": "var(--md-sys-color-primary-container)",
|
|
9
|
+
"--color-m3-on-primary-container":
|
|
10
|
+
"var(--md-sys-color-on-primary-container)",
|
|
11
|
+
"--color-m3-secondary": "var(--md-sys-color-secondary)",
|
|
12
|
+
"--color-m3-on-secondary": "var(--md-sys-color-on-secondary)",
|
|
13
|
+
"--color-m3-secondary-container":
|
|
14
|
+
"var(--md-sys-color-secondary-container)",
|
|
15
|
+
"--color-m3-on-secondary-container":
|
|
16
|
+
"var(--md-sys-color-on-secondary-container)",
|
|
17
|
+
"--color-m3-tertiary": "var(--md-sys-color-tertiary)",
|
|
18
|
+
"--color-m3-on-tertiary": "var(--md-sys-color-on-tertiary)",
|
|
19
|
+
"--color-m3-tertiary-container": "var(--md-sys-color-tertiary-container)",
|
|
20
|
+
"--color-m3-on-tertiary-container":
|
|
21
|
+
"var(--md-sys-color-on-tertiary-container)",
|
|
22
|
+
"--color-m3-error": "var(--md-sys-color-error)",
|
|
23
|
+
"--color-m3-on-error": "var(--md-sys-color-on-error)",
|
|
24
|
+
"--color-m3-error-container": "var(--md-sys-color-error-container)",
|
|
25
|
+
"--color-m3-on-error-container": "var(--md-sys-color-on-error-container)",
|
|
26
|
+
|
|
27
|
+
"--color-m3-surface": "var(--md-sys-color-surface)",
|
|
28
|
+
"--color-m3-surface-dim": "var(--md-sys-color-surface-dim)",
|
|
29
|
+
"--color-m3-surface-bright": "var(--md-sys-color-surface-bright)",
|
|
30
|
+
"--color-m3-on-surface": "var(--md-sys-color-on-surface)",
|
|
31
|
+
"--color-m3-surface-variant": "var(--md-sys-color-surface-variant)",
|
|
32
|
+
"--color-m3-on-surface-variant": "var(--md-sys-color-on-surface-variant)",
|
|
33
|
+
|
|
34
|
+
"--color-m3-surface-container-lowest":
|
|
35
|
+
"var(--md-sys-color-surface-container-lowest)",
|
|
36
|
+
"--color-m3-surface-container-low":
|
|
37
|
+
"var(--md-sys-color-surface-container-low)",
|
|
38
|
+
"--color-m3-surface-container": "var(--md-sys-color-surface-container)",
|
|
39
|
+
"--color-m3-surface-container-high":
|
|
40
|
+
"var(--md-sys-color-surface-container-high)",
|
|
41
|
+
"--color-m3-surface-container-highest":
|
|
42
|
+
"var(--md-sys-color-surface-container-highest)",
|
|
43
|
+
|
|
44
|
+
"--color-m3-inverse-surface": "var(--md-sys-color-inverse-surface)",
|
|
45
|
+
"--color-m3-inverse-on-surface": "var(--md-sys-color-inverse-on-surface)",
|
|
46
|
+
"--color-m3-inverse-primary": "var(--md-sys-color-inverse-primary)",
|
|
47
|
+
|
|
48
|
+
"--color-m3-outline": "var(--md-sys-color-outline)",
|
|
49
|
+
"--color-m3-outline-variant": "var(--md-sys-color-outline-variant)",
|
|
50
|
+
"--color-m3-shadow": "var(--md-sys-color-shadow)",
|
|
51
|
+
"--color-m3-scrim": "var(--md-sys-color-scrim)",
|
|
52
|
+
"--color-m3-surface-tint": "var(--md-sys-color-surface-tint)",
|
|
53
|
+
|
|
54
|
+
"--color-m3-indicator-active": "var(--md-sys-color-indicator-active)",
|
|
55
|
+
"--color-m3-indicator-container":
|
|
56
|
+
"var(--md-sys-color-indicator-container)",
|
|
57
|
+
"--color-m3-indicator-contained-active":
|
|
58
|
+
"var(--md-sys-color-indicator-contained-active)",
|
|
59
|
+
"--color-m3-indicator-contained-container":
|
|
60
|
+
"var(--md-sys-color-indicator-contained-container)",
|
|
61
|
+
"--color-m3-indicator-track": "var(--md-sys-color-indicator-track)",
|
|
62
|
+
"--color-m3-indicator-stop": "var(--md-sys-color-indicator-stop)",
|
|
63
|
+
|
|
64
|
+
"--radius-m3-none": "var(--md-sys-shape-corner-none, 0px)",
|
|
65
|
+
"--radius-m3-xs": "var(--md-sys-shape-corner-extra-small, 4px)",
|
|
66
|
+
"--radius-m3-sm": "var(--md-sys-shape-corner-small, 8px)",
|
|
67
|
+
"--radius-m3-md": "var(--md-sys-shape-corner-medium, 12px)",
|
|
68
|
+
"--radius-m3-lg": "var(--md-sys-shape-corner-large, 16px)",
|
|
69
|
+
"--radius-m3-xl": "var(--md-sys-shape-corner-extra-large, 28px)",
|
|
70
|
+
"--radius-m3-full": "var(--md-sys-shape-corner-full, 9999px)",
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// ── Material Symbols Icon base class ────────────────────────────────────
|
|
75
|
+
// CSS variables drive font-variation-settings so utility classes and
|
|
76
|
+
// inline style props can all influence the same axes without specificity wars.
|
|
77
|
+
addComponents({
|
|
78
|
+
".md-icon": {
|
|
79
|
+
fontFamily: "var(--md-icon-font, 'Material Symbols Outlined')",
|
|
80
|
+
fontWeight: "normal",
|
|
81
|
+
fontStyle: "normal",
|
|
82
|
+
fontSize: "var(--md-icon-size, 24px)",
|
|
83
|
+
lineHeight: "1",
|
|
84
|
+
display: "inline-block",
|
|
85
|
+
whiteSpace: "nowrap",
|
|
86
|
+
wordWrap: "normal",
|
|
87
|
+
direction: "ltr",
|
|
88
|
+
textRendering: "optimizeLegibility",
|
|
89
|
+
"-webkit-font-smoothing": "antialiased",
|
|
90
|
+
fontVariationSettings:
|
|
91
|
+
"'FILL' var(--md-icon-fill, 0), 'wght' var(--md-icon-weight, 400), 'GRAD' var(--md-icon-grade, 0), 'opsz' var(--md-icon-opsz, 24)",
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
addUtilities({
|
|
96
|
+
".elevation-0": { boxShadow: "none" },
|
|
97
|
+
".elevation-1": {
|
|
98
|
+
boxShadow:
|
|
99
|
+
"0px 1px 2px 0px rgba(0,0,0,.3), 0px 1px 3px 1px rgba(0,0,0,.15)",
|
|
100
|
+
},
|
|
101
|
+
".elevation-2": {
|
|
102
|
+
boxShadow:
|
|
103
|
+
"0px 1px 2px 0px rgba(0,0,0,.3), 0px 2px 6px 2px rgba(0,0,0,.15)",
|
|
104
|
+
},
|
|
105
|
+
".elevation-3": {
|
|
106
|
+
boxShadow:
|
|
107
|
+
"0px 1px 3px 0px rgba(0,0,0,.3), 0px 4px 8px 3px rgba(0,0,0,.15)",
|
|
108
|
+
},
|
|
109
|
+
".elevation-4": {
|
|
110
|
+
boxShadow:
|
|
111
|
+
"0px 2px 3px 0px rgba(0,0,0,.3), 0px 6px 10px 4px rgba(0,0,0,.15)",
|
|
112
|
+
},
|
|
113
|
+
".elevation-5": {
|
|
114
|
+
boxShadow:
|
|
115
|
+
"0px 4px 4px 0px rgba(0,0,0,.3), 0px 8px 12px 6px rgba(0,0,0,.15)",
|
|
116
|
+
},
|
|
117
|
+
// ── Icon variant utilities ─────────────────────────────────────────────
|
|
118
|
+
// Set --md-icon-font to switch between Material Symbols font families.
|
|
119
|
+
".icon-outlined": {
|
|
120
|
+
"--md-icon-font": "'Material Symbols Outlined'",
|
|
121
|
+
fontFamily: "'Material Symbols Outlined'",
|
|
122
|
+
},
|
|
123
|
+
".icon-rounded": {
|
|
124
|
+
"--md-icon-font": "'Material Symbols Rounded'",
|
|
125
|
+
fontFamily: "'Material Symbols Rounded'",
|
|
126
|
+
},
|
|
127
|
+
".icon-sharp": {
|
|
128
|
+
"--md-icon-font": "'Material Symbols Sharp'",
|
|
129
|
+
fontFamily: "'Material Symbols Sharp'",
|
|
130
|
+
},
|
|
131
|
+
// ── Fill axis utilities ────────────────────────────────────────────────
|
|
132
|
+
".icon-fill-0": { "--md-icon-fill": "0" },
|
|
133
|
+
".icon-fill-1": { "--md-icon-fill": "1" },
|
|
134
|
+
// ── Weight axis utilities ──────────────────────────────────────────────
|
|
135
|
+
".icon-weight-100": { "--md-icon-weight": "100" },
|
|
136
|
+
".icon-weight-200": { "--md-icon-weight": "200" },
|
|
137
|
+
".icon-weight-300": { "--md-icon-weight": "300" },
|
|
138
|
+
".icon-weight-400": { "--md-icon-weight": "400" },
|
|
139
|
+
".icon-weight-500": { "--md-icon-weight": "500" },
|
|
140
|
+
".icon-weight-600": { "--md-icon-weight": "600" },
|
|
141
|
+
".icon-weight-700": { "--md-icon-weight": "700" },
|
|
142
|
+
// ── Grade axis utilities ───────────────────────────────────────────────
|
|
143
|
+
// Named aliases match common usage patterns from MD3 spec.
|
|
144
|
+
".icon-grade-low": { "--md-icon-grade": "-25" },
|
|
145
|
+
".icon-grade-default": { "--md-icon-grade": "0" },
|
|
146
|
+
".icon-grade-high": { "--md-icon-grade": "200" },
|
|
147
|
+
// ── Optical size + font-size combined utilities ────────────────────────
|
|
148
|
+
// opsz axis must match the rendered size for best optical quality.
|
|
149
|
+
".icon-size-20": {
|
|
150
|
+
"--md-icon-size": "20px",
|
|
151
|
+
"--md-icon-opsz": "20",
|
|
152
|
+
fontSize: "20px",
|
|
153
|
+
},
|
|
154
|
+
".icon-size-24": {
|
|
155
|
+
"--md-icon-size": "24px",
|
|
156
|
+
"--md-icon-opsz": "24",
|
|
157
|
+
fontSize: "24px",
|
|
158
|
+
},
|
|
159
|
+
".icon-size-40": {
|
|
160
|
+
"--md-icon-size": "40px",
|
|
161
|
+
"--md-icon-opsz": "40",
|
|
162
|
+
fontSize: "40px",
|
|
163
|
+
},
|
|
164
|
+
".icon-size-48": {
|
|
165
|
+
"--md-icon-size": "48px",
|
|
166
|
+
"--md-icon-opsz": "48",
|
|
167
|
+
fontSize: "48px",
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// biome-ignore lint/suspicious/noExplicitAny: Tailwind plugin type is complex
|
|
173
|
+
export default md3Plugin as any;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"declaration": true,
|
|
11
|
+
"outDir": "dist"
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"]
|
|
14
|
+
}
|