@removify/tailwind-preset 0.0.6 → 0.0.8
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/{chunk-W4S5IMYJ.js → chunk-5LOSNWQT.js} +26 -22
- package/dist/cli.cjs +25 -19
- package/dist/cli.js +1 -1
- package/dist/index.cjs +143 -9
- package/dist/index.d.cts +308 -2
- package/dist/index.d.ts +308 -2
- package/dist/index.js +124 -4
- package/package.json +22 -20
- package/readme.md +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/theme/colors.ts
|
|
2
2
|
var colors = {
|
|
3
3
|
inherit: "inherit",
|
|
4
4
|
current: "currentColor",
|
|
@@ -10,7 +10,6 @@ var colors = {
|
|
|
10
10
|
special: "#686DF4",
|
|
11
11
|
black: "#000000",
|
|
12
12
|
white: "#FFFFFF",
|
|
13
|
-
overlay: "#00000080",
|
|
14
13
|
primary: {
|
|
15
14
|
50: "#E8F1F6",
|
|
16
15
|
100: "#BED9E6",
|
|
@@ -106,28 +105,33 @@ var colors = {
|
|
|
106
105
|
700: "#268085",
|
|
107
106
|
800: "#1B5E62",
|
|
108
107
|
900: "#113C3E"
|
|
108
|
+
},
|
|
109
|
+
red: {
|
|
110
|
+
50: "#FEEAE9",
|
|
111
|
+
100: "#FBC5C1",
|
|
112
|
+
200: "#F8A09A",
|
|
113
|
+
300: "#F47C74",
|
|
114
|
+
400: "#EF584E",
|
|
115
|
+
500: "#EA3529",
|
|
116
|
+
600: "#C32A20",
|
|
117
|
+
700: "#9B2018",
|
|
118
|
+
800: "#731610",
|
|
119
|
+
900: "#490D09"
|
|
120
|
+
},
|
|
121
|
+
amber: {
|
|
122
|
+
50: "#FFF9E8",
|
|
123
|
+
100: "#FFEEBF",
|
|
124
|
+
200: "#FFE397",
|
|
125
|
+
300: "#FFD770",
|
|
126
|
+
400: "#FECB4A",
|
|
127
|
+
500: "#FBBF24",
|
|
128
|
+
600: "#D19F1C",
|
|
129
|
+
700: "#A67E14",
|
|
130
|
+
800: "#795C0D",
|
|
131
|
+
900: "#4D3B08"
|
|
109
132
|
}
|
|
110
133
|
};
|
|
111
|
-
function config(extend = false) {
|
|
112
|
-
if (extend) {
|
|
113
|
-
return {
|
|
114
|
-
theme: {
|
|
115
|
-
extend: {
|
|
116
|
-
colors
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
return {
|
|
122
|
-
theme: {
|
|
123
|
-
colors
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
var src_default = config();
|
|
128
134
|
|
|
129
135
|
export {
|
|
130
|
-
colors
|
|
131
|
-
config,
|
|
132
|
-
src_default
|
|
136
|
+
colors
|
|
133
137
|
};
|
package/dist/cli.cjs
CHANGED
|
@@ -27,7 +27,7 @@ var import_helpers = require("yargs/helpers");
|
|
|
27
27
|
var import_yargs = __toESM(require("yargs"), 1);
|
|
28
28
|
var import_node_process = __toESM(require("process"), 1);
|
|
29
29
|
|
|
30
|
-
// src/
|
|
30
|
+
// src/theme/colors.ts
|
|
31
31
|
var colors = {
|
|
32
32
|
inherit: "inherit",
|
|
33
33
|
current: "currentColor",
|
|
@@ -39,7 +39,6 @@ var colors = {
|
|
|
39
39
|
special: "#686DF4",
|
|
40
40
|
black: "#000000",
|
|
41
41
|
white: "#FFFFFF",
|
|
42
|
-
overlay: "#00000080",
|
|
43
42
|
primary: {
|
|
44
43
|
50: "#E8F1F6",
|
|
45
44
|
100: "#BED9E6",
|
|
@@ -135,25 +134,32 @@ var colors = {
|
|
|
135
134
|
700: "#268085",
|
|
136
135
|
800: "#1B5E62",
|
|
137
136
|
900: "#113C3E"
|
|
137
|
+
},
|
|
138
|
+
red: {
|
|
139
|
+
50: "#FEEAE9",
|
|
140
|
+
100: "#FBC5C1",
|
|
141
|
+
200: "#F8A09A",
|
|
142
|
+
300: "#F47C74",
|
|
143
|
+
400: "#EF584E",
|
|
144
|
+
500: "#EA3529",
|
|
145
|
+
600: "#C32A20",
|
|
146
|
+
700: "#9B2018",
|
|
147
|
+
800: "#731610",
|
|
148
|
+
900: "#490D09"
|
|
149
|
+
},
|
|
150
|
+
amber: {
|
|
151
|
+
50: "#FFF9E8",
|
|
152
|
+
100: "#FFEEBF",
|
|
153
|
+
200: "#FFE397",
|
|
154
|
+
300: "#FFD770",
|
|
155
|
+
400: "#FECB4A",
|
|
156
|
+
500: "#FBBF24",
|
|
157
|
+
600: "#D19F1C",
|
|
158
|
+
700: "#A67E14",
|
|
159
|
+
800: "#795C0D",
|
|
160
|
+
900: "#4D3B08"
|
|
138
161
|
}
|
|
139
162
|
};
|
|
140
|
-
function config(extend = false) {
|
|
141
|
-
if (extend) {
|
|
142
|
-
return {
|
|
143
|
-
theme: {
|
|
144
|
-
extend: {
|
|
145
|
-
colors
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
return {
|
|
151
|
-
theme: {
|
|
152
|
-
colors
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
var src_default = config();
|
|
157
163
|
|
|
158
164
|
// src/cli.ts
|
|
159
165
|
var css = String.raw;
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -22,9 +22,15 @@ var src_exports = {};
|
|
|
22
22
|
__export(src_exports, {
|
|
23
23
|
colors: () => colors,
|
|
24
24
|
config: () => config,
|
|
25
|
-
default: () => src_default
|
|
25
|
+
default: () => src_default,
|
|
26
|
+
fontSizes: () => fontSizes,
|
|
27
|
+
shadows: () => shadows,
|
|
28
|
+
theme: () => theme,
|
|
29
|
+
unocssTheme: () => unocssTheme
|
|
26
30
|
});
|
|
27
31
|
module.exports = __toCommonJS(src_exports);
|
|
32
|
+
|
|
33
|
+
// src/theme/colors.ts
|
|
28
34
|
var colors = {
|
|
29
35
|
inherit: "inherit",
|
|
30
36
|
current: "currentColor",
|
|
@@ -36,7 +42,6 @@ var colors = {
|
|
|
36
42
|
special: "#686DF4",
|
|
37
43
|
black: "#000000",
|
|
38
44
|
white: "#FFFFFF",
|
|
39
|
-
overlay: "#00000080",
|
|
40
45
|
primary: {
|
|
41
46
|
50: "#E8F1F6",
|
|
42
47
|
100: "#BED9E6",
|
|
@@ -132,27 +137,156 @@ var colors = {
|
|
|
132
137
|
700: "#268085",
|
|
133
138
|
800: "#1B5E62",
|
|
134
139
|
900: "#113C3E"
|
|
140
|
+
},
|
|
141
|
+
red: {
|
|
142
|
+
50: "#FEEAE9",
|
|
143
|
+
100: "#FBC5C1",
|
|
144
|
+
200: "#F8A09A",
|
|
145
|
+
300: "#F47C74",
|
|
146
|
+
400: "#EF584E",
|
|
147
|
+
500: "#EA3529",
|
|
148
|
+
600: "#C32A20",
|
|
149
|
+
700: "#9B2018",
|
|
150
|
+
800: "#731610",
|
|
151
|
+
900: "#490D09"
|
|
152
|
+
},
|
|
153
|
+
amber: {
|
|
154
|
+
50: "#FFF9E8",
|
|
155
|
+
100: "#FFEEBF",
|
|
156
|
+
200: "#FFE397",
|
|
157
|
+
300: "#FFD770",
|
|
158
|
+
400: "#FECB4A",
|
|
159
|
+
500: "#FBBF24",
|
|
160
|
+
600: "#D19F1C",
|
|
161
|
+
700: "#A67E14",
|
|
162
|
+
800: "#795C0D",
|
|
163
|
+
900: "#4D3B08"
|
|
135
164
|
}
|
|
136
165
|
};
|
|
166
|
+
|
|
167
|
+
// src/util/font.ts
|
|
168
|
+
var import_string_ts = require("string-ts");
|
|
169
|
+
|
|
170
|
+
// src/types/fontSize.ts
|
|
171
|
+
function isDetailFont(value) {
|
|
172
|
+
return Array.isArray(value) && typeof value[1] === "object";
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// src/util/font.ts
|
|
176
|
+
var entries = Object.entries;
|
|
177
|
+
function fontConfigKeysKebabCase(fontConfig) {
|
|
178
|
+
const result = {};
|
|
179
|
+
for (const [key, value] of entries(fontConfig)) {
|
|
180
|
+
if (value) {
|
|
181
|
+
if (isDetailFont(value)) {
|
|
182
|
+
const [size, detail] = value;
|
|
183
|
+
const kebabDetail = (0, import_string_ts.kebabKeys)(detail);
|
|
184
|
+
result[key] = [size, kebabDetail];
|
|
185
|
+
} else {
|
|
186
|
+
result[key] = value;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return result;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// src/theme/fontSize.ts
|
|
194
|
+
var fontSizes = {
|
|
195
|
+
"2xs": ["0.6875rem", "1rem"],
|
|
196
|
+
"xs": ["0.75rem", "1rem"],
|
|
197
|
+
"sm": ["0.875rem", "1.25rem"],
|
|
198
|
+
"base": ["1rem", "1.5rem"],
|
|
199
|
+
"lg": ["1.25rem", "1.625rem"],
|
|
200
|
+
"display1": ["3.75rem", {
|
|
201
|
+
fontWeight: 700,
|
|
202
|
+
lineHeight: "5rem",
|
|
203
|
+
letterSpacing: "-0.0625rem"
|
|
204
|
+
}],
|
|
205
|
+
"display2": ["3.25rem", {
|
|
206
|
+
fontWeight: 700,
|
|
207
|
+
lineHeight: "4.25rem",
|
|
208
|
+
letterSpacing: "-0.05rem"
|
|
209
|
+
}],
|
|
210
|
+
"display3": ["2.75rem", {
|
|
211
|
+
fontWeight: 700,
|
|
212
|
+
lineHeight: "3.625rem",
|
|
213
|
+
letterSpacing: "-0.0375rem"
|
|
214
|
+
}],
|
|
215
|
+
"h1": ["3rem", {
|
|
216
|
+
fontWeight: 700,
|
|
217
|
+
lineHeight: "3.75rem",
|
|
218
|
+
letterSpacing: "-0.0125rem"
|
|
219
|
+
}],
|
|
220
|
+
"h2": ["2.5rem", {
|
|
221
|
+
fontWeight: 700,
|
|
222
|
+
lineHeight: "3.25rem",
|
|
223
|
+
letterSpacing: "-0.0125rem"
|
|
224
|
+
}],
|
|
225
|
+
"h3": ["2.25rem", {
|
|
226
|
+
fontWeight: 700,
|
|
227
|
+
lineHeight: "3rem",
|
|
228
|
+
letterSpacing: "-0.0125rem"
|
|
229
|
+
}],
|
|
230
|
+
"h4": ["2rem", {
|
|
231
|
+
fontWeight: 700,
|
|
232
|
+
lineHeight: "2.625rem",
|
|
233
|
+
letterSpacing: "-0.0125rem"
|
|
234
|
+
}],
|
|
235
|
+
"h5": ["1.5rem", {
|
|
236
|
+
fontWeight: 700,
|
|
237
|
+
lineHeight: "2rem",
|
|
238
|
+
letterSpacing: "-0.0125rem"
|
|
239
|
+
}],
|
|
240
|
+
"h6": ["1.25rem", {
|
|
241
|
+
fontWeight: 700,
|
|
242
|
+
lineHeight: "1.625rem",
|
|
243
|
+
letterSpacing: "-0.0125rem"
|
|
244
|
+
}]
|
|
245
|
+
};
|
|
246
|
+
var unocssFontSizes = fontConfigKeysKebabCase(fontSizes);
|
|
247
|
+
|
|
248
|
+
// src/theme/shadows.ts
|
|
249
|
+
var shadows = {
|
|
250
|
+
"elevation-0": "0 0 0 0 rgba(0, 0, 0, 0.10)",
|
|
251
|
+
"elevation-1": "0 1px 2px 0 rgba(0, 0, 0, 0.10)",
|
|
252
|
+
"elevation-2": "0 4px 8px 0 rgba(0, 0, 0, 0.10)",
|
|
253
|
+
"elevation-3": "0 6px 12px 0 rgba(0, 0, 0, 0.10)",
|
|
254
|
+
"elevation-4": "0 8px 16px 0 rgba(0, 0, 0, 0.10)",
|
|
255
|
+
"elevation-5": "0 12px 24px 0 rgba(0, 0, 0, 0.10)"
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
// src/theme/index.ts
|
|
259
|
+
var theme = {
|
|
260
|
+
colors,
|
|
261
|
+
boxShadow: shadows,
|
|
262
|
+
fontSize: fontSizes
|
|
263
|
+
};
|
|
264
|
+
var unocssTheme = {
|
|
265
|
+
colors,
|
|
266
|
+
boxShadow: shadows,
|
|
267
|
+
fontSize: unocssFontSizes
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
// src/index.ts
|
|
137
271
|
function config(extend = false) {
|
|
138
272
|
if (extend) {
|
|
139
273
|
return {
|
|
140
274
|
theme: {
|
|
141
|
-
extend:
|
|
142
|
-
colors
|
|
143
|
-
}
|
|
275
|
+
extend: theme
|
|
144
276
|
}
|
|
145
277
|
};
|
|
146
278
|
}
|
|
147
279
|
return {
|
|
148
|
-
theme
|
|
149
|
-
colors
|
|
150
|
-
}
|
|
280
|
+
theme
|
|
151
281
|
};
|
|
152
282
|
}
|
|
153
283
|
var src_default = config();
|
|
154
284
|
// Annotate the CommonJS export names for ESM import in node:
|
|
155
285
|
0 && (module.exports = {
|
|
156
286
|
colors,
|
|
157
|
-
config
|
|
287
|
+
config,
|
|
288
|
+
fontSizes,
|
|
289
|
+
shadows,
|
|
290
|
+
theme,
|
|
291
|
+
unocssTheme
|
|
158
292
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
import * as tailwindcss_types_config from 'tailwindcss/types/config';
|
|
2
2
|
import { Config } from 'tailwindcss';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Converts the given string from camel-case to kebab-case.
|
|
6
|
+
* @template T The string to convert the case.
|
|
7
|
+
* @see https://gist.github.com/albertms10/09f14ef7ebdc3ce0e95683c728616253
|
|
8
|
+
* @example
|
|
9
|
+
* type Kebab = CamelToKebab<'exampleVarName'>;
|
|
10
|
+
* // 'example-var-name'
|
|
11
|
+
*/
|
|
12
|
+
type CamelToKebab<S extends string> = S extends `${infer T}${infer U}` ? U extends Uncapitalize<U> ? `${Uncapitalize<T>}${CamelToKebab<U>}` : `${Uncapitalize<T>}-${CamelToKebab<U>}` : '';
|
|
13
|
+
type CamelToKebabKeys<T> = {
|
|
14
|
+
[K in keyof T as K extends string ? CamelToKebab<K> : K]: T[K];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* tailwindcss font-size configuration
|
|
19
|
+
* @see https://tailwindcss.com/docs/font-size
|
|
20
|
+
*
|
|
21
|
+
* @note For unocss, the keys are kebab-case
|
|
22
|
+
* @see https://github.com/unocss/unocss/issues/3663#issuecomment-2024909371
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
interface FontSizeDetail {
|
|
26
|
+
lineHeight?: string;
|
|
27
|
+
letterSpacing?: string;
|
|
28
|
+
fontWeight?: number;
|
|
29
|
+
}
|
|
30
|
+
type FontValue = `${number}px` | `${number}rem`;
|
|
31
|
+
type FontAndLineHeight = [FontValue, FontValue];
|
|
32
|
+
type DetailFont = [
|
|
33
|
+
FontValue,
|
|
34
|
+
FontSizeDetail
|
|
35
|
+
];
|
|
36
|
+
type UnocssDetailFont = [FontValue, CamelToKebabKeys<FontSizeDetail>];
|
|
37
|
+
type FontSize = FontAndLineHeight | FontValue | DetailFont;
|
|
38
|
+
type UnocssFontSize = FontValue | FontAndLineHeight | UnocssDetailFont;
|
|
39
|
+
type SizeKeys = `${number}xs` | 'xs' | 'sm' | 'base' | 'lg' | 'xl' | `${number}xl`;
|
|
40
|
+
type HeadingKeys = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
41
|
+
type DisplayKeys = 'display1' | 'display2' | 'display3' | 'display4';
|
|
42
|
+
type FontSizeKeys = SizeKeys | HeadingKeys | DisplayKeys;
|
|
43
|
+
type FontSizes = {
|
|
44
|
+
[K in FontSizeKeys]?: FontSize;
|
|
45
|
+
};
|
|
46
|
+
type UnocssFontSizes = {
|
|
47
|
+
[K in FontSizeKeys]?: UnocssFontSize;
|
|
48
|
+
};
|
|
49
|
+
|
|
4
50
|
declare const colors: {
|
|
5
51
|
inherit: "inherit";
|
|
6
52
|
current: "currentColor";
|
|
@@ -12,7 +58,6 @@ declare const colors: {
|
|
|
12
58
|
special: string;
|
|
13
59
|
black: string;
|
|
14
60
|
white: string;
|
|
15
|
-
overlay: string;
|
|
16
61
|
primary: {
|
|
17
62
|
50: string;
|
|
18
63
|
100: string;
|
|
@@ -109,8 +154,269 @@ declare const colors: {
|
|
|
109
154
|
800: string;
|
|
110
155
|
900: string;
|
|
111
156
|
};
|
|
157
|
+
red: {
|
|
158
|
+
50: string;
|
|
159
|
+
100: string;
|
|
160
|
+
200: string;
|
|
161
|
+
300: string;
|
|
162
|
+
400: string;
|
|
163
|
+
500: string;
|
|
164
|
+
600: string;
|
|
165
|
+
700: string;
|
|
166
|
+
800: string;
|
|
167
|
+
900: string;
|
|
168
|
+
};
|
|
169
|
+
amber: {
|
|
170
|
+
50: string;
|
|
171
|
+
100: string;
|
|
172
|
+
200: string;
|
|
173
|
+
300: string;
|
|
174
|
+
400: string;
|
|
175
|
+
500: string;
|
|
176
|
+
600: string;
|
|
177
|
+
700: string;
|
|
178
|
+
800: string;
|
|
179
|
+
900: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
declare const fontSizes: {
|
|
184
|
+
'2xs': ["0.6875rem", "1rem"];
|
|
185
|
+
xs: ["0.75rem", "1rem"];
|
|
186
|
+
sm: ["0.875rem", "1.25rem"];
|
|
187
|
+
base: ["1rem", "1.5rem"];
|
|
188
|
+
lg: ["1.25rem", "1.625rem"];
|
|
189
|
+
display1: ["3.75rem", {
|
|
190
|
+
fontWeight: number;
|
|
191
|
+
lineHeight: string;
|
|
192
|
+
letterSpacing: string;
|
|
193
|
+
}];
|
|
194
|
+
display2: ["3.25rem", {
|
|
195
|
+
fontWeight: number;
|
|
196
|
+
lineHeight: string;
|
|
197
|
+
letterSpacing: string;
|
|
198
|
+
}];
|
|
199
|
+
display3: ["2.75rem", {
|
|
200
|
+
fontWeight: number;
|
|
201
|
+
lineHeight: string;
|
|
202
|
+
letterSpacing: string;
|
|
203
|
+
}];
|
|
204
|
+
h1: ["3rem", {
|
|
205
|
+
fontWeight: number;
|
|
206
|
+
lineHeight: string;
|
|
207
|
+
letterSpacing: string;
|
|
208
|
+
}];
|
|
209
|
+
h2: ["2.5rem", {
|
|
210
|
+
fontWeight: number;
|
|
211
|
+
lineHeight: string;
|
|
212
|
+
letterSpacing: string;
|
|
213
|
+
}];
|
|
214
|
+
h3: ["2.25rem", {
|
|
215
|
+
fontWeight: number;
|
|
216
|
+
lineHeight: string;
|
|
217
|
+
letterSpacing: string;
|
|
218
|
+
}];
|
|
219
|
+
h4: ["2rem", {
|
|
220
|
+
fontWeight: number;
|
|
221
|
+
lineHeight: string;
|
|
222
|
+
letterSpacing: string;
|
|
223
|
+
}];
|
|
224
|
+
h5: ["1.5rem", {
|
|
225
|
+
fontWeight: number;
|
|
226
|
+
lineHeight: string;
|
|
227
|
+
letterSpacing: string;
|
|
228
|
+
}];
|
|
229
|
+
h6: ["1.25rem", {
|
|
230
|
+
fontWeight: number;
|
|
231
|
+
lineHeight: string;
|
|
232
|
+
letterSpacing: string;
|
|
233
|
+
}];
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
declare const shadows: {
|
|
237
|
+
'elevation-0': "0 0 0 0 rgba(0, 0, 0, 0.10)";
|
|
238
|
+
'elevation-1': "0 1px 2px 0 rgba(0, 0, 0, 0.10)";
|
|
239
|
+
'elevation-2': "0 4px 8px 0 rgba(0, 0, 0, 0.10)";
|
|
240
|
+
'elevation-3': "0 6px 12px 0 rgba(0, 0, 0, 0.10)";
|
|
241
|
+
'elevation-4': "0 8px 16px 0 rgba(0, 0, 0, 0.10)";
|
|
242
|
+
'elevation-5': "0 12px 24px 0 rgba(0, 0, 0, 0.10)";
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
declare const theme: Config['theme'];
|
|
246
|
+
declare const unocssTheme: {
|
|
247
|
+
colors: {
|
|
248
|
+
inherit: "inherit";
|
|
249
|
+
current: "currentColor";
|
|
250
|
+
transparent: "transparent";
|
|
251
|
+
danger: string;
|
|
252
|
+
warning: string;
|
|
253
|
+
success: string;
|
|
254
|
+
info: string;
|
|
255
|
+
special: string;
|
|
256
|
+
black: string;
|
|
257
|
+
white: string;
|
|
258
|
+
primary: {
|
|
259
|
+
50: string;
|
|
260
|
+
100: string;
|
|
261
|
+
200: string;
|
|
262
|
+
300: string;
|
|
263
|
+
400: string;
|
|
264
|
+
500: string;
|
|
265
|
+
600: string;
|
|
266
|
+
700: string;
|
|
267
|
+
800: string;
|
|
268
|
+
900: string;
|
|
269
|
+
};
|
|
270
|
+
secondary: {
|
|
271
|
+
50: string;
|
|
272
|
+
100: string;
|
|
273
|
+
200: string;
|
|
274
|
+
300: string;
|
|
275
|
+
400: string;
|
|
276
|
+
500: string;
|
|
277
|
+
600: string;
|
|
278
|
+
700: string;
|
|
279
|
+
800: string;
|
|
280
|
+
900: string;
|
|
281
|
+
};
|
|
282
|
+
green: {
|
|
283
|
+
50: string;
|
|
284
|
+
100: string;
|
|
285
|
+
200: string;
|
|
286
|
+
300: string;
|
|
287
|
+
400: string;
|
|
288
|
+
500: string;
|
|
289
|
+
600: string;
|
|
290
|
+
700: string;
|
|
291
|
+
800: string;
|
|
292
|
+
900: string;
|
|
293
|
+
};
|
|
294
|
+
fuchsia: {
|
|
295
|
+
50: string;
|
|
296
|
+
100: string;
|
|
297
|
+
200: string;
|
|
298
|
+
300: string;
|
|
299
|
+
400: string;
|
|
300
|
+
500: string;
|
|
301
|
+
600: string;
|
|
302
|
+
700: string;
|
|
303
|
+
800: string;
|
|
304
|
+
900: string;
|
|
305
|
+
};
|
|
306
|
+
indigo: {
|
|
307
|
+
50: string;
|
|
308
|
+
100: string;
|
|
309
|
+
200: string;
|
|
310
|
+
300: string;
|
|
311
|
+
400: string;
|
|
312
|
+
500: string;
|
|
313
|
+
600: string;
|
|
314
|
+
700: string;
|
|
315
|
+
800: string;
|
|
316
|
+
900: string;
|
|
317
|
+
};
|
|
318
|
+
neutral: {
|
|
319
|
+
50: string;
|
|
320
|
+
100: string;
|
|
321
|
+
200: string;
|
|
322
|
+
300: string;
|
|
323
|
+
400: string;
|
|
324
|
+
500: string;
|
|
325
|
+
600: string;
|
|
326
|
+
700: string;
|
|
327
|
+
800: string;
|
|
328
|
+
900: string;
|
|
329
|
+
};
|
|
330
|
+
orange: {
|
|
331
|
+
50: string;
|
|
332
|
+
100: string;
|
|
333
|
+
200: string;
|
|
334
|
+
300: string;
|
|
335
|
+
400: string;
|
|
336
|
+
500: string;
|
|
337
|
+
600: string;
|
|
338
|
+
700: string;
|
|
339
|
+
800: string;
|
|
340
|
+
900: string;
|
|
341
|
+
};
|
|
342
|
+
seafoam: {
|
|
343
|
+
50: string;
|
|
344
|
+
100: string;
|
|
345
|
+
200: string;
|
|
346
|
+
300: string;
|
|
347
|
+
400: string;
|
|
348
|
+
500: string;
|
|
349
|
+
600: string;
|
|
350
|
+
700: string;
|
|
351
|
+
800: string;
|
|
352
|
+
900: string;
|
|
353
|
+
};
|
|
354
|
+
red: {
|
|
355
|
+
50: string;
|
|
356
|
+
100: string;
|
|
357
|
+
200: string;
|
|
358
|
+
300: string;
|
|
359
|
+
400: string;
|
|
360
|
+
500: string;
|
|
361
|
+
600: string;
|
|
362
|
+
700: string;
|
|
363
|
+
800: string;
|
|
364
|
+
900: string;
|
|
365
|
+
};
|
|
366
|
+
amber: {
|
|
367
|
+
50: string;
|
|
368
|
+
100: string;
|
|
369
|
+
200: string;
|
|
370
|
+
300: string;
|
|
371
|
+
400: string;
|
|
372
|
+
500: string;
|
|
373
|
+
600: string;
|
|
374
|
+
700: string;
|
|
375
|
+
800: string;
|
|
376
|
+
900: string;
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
boxShadow: {
|
|
380
|
+
'elevation-0': "0 0 0 0 rgba(0, 0, 0, 0.10)";
|
|
381
|
+
'elevation-1': "0 1px 2px 0 rgba(0, 0, 0, 0.10)";
|
|
382
|
+
'elevation-2': "0 4px 8px 0 rgba(0, 0, 0, 0.10)";
|
|
383
|
+
'elevation-3': "0 6px 12px 0 rgba(0, 0, 0, 0.10)";
|
|
384
|
+
'elevation-4': "0 8px 16px 0 rgba(0, 0, 0, 0.10)";
|
|
385
|
+
'elevation-5': "0 12px 24px 0 rgba(0, 0, 0, 0.10)";
|
|
386
|
+
};
|
|
387
|
+
fontSize: UnocssFontSizes;
|
|
112
388
|
};
|
|
389
|
+
|
|
390
|
+
type ColorsNames = 'primary' | 'secondary' | 'green' | 'fuchsia' | 'indigo' | 'neutral' | 'orange' | 'red' | 'amber' | 'seafoam';
|
|
391
|
+
type ColorsVariations = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
392
|
+
interface MainColors {
|
|
393
|
+
black: string;
|
|
394
|
+
white: string;
|
|
395
|
+
inherit: 'inherit';
|
|
396
|
+
current: 'currentColor';
|
|
397
|
+
transparent: 'transparent';
|
|
398
|
+
}
|
|
399
|
+
interface DefaultColors {
|
|
400
|
+
danger: string;
|
|
401
|
+
warning: string;
|
|
402
|
+
success: string;
|
|
403
|
+
info: string;
|
|
404
|
+
special: string;
|
|
405
|
+
}
|
|
406
|
+
type Colors = DefaultColors & MainColors & Record<ColorsNames, {
|
|
407
|
+
[K in ColorsVariations]: string;
|
|
408
|
+
}>;
|
|
409
|
+
type ColorString = `${ColorsNames}-${ColorsVariations}` | keyof DefaultColors | keyof MainColors;
|
|
410
|
+
|
|
411
|
+
type BorderSize = 0 | `${number}px`;
|
|
412
|
+
type RgbValue = number;
|
|
413
|
+
type Shadow = `${BorderSize} ${BorderSize} ${BorderSize} ${BorderSize} rgba(${RgbValue}, ${RgbValue}, ${RgbValue}, ${RgbValue})`;
|
|
414
|
+
type ShadowSize = 0 | 1 | 2 | 3 | 4 | 5;
|
|
415
|
+
type Shadows = {
|
|
416
|
+
[K in ShadowSize as `elevation-${K}`]?: Shadow;
|
|
417
|
+
};
|
|
418
|
+
|
|
113
419
|
declare function config(extend?: boolean): Partial<Config>;
|
|
114
420
|
declare const _default: Partial<tailwindcss_types_config.Config>;
|
|
115
421
|
|
|
116
|
-
export { colors, config, _default as default };
|
|
422
|
+
export { type ColorString, type Colors, type FontSizes, type Shadows, colors, config, _default as default, fontSizes, shadows, theme, unocssTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
import * as tailwindcss_types_config from 'tailwindcss/types/config';
|
|
2
2
|
import { Config } from 'tailwindcss';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Converts the given string from camel-case to kebab-case.
|
|
6
|
+
* @template T The string to convert the case.
|
|
7
|
+
* @see https://gist.github.com/albertms10/09f14ef7ebdc3ce0e95683c728616253
|
|
8
|
+
* @example
|
|
9
|
+
* type Kebab = CamelToKebab<'exampleVarName'>;
|
|
10
|
+
* // 'example-var-name'
|
|
11
|
+
*/
|
|
12
|
+
type CamelToKebab<S extends string> = S extends `${infer T}${infer U}` ? U extends Uncapitalize<U> ? `${Uncapitalize<T>}${CamelToKebab<U>}` : `${Uncapitalize<T>}-${CamelToKebab<U>}` : '';
|
|
13
|
+
type CamelToKebabKeys<T> = {
|
|
14
|
+
[K in keyof T as K extends string ? CamelToKebab<K> : K]: T[K];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* tailwindcss font-size configuration
|
|
19
|
+
* @see https://tailwindcss.com/docs/font-size
|
|
20
|
+
*
|
|
21
|
+
* @note For unocss, the keys are kebab-case
|
|
22
|
+
* @see https://github.com/unocss/unocss/issues/3663#issuecomment-2024909371
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
interface FontSizeDetail {
|
|
26
|
+
lineHeight?: string;
|
|
27
|
+
letterSpacing?: string;
|
|
28
|
+
fontWeight?: number;
|
|
29
|
+
}
|
|
30
|
+
type FontValue = `${number}px` | `${number}rem`;
|
|
31
|
+
type FontAndLineHeight = [FontValue, FontValue];
|
|
32
|
+
type DetailFont = [
|
|
33
|
+
FontValue,
|
|
34
|
+
FontSizeDetail
|
|
35
|
+
];
|
|
36
|
+
type UnocssDetailFont = [FontValue, CamelToKebabKeys<FontSizeDetail>];
|
|
37
|
+
type FontSize = FontAndLineHeight | FontValue | DetailFont;
|
|
38
|
+
type UnocssFontSize = FontValue | FontAndLineHeight | UnocssDetailFont;
|
|
39
|
+
type SizeKeys = `${number}xs` | 'xs' | 'sm' | 'base' | 'lg' | 'xl' | `${number}xl`;
|
|
40
|
+
type HeadingKeys = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
41
|
+
type DisplayKeys = 'display1' | 'display2' | 'display3' | 'display4';
|
|
42
|
+
type FontSizeKeys = SizeKeys | HeadingKeys | DisplayKeys;
|
|
43
|
+
type FontSizes = {
|
|
44
|
+
[K in FontSizeKeys]?: FontSize;
|
|
45
|
+
};
|
|
46
|
+
type UnocssFontSizes = {
|
|
47
|
+
[K in FontSizeKeys]?: UnocssFontSize;
|
|
48
|
+
};
|
|
49
|
+
|
|
4
50
|
declare const colors: {
|
|
5
51
|
inherit: "inherit";
|
|
6
52
|
current: "currentColor";
|
|
@@ -12,7 +58,6 @@ declare const colors: {
|
|
|
12
58
|
special: string;
|
|
13
59
|
black: string;
|
|
14
60
|
white: string;
|
|
15
|
-
overlay: string;
|
|
16
61
|
primary: {
|
|
17
62
|
50: string;
|
|
18
63
|
100: string;
|
|
@@ -109,8 +154,269 @@ declare const colors: {
|
|
|
109
154
|
800: string;
|
|
110
155
|
900: string;
|
|
111
156
|
};
|
|
157
|
+
red: {
|
|
158
|
+
50: string;
|
|
159
|
+
100: string;
|
|
160
|
+
200: string;
|
|
161
|
+
300: string;
|
|
162
|
+
400: string;
|
|
163
|
+
500: string;
|
|
164
|
+
600: string;
|
|
165
|
+
700: string;
|
|
166
|
+
800: string;
|
|
167
|
+
900: string;
|
|
168
|
+
};
|
|
169
|
+
amber: {
|
|
170
|
+
50: string;
|
|
171
|
+
100: string;
|
|
172
|
+
200: string;
|
|
173
|
+
300: string;
|
|
174
|
+
400: string;
|
|
175
|
+
500: string;
|
|
176
|
+
600: string;
|
|
177
|
+
700: string;
|
|
178
|
+
800: string;
|
|
179
|
+
900: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
declare const fontSizes: {
|
|
184
|
+
'2xs': ["0.6875rem", "1rem"];
|
|
185
|
+
xs: ["0.75rem", "1rem"];
|
|
186
|
+
sm: ["0.875rem", "1.25rem"];
|
|
187
|
+
base: ["1rem", "1.5rem"];
|
|
188
|
+
lg: ["1.25rem", "1.625rem"];
|
|
189
|
+
display1: ["3.75rem", {
|
|
190
|
+
fontWeight: number;
|
|
191
|
+
lineHeight: string;
|
|
192
|
+
letterSpacing: string;
|
|
193
|
+
}];
|
|
194
|
+
display2: ["3.25rem", {
|
|
195
|
+
fontWeight: number;
|
|
196
|
+
lineHeight: string;
|
|
197
|
+
letterSpacing: string;
|
|
198
|
+
}];
|
|
199
|
+
display3: ["2.75rem", {
|
|
200
|
+
fontWeight: number;
|
|
201
|
+
lineHeight: string;
|
|
202
|
+
letterSpacing: string;
|
|
203
|
+
}];
|
|
204
|
+
h1: ["3rem", {
|
|
205
|
+
fontWeight: number;
|
|
206
|
+
lineHeight: string;
|
|
207
|
+
letterSpacing: string;
|
|
208
|
+
}];
|
|
209
|
+
h2: ["2.5rem", {
|
|
210
|
+
fontWeight: number;
|
|
211
|
+
lineHeight: string;
|
|
212
|
+
letterSpacing: string;
|
|
213
|
+
}];
|
|
214
|
+
h3: ["2.25rem", {
|
|
215
|
+
fontWeight: number;
|
|
216
|
+
lineHeight: string;
|
|
217
|
+
letterSpacing: string;
|
|
218
|
+
}];
|
|
219
|
+
h4: ["2rem", {
|
|
220
|
+
fontWeight: number;
|
|
221
|
+
lineHeight: string;
|
|
222
|
+
letterSpacing: string;
|
|
223
|
+
}];
|
|
224
|
+
h5: ["1.5rem", {
|
|
225
|
+
fontWeight: number;
|
|
226
|
+
lineHeight: string;
|
|
227
|
+
letterSpacing: string;
|
|
228
|
+
}];
|
|
229
|
+
h6: ["1.25rem", {
|
|
230
|
+
fontWeight: number;
|
|
231
|
+
lineHeight: string;
|
|
232
|
+
letterSpacing: string;
|
|
233
|
+
}];
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
declare const shadows: {
|
|
237
|
+
'elevation-0': "0 0 0 0 rgba(0, 0, 0, 0.10)";
|
|
238
|
+
'elevation-1': "0 1px 2px 0 rgba(0, 0, 0, 0.10)";
|
|
239
|
+
'elevation-2': "0 4px 8px 0 rgba(0, 0, 0, 0.10)";
|
|
240
|
+
'elevation-3': "0 6px 12px 0 rgba(0, 0, 0, 0.10)";
|
|
241
|
+
'elevation-4': "0 8px 16px 0 rgba(0, 0, 0, 0.10)";
|
|
242
|
+
'elevation-5': "0 12px 24px 0 rgba(0, 0, 0, 0.10)";
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
declare const theme: Config['theme'];
|
|
246
|
+
declare const unocssTheme: {
|
|
247
|
+
colors: {
|
|
248
|
+
inherit: "inherit";
|
|
249
|
+
current: "currentColor";
|
|
250
|
+
transparent: "transparent";
|
|
251
|
+
danger: string;
|
|
252
|
+
warning: string;
|
|
253
|
+
success: string;
|
|
254
|
+
info: string;
|
|
255
|
+
special: string;
|
|
256
|
+
black: string;
|
|
257
|
+
white: string;
|
|
258
|
+
primary: {
|
|
259
|
+
50: string;
|
|
260
|
+
100: string;
|
|
261
|
+
200: string;
|
|
262
|
+
300: string;
|
|
263
|
+
400: string;
|
|
264
|
+
500: string;
|
|
265
|
+
600: string;
|
|
266
|
+
700: string;
|
|
267
|
+
800: string;
|
|
268
|
+
900: string;
|
|
269
|
+
};
|
|
270
|
+
secondary: {
|
|
271
|
+
50: string;
|
|
272
|
+
100: string;
|
|
273
|
+
200: string;
|
|
274
|
+
300: string;
|
|
275
|
+
400: string;
|
|
276
|
+
500: string;
|
|
277
|
+
600: string;
|
|
278
|
+
700: string;
|
|
279
|
+
800: string;
|
|
280
|
+
900: string;
|
|
281
|
+
};
|
|
282
|
+
green: {
|
|
283
|
+
50: string;
|
|
284
|
+
100: string;
|
|
285
|
+
200: string;
|
|
286
|
+
300: string;
|
|
287
|
+
400: string;
|
|
288
|
+
500: string;
|
|
289
|
+
600: string;
|
|
290
|
+
700: string;
|
|
291
|
+
800: string;
|
|
292
|
+
900: string;
|
|
293
|
+
};
|
|
294
|
+
fuchsia: {
|
|
295
|
+
50: string;
|
|
296
|
+
100: string;
|
|
297
|
+
200: string;
|
|
298
|
+
300: string;
|
|
299
|
+
400: string;
|
|
300
|
+
500: string;
|
|
301
|
+
600: string;
|
|
302
|
+
700: string;
|
|
303
|
+
800: string;
|
|
304
|
+
900: string;
|
|
305
|
+
};
|
|
306
|
+
indigo: {
|
|
307
|
+
50: string;
|
|
308
|
+
100: string;
|
|
309
|
+
200: string;
|
|
310
|
+
300: string;
|
|
311
|
+
400: string;
|
|
312
|
+
500: string;
|
|
313
|
+
600: string;
|
|
314
|
+
700: string;
|
|
315
|
+
800: string;
|
|
316
|
+
900: string;
|
|
317
|
+
};
|
|
318
|
+
neutral: {
|
|
319
|
+
50: string;
|
|
320
|
+
100: string;
|
|
321
|
+
200: string;
|
|
322
|
+
300: string;
|
|
323
|
+
400: string;
|
|
324
|
+
500: string;
|
|
325
|
+
600: string;
|
|
326
|
+
700: string;
|
|
327
|
+
800: string;
|
|
328
|
+
900: string;
|
|
329
|
+
};
|
|
330
|
+
orange: {
|
|
331
|
+
50: string;
|
|
332
|
+
100: string;
|
|
333
|
+
200: string;
|
|
334
|
+
300: string;
|
|
335
|
+
400: string;
|
|
336
|
+
500: string;
|
|
337
|
+
600: string;
|
|
338
|
+
700: string;
|
|
339
|
+
800: string;
|
|
340
|
+
900: string;
|
|
341
|
+
};
|
|
342
|
+
seafoam: {
|
|
343
|
+
50: string;
|
|
344
|
+
100: string;
|
|
345
|
+
200: string;
|
|
346
|
+
300: string;
|
|
347
|
+
400: string;
|
|
348
|
+
500: string;
|
|
349
|
+
600: string;
|
|
350
|
+
700: string;
|
|
351
|
+
800: string;
|
|
352
|
+
900: string;
|
|
353
|
+
};
|
|
354
|
+
red: {
|
|
355
|
+
50: string;
|
|
356
|
+
100: string;
|
|
357
|
+
200: string;
|
|
358
|
+
300: string;
|
|
359
|
+
400: string;
|
|
360
|
+
500: string;
|
|
361
|
+
600: string;
|
|
362
|
+
700: string;
|
|
363
|
+
800: string;
|
|
364
|
+
900: string;
|
|
365
|
+
};
|
|
366
|
+
amber: {
|
|
367
|
+
50: string;
|
|
368
|
+
100: string;
|
|
369
|
+
200: string;
|
|
370
|
+
300: string;
|
|
371
|
+
400: string;
|
|
372
|
+
500: string;
|
|
373
|
+
600: string;
|
|
374
|
+
700: string;
|
|
375
|
+
800: string;
|
|
376
|
+
900: string;
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
boxShadow: {
|
|
380
|
+
'elevation-0': "0 0 0 0 rgba(0, 0, 0, 0.10)";
|
|
381
|
+
'elevation-1': "0 1px 2px 0 rgba(0, 0, 0, 0.10)";
|
|
382
|
+
'elevation-2': "0 4px 8px 0 rgba(0, 0, 0, 0.10)";
|
|
383
|
+
'elevation-3': "0 6px 12px 0 rgba(0, 0, 0, 0.10)";
|
|
384
|
+
'elevation-4': "0 8px 16px 0 rgba(0, 0, 0, 0.10)";
|
|
385
|
+
'elevation-5': "0 12px 24px 0 rgba(0, 0, 0, 0.10)";
|
|
386
|
+
};
|
|
387
|
+
fontSize: UnocssFontSizes;
|
|
112
388
|
};
|
|
389
|
+
|
|
390
|
+
type ColorsNames = 'primary' | 'secondary' | 'green' | 'fuchsia' | 'indigo' | 'neutral' | 'orange' | 'red' | 'amber' | 'seafoam';
|
|
391
|
+
type ColorsVariations = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
392
|
+
interface MainColors {
|
|
393
|
+
black: string;
|
|
394
|
+
white: string;
|
|
395
|
+
inherit: 'inherit';
|
|
396
|
+
current: 'currentColor';
|
|
397
|
+
transparent: 'transparent';
|
|
398
|
+
}
|
|
399
|
+
interface DefaultColors {
|
|
400
|
+
danger: string;
|
|
401
|
+
warning: string;
|
|
402
|
+
success: string;
|
|
403
|
+
info: string;
|
|
404
|
+
special: string;
|
|
405
|
+
}
|
|
406
|
+
type Colors = DefaultColors & MainColors & Record<ColorsNames, {
|
|
407
|
+
[K in ColorsVariations]: string;
|
|
408
|
+
}>;
|
|
409
|
+
type ColorString = `${ColorsNames}-${ColorsVariations}` | keyof DefaultColors | keyof MainColors;
|
|
410
|
+
|
|
411
|
+
type BorderSize = 0 | `${number}px`;
|
|
412
|
+
type RgbValue = number;
|
|
413
|
+
type Shadow = `${BorderSize} ${BorderSize} ${BorderSize} ${BorderSize} rgba(${RgbValue}, ${RgbValue}, ${RgbValue}, ${RgbValue})`;
|
|
414
|
+
type ShadowSize = 0 | 1 | 2 | 3 | 4 | 5;
|
|
415
|
+
type Shadows = {
|
|
416
|
+
[K in ShadowSize as `elevation-${K}`]?: Shadow;
|
|
417
|
+
};
|
|
418
|
+
|
|
113
419
|
declare function config(extend?: boolean): Partial<Config>;
|
|
114
420
|
declare const _default: Partial<tailwindcss_types_config.Config>;
|
|
115
421
|
|
|
116
|
-
export { colors, config, _default as default };
|
|
422
|
+
export { type ColorString, type Colors, type FontSizes, type Shadows, colors, config, _default as default, fontSizes, shadows, theme, unocssTheme };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,130 @@
|
|
|
1
1
|
import {
|
|
2
|
+
colors
|
|
3
|
+
} from "./chunk-5LOSNWQT.js";
|
|
4
|
+
|
|
5
|
+
// src/util/font.ts
|
|
6
|
+
import { kebabKeys } from "string-ts";
|
|
7
|
+
|
|
8
|
+
// src/types/fontSize.ts
|
|
9
|
+
function isDetailFont(value) {
|
|
10
|
+
return Array.isArray(value) && typeof value[1] === "object";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// src/util/font.ts
|
|
14
|
+
var entries = Object.entries;
|
|
15
|
+
function fontConfigKeysKebabCase(fontConfig) {
|
|
16
|
+
const result = {};
|
|
17
|
+
for (const [key, value] of entries(fontConfig)) {
|
|
18
|
+
if (value) {
|
|
19
|
+
if (isDetailFont(value)) {
|
|
20
|
+
const [size, detail] = value;
|
|
21
|
+
const kebabDetail = kebabKeys(detail);
|
|
22
|
+
result[key] = [size, kebabDetail];
|
|
23
|
+
} else {
|
|
24
|
+
result[key] = value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/theme/fontSize.ts
|
|
32
|
+
var fontSizes = {
|
|
33
|
+
"2xs": ["0.6875rem", "1rem"],
|
|
34
|
+
"xs": ["0.75rem", "1rem"],
|
|
35
|
+
"sm": ["0.875rem", "1.25rem"],
|
|
36
|
+
"base": ["1rem", "1.5rem"],
|
|
37
|
+
"lg": ["1.25rem", "1.625rem"],
|
|
38
|
+
"display1": ["3.75rem", {
|
|
39
|
+
fontWeight: 700,
|
|
40
|
+
lineHeight: "5rem",
|
|
41
|
+
letterSpacing: "-0.0625rem"
|
|
42
|
+
}],
|
|
43
|
+
"display2": ["3.25rem", {
|
|
44
|
+
fontWeight: 700,
|
|
45
|
+
lineHeight: "4.25rem",
|
|
46
|
+
letterSpacing: "-0.05rem"
|
|
47
|
+
}],
|
|
48
|
+
"display3": ["2.75rem", {
|
|
49
|
+
fontWeight: 700,
|
|
50
|
+
lineHeight: "3.625rem",
|
|
51
|
+
letterSpacing: "-0.0375rem"
|
|
52
|
+
}],
|
|
53
|
+
"h1": ["3rem", {
|
|
54
|
+
fontWeight: 700,
|
|
55
|
+
lineHeight: "3.75rem",
|
|
56
|
+
letterSpacing: "-0.0125rem"
|
|
57
|
+
}],
|
|
58
|
+
"h2": ["2.5rem", {
|
|
59
|
+
fontWeight: 700,
|
|
60
|
+
lineHeight: "3.25rem",
|
|
61
|
+
letterSpacing: "-0.0125rem"
|
|
62
|
+
}],
|
|
63
|
+
"h3": ["2.25rem", {
|
|
64
|
+
fontWeight: 700,
|
|
65
|
+
lineHeight: "3rem",
|
|
66
|
+
letterSpacing: "-0.0125rem"
|
|
67
|
+
}],
|
|
68
|
+
"h4": ["2rem", {
|
|
69
|
+
fontWeight: 700,
|
|
70
|
+
lineHeight: "2.625rem",
|
|
71
|
+
letterSpacing: "-0.0125rem"
|
|
72
|
+
}],
|
|
73
|
+
"h5": ["1.5rem", {
|
|
74
|
+
fontWeight: 700,
|
|
75
|
+
lineHeight: "2rem",
|
|
76
|
+
letterSpacing: "-0.0125rem"
|
|
77
|
+
}],
|
|
78
|
+
"h6": ["1.25rem", {
|
|
79
|
+
fontWeight: 700,
|
|
80
|
+
lineHeight: "1.625rem",
|
|
81
|
+
letterSpacing: "-0.0125rem"
|
|
82
|
+
}]
|
|
83
|
+
};
|
|
84
|
+
var unocssFontSizes = fontConfigKeysKebabCase(fontSizes);
|
|
85
|
+
|
|
86
|
+
// src/theme/shadows.ts
|
|
87
|
+
var shadows = {
|
|
88
|
+
"elevation-0": "0 0 0 0 rgba(0, 0, 0, 0.10)",
|
|
89
|
+
"elevation-1": "0 1px 2px 0 rgba(0, 0, 0, 0.10)",
|
|
90
|
+
"elevation-2": "0 4px 8px 0 rgba(0, 0, 0, 0.10)",
|
|
91
|
+
"elevation-3": "0 6px 12px 0 rgba(0, 0, 0, 0.10)",
|
|
92
|
+
"elevation-4": "0 8px 16px 0 rgba(0, 0, 0, 0.10)",
|
|
93
|
+
"elevation-5": "0 12px 24px 0 rgba(0, 0, 0, 0.10)"
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// src/theme/index.ts
|
|
97
|
+
var theme = {
|
|
2
98
|
colors,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
99
|
+
boxShadow: shadows,
|
|
100
|
+
fontSize: fontSizes
|
|
101
|
+
};
|
|
102
|
+
var unocssTheme = {
|
|
103
|
+
colors,
|
|
104
|
+
boxShadow: shadows,
|
|
105
|
+
fontSize: unocssFontSizes
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// src/index.ts
|
|
109
|
+
function config(extend = false) {
|
|
110
|
+
if (extend) {
|
|
111
|
+
return {
|
|
112
|
+
theme: {
|
|
113
|
+
extend: theme
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
theme
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
var src_default = config();
|
|
6
122
|
export {
|
|
7
123
|
colors,
|
|
8
124
|
config,
|
|
9
|
-
src_default as default
|
|
125
|
+
src_default as default,
|
|
126
|
+
fontSizes,
|
|
127
|
+
shadows,
|
|
128
|
+
theme,
|
|
129
|
+
unocssTheme
|
|
10
130
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@removify/tailwind-preset",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8",
|
|
5
5
|
"description": "Tailwind CSS preset for Removify",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tailwind"
|
|
@@ -26,25 +26,27 @@
|
|
|
26
26
|
"tailwindcss": "^3.0.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
+
"string-ts": "^2.1.0",
|
|
29
30
|
"yargs": "17.7.2"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"@commitlint/cli": "^
|
|
33
|
-
"@commitlint/config-conventional": "^
|
|
34
|
-
"@types/node": "^20.
|
|
33
|
+
"@commitlint/cli": "^19.2.1",
|
|
34
|
+
"@commitlint/config-conventional": "^19.1.0",
|
|
35
|
+
"@types/node": "^20.12.2",
|
|
35
36
|
"@types/yargs": "^17.0.32",
|
|
36
|
-
"bumpp": "^9.
|
|
37
|
-
"eslint": "^8.
|
|
38
|
-
"eslint-config-removify": "^1.2.
|
|
39
|
-
"husky": "^
|
|
40
|
-
"lint-staged": "^15.2.
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
37
|
+
"bumpp": "^9.4.0",
|
|
38
|
+
"eslint": "^8.57.0",
|
|
39
|
+
"eslint-config-removify": "^1.2.14",
|
|
40
|
+
"husky": "^9.0.11",
|
|
41
|
+
"lint-staged": "^15.2.2",
|
|
42
|
+
"rimraf": "^5.0.5",
|
|
43
|
+
"tailwind-config-viewer": "^2.0.1",
|
|
44
|
+
"tailwindcss": "^3.4.3",
|
|
45
|
+
"tsup": "^8.0.2",
|
|
46
|
+
"tsx": "^4.7.1",
|
|
47
|
+
"typescript": "^5.4.3",
|
|
48
|
+
"vitest": "^1.4.0",
|
|
49
|
+
"@removify/tailwind-preset": "0.0.8"
|
|
48
50
|
},
|
|
49
51
|
"lint-staged": {
|
|
50
52
|
"**/*.{js,ts,vue,html}": [
|
|
@@ -53,15 +55,15 @@
|
|
|
53
55
|
},
|
|
54
56
|
"scripts": {
|
|
55
57
|
"start": "tsx ./src/index.ts",
|
|
56
|
-
"build": "tsup src/index.ts src/cli.ts --format esm,cjs --clean --dts",
|
|
58
|
+
"build": "rimraf dist && tsup src/index.ts src/cli.ts --format esm,cjs --clean --dts",
|
|
57
59
|
"watch": "tsup --format esm,cjs --watch",
|
|
58
60
|
"dev": "tsx watch ./src/index.ts",
|
|
59
61
|
"test": "vitest",
|
|
60
62
|
"lint": "eslint .",
|
|
61
63
|
"lint:fix": "eslint --fix .",
|
|
62
|
-
"husky:install": "husky
|
|
64
|
+
"husky:install": "husky",
|
|
63
65
|
"release": "bumpp && pnpm publish --access=public",
|
|
64
|
-
"tailwind-config-viewer": "tailwind-config-viewer -o -c tailwind.config.
|
|
65
|
-
"tailwind-config-viewer:build": "tailwind-config-viewer export tailwind-dist -c tailwind.config.
|
|
66
|
+
"tailwind-config-viewer": "tailwind-config-viewer -o -c tailwind.config.js",
|
|
67
|
+
"tailwind-config-viewer:build": "tailwind-config-viewer export tailwind-dist -c tailwind.config.js"
|
|
66
68
|
}
|
|
67
69
|
}
|
package/readme.md
CHANGED
|
@@ -5,11 +5,11 @@ This is tailwind preset for removify.
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install -D removify
|
|
8
|
+
npm install -D @removify/tailwind-preset
|
|
9
9
|
|
|
10
|
-
yarn add -D removify
|
|
10
|
+
yarn add -D @removify/tailwind-preset
|
|
11
11
|
|
|
12
|
-
pnpm add -D removify
|
|
12
|
+
pnpm add -D @removify/tailwind-preset
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
### Use cli to generate tailwind v4 theme
|
|
@@ -22,7 +22,7 @@ npx @removify/tailwind-preset > src/style.css
|
|
|
22
22
|
|
|
23
23
|
```ts
|
|
24
24
|
// tailwind.config.{t,j}s
|
|
25
|
-
import removify from 'removify
|
|
25
|
+
import removify from '@removify/tailwind-preset';
|
|
26
26
|
import type { Config } from 'tailwindcss';
|
|
27
27
|
|
|
28
28
|
export default {
|