@removify/tailwind-preset 0.0.8 → 0.0.9

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/bin/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import '../dist/cli.js';
2
+ import '../dist/cli/index.js';
@@ -0,0 +1,252 @@
1
+ // src/theme/colors.ts
2
+ var colors = {
3
+ inherit: "inherit",
4
+ current: "currentColor",
5
+ transparent: "transparent",
6
+ danger: "#EA3529",
7
+ warning: "#FFA037",
8
+ success: "#15A46E",
9
+ info: "#3EC2C9",
10
+ special: "#686DF4",
11
+ black: "#000000",
12
+ white: "#FFFFFF",
13
+ primary: {
14
+ 50: "#E8F1F6",
15
+ 100: "#BED9E6",
16
+ 200: "#95C0D5",
17
+ 300: "#6CA7C3",
18
+ 400: "#448DB1",
19
+ 500: "#1C749F",
20
+ 600: "#166085",
21
+ 700: "#104C6A",
22
+ 800: "#0B384E",
23
+ 900: "#062432"
24
+ },
25
+ secondary: {
26
+ 50: "#FFEFEF",
27
+ 100: "#FFD3D2",
28
+ 200: "#FFB7B5",
29
+ 300: "#FF9B99",
30
+ 400: "#FF807E",
31
+ 500: "#FF6663",
32
+ 600: "#D25350",
33
+ 700: "#A6403E",
34
+ 800: "#792E2C",
35
+ 900: "#4D1C1B"
36
+ },
37
+ green: {
38
+ 50: "#E7F7F1",
39
+ 100: "#BCE7D7",
40
+ 200: "#91D7BD",
41
+ 300: "#67C7A3",
42
+ 400: "#3EB688",
43
+ 500: "#15A46E",
44
+ 600: "#10895B",
45
+ 700: "#0B6D48",
46
+ 800: "#075035",
47
+ 900: "#043322"
48
+ },
49
+ fuchsia: {
50
+ 50: "#FAEBFD",
51
+ 100: "#F0C7FA",
52
+ 200: "#E6A3F6",
53
+ 300: "#DB81F2",
54
+ 400: "#D05FED",
55
+ 500: "#C53DE7",
56
+ 600: "#A431C0",
57
+ 700: "#822599",
58
+ 800: "#5F1A71",
59
+ 900: "#3D1048"
60
+ },
61
+ indigo: {
62
+ 50: "#EFF0FF",
63
+ 100: "#D3D5FE",
64
+ 200: "#B8BAFC",
65
+ 300: "#9DA0FA",
66
+ 400: "#8286F7",
67
+ 500: "#686DF4",
68
+ 600: "#5459CB",
69
+ 700: "#4145A1",
70
+ 800: "#2F3276",
71
+ 900: "#1D1F4B"
72
+ },
73
+ neutral: {
74
+ 50: "#F1F2F5",
75
+ 100: "#EAEDF2",
76
+ 200: "#E1E5EA",
77
+ 300: "#D5DBE2",
78
+ 400: "#CAD1D9",
79
+ 500: "#BEC7D1",
80
+ 600: "#9DA4AD",
81
+ 700: "#7B8188",
82
+ 800: "#5A5F64",
83
+ 900: "#393C3F"
84
+ },
85
+ orange: {
86
+ 50: "#FFF6EA",
87
+ 100: "#FFE5C5",
88
+ 200: "#FFD3A0",
89
+ 300: "#FFC27C",
90
+ 400: "#FFB159",
91
+ 500: "#FFA037",
92
+ 600: "#D2842B",
93
+ 700: "#A66821",
94
+ 800: "#794C17",
95
+ 900: "#4D300E"
96
+ },
97
+ seafoam: {
98
+ 50: "#EBFAFA",
99
+ 100: "#C7EFF1",
100
+ 200: "#A4E5E8",
101
+ 300: "#82DADE",
102
+ 400: "#60CED4",
103
+ 500: "#3EC2C9",
104
+ 600: "#32A1A7",
105
+ 700: "#268085",
106
+ 800: "#1B5E62",
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"
132
+ }
133
+ };
134
+
135
+ // src/util/font.ts
136
+ import { kebabKeys } from "string-ts";
137
+
138
+ // src/types/fontSize.ts
139
+ function isDetailFont(value) {
140
+ return Array.isArray(value) && typeof value[1] === "object";
141
+ }
142
+
143
+ // src/util/font.ts
144
+ var entries = Object.entries;
145
+ function fontConfigKeysKebabCase(fontConfig) {
146
+ const result = {};
147
+ for (const [key, value] of entries(fontConfig)) {
148
+ if (value) {
149
+ if (isDetailFont(value)) {
150
+ const [size, detail] = value;
151
+ const kebabDetail = kebabKeys(detail);
152
+ result[key] = [size, kebabDetail];
153
+ } else {
154
+ result[key] = value;
155
+ }
156
+ }
157
+ }
158
+ return result;
159
+ }
160
+
161
+ // src/theme/fontSize.ts
162
+ var fontSizes = {
163
+ "2xs": ["0.6875rem", "1rem"],
164
+ "xs": ["0.75rem", "1rem"],
165
+ "sm": ["0.875rem", "1.25rem"],
166
+ "base": ["1rem", "1.5rem"],
167
+ "lg": ["1.25rem", "1.625rem"],
168
+ "display1": ["3.75rem", {
169
+ fontWeight: 700,
170
+ lineHeight: "5rem",
171
+ letterSpacing: "-0.0625rem"
172
+ }],
173
+ "display2": ["3.25rem", {
174
+ fontWeight: 700,
175
+ lineHeight: "4.25rem",
176
+ letterSpacing: "-0.05rem"
177
+ }],
178
+ "display3": ["2.75rem", {
179
+ fontWeight: 700,
180
+ lineHeight: "3.625rem",
181
+ letterSpacing: "-0.0375rem"
182
+ }],
183
+ "h1": ["3rem", {
184
+ fontWeight: 700,
185
+ lineHeight: "3.75rem",
186
+ letterSpacing: "-0.0125rem"
187
+ }],
188
+ "h2": ["2.5rem", {
189
+ fontWeight: 700,
190
+ lineHeight: "3.25rem",
191
+ letterSpacing: "-0.0125rem"
192
+ }],
193
+ "h3": ["2.25rem", {
194
+ fontWeight: 700,
195
+ lineHeight: "3rem",
196
+ letterSpacing: "-0.0125rem"
197
+ }],
198
+ "h4": ["2rem", {
199
+ fontWeight: 700,
200
+ lineHeight: "2.625rem",
201
+ letterSpacing: "-0.0125rem"
202
+ }],
203
+ "h5": ["1.5rem", {
204
+ fontWeight: 700,
205
+ lineHeight: "2rem",
206
+ letterSpacing: "-0.0125rem"
207
+ }],
208
+ "h6": ["1.25rem", {
209
+ fontWeight: 700,
210
+ lineHeight: "1.625rem",
211
+ letterSpacing: "-0.0125rem"
212
+ }]
213
+ };
214
+ var unocssFontSizes = fontConfigKeysKebabCase(fontSizes);
215
+
216
+ // src/theme/shadows.ts
217
+ var shadows = {
218
+ "elevation-0": "0 0 0 0 rgba(0, 0, 0, 0.10)",
219
+ "elevation-1": "0 1px 2px 0 rgba(0, 0, 0, 0.10)",
220
+ "elevation-2": "0 4px 8px 0 rgba(0, 0, 0, 0.10)",
221
+ "elevation-3": "0 6px 12px 0 rgba(0, 0, 0, 0.10)",
222
+ "elevation-4": "0 8px 16px 0 rgba(0, 0, 0, 0.10)",
223
+ "elevation-5": "0 12px 24px 0 rgba(0, 0, 0, 0.10)"
224
+ };
225
+
226
+ // src/theme/fontFamily.ts
227
+ import { fontFamily } from "tailwindcss/defaultTheme";
228
+ var customFontFamily = {
229
+ sans: ["DM Sans", ...fontFamily.sans]
230
+ };
231
+
232
+ // src/theme/index.ts
233
+ var theme = {
234
+ colors,
235
+ boxShadow: shadows,
236
+ fontSize: fontSizes,
237
+ fontFamily: customFontFamily
238
+ };
239
+ var unocssTheme = {
240
+ colors,
241
+ boxShadow: shadows,
242
+ fontSize: unocssFontSizes
243
+ };
244
+
245
+ export {
246
+ colors,
247
+ fontSizes,
248
+ shadows,
249
+ customFontFamily,
250
+ theme,
251
+ unocssTheme
252
+ };
@@ -22,7 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  mod
23
23
  ));
24
24
 
25
- // src/cli.ts
25
+ // src/cli/index.ts
26
26
  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);
@@ -161,26 +161,169 @@ var colors = {
161
161
  }
162
162
  };
163
163
 
164
- // src/cli.ts
164
+ // src/util/font.ts
165
+ var import_string_ts = require("string-ts");
166
+
167
+ // src/types/fontSize.ts
168
+ function isDetailFont(value) {
169
+ return Array.isArray(value) && typeof value[1] === "object";
170
+ }
171
+
172
+ // src/util/font.ts
173
+ var entries = Object.entries;
174
+ function fontConfigKeysKebabCase(fontConfig) {
175
+ const result = {};
176
+ for (const [key, value] of entries(fontConfig)) {
177
+ if (value) {
178
+ if (isDetailFont(value)) {
179
+ const [size, detail] = value;
180
+ const kebabDetail = (0, import_string_ts.kebabKeys)(detail);
181
+ result[key] = [size, kebabDetail];
182
+ } else {
183
+ result[key] = value;
184
+ }
185
+ }
186
+ }
187
+ return result;
188
+ }
189
+
190
+ // src/theme/fontSize.ts
191
+ var fontSizes = {
192
+ "2xs": ["0.6875rem", "1rem"],
193
+ "xs": ["0.75rem", "1rem"],
194
+ "sm": ["0.875rem", "1.25rem"],
195
+ "base": ["1rem", "1.5rem"],
196
+ "lg": ["1.25rem", "1.625rem"],
197
+ "display1": ["3.75rem", {
198
+ fontWeight: 700,
199
+ lineHeight: "5rem",
200
+ letterSpacing: "-0.0625rem"
201
+ }],
202
+ "display2": ["3.25rem", {
203
+ fontWeight: 700,
204
+ lineHeight: "4.25rem",
205
+ letterSpacing: "-0.05rem"
206
+ }],
207
+ "display3": ["2.75rem", {
208
+ fontWeight: 700,
209
+ lineHeight: "3.625rem",
210
+ letterSpacing: "-0.0375rem"
211
+ }],
212
+ "h1": ["3rem", {
213
+ fontWeight: 700,
214
+ lineHeight: "3.75rem",
215
+ letterSpacing: "-0.0125rem"
216
+ }],
217
+ "h2": ["2.5rem", {
218
+ fontWeight: 700,
219
+ lineHeight: "3.25rem",
220
+ letterSpacing: "-0.0125rem"
221
+ }],
222
+ "h3": ["2.25rem", {
223
+ fontWeight: 700,
224
+ lineHeight: "3rem",
225
+ letterSpacing: "-0.0125rem"
226
+ }],
227
+ "h4": ["2rem", {
228
+ fontWeight: 700,
229
+ lineHeight: "2.625rem",
230
+ letterSpacing: "-0.0125rem"
231
+ }],
232
+ "h5": ["1.5rem", {
233
+ fontWeight: 700,
234
+ lineHeight: "2rem",
235
+ letterSpacing: "-0.0125rem"
236
+ }],
237
+ "h6": ["1.25rem", {
238
+ fontWeight: 700,
239
+ lineHeight: "1.625rem",
240
+ letterSpacing: "-0.0125rem"
241
+ }]
242
+ };
243
+ var unocssFontSizes = fontConfigKeysKebabCase(fontSizes);
244
+
245
+ // src/theme/fontFamily.ts
246
+ var import_defaultTheme = require("tailwindcss/defaultTheme");
247
+ var customFontFamily = {
248
+ sans: ["DM Sans", ...import_defaultTheme.fontFamily.sans]
249
+ };
250
+
251
+ // src/cli/src/theme/color.ts
165
252
  var css = String.raw;
166
- var argv = (0, import_yargs.default)((0, import_helpers.hideBin)(import_node_process.default.argv)).scriptName("@removify/tailwind-preset").usage("$0 [options] > src/style.css").help().options({ override: { type: "boolean", default: false, alias: "o" } }).parseSync();
167
- var theme = css`@import "tailwindcss";
168
- @theme {
253
+ function generateColorVariables(filetype) {
254
+ let theme = css``;
255
+ for (const [key, value] of Object.entries(colors)) {
256
+ if (typeof value === "object") {
257
+ for (const [subKey, subValue] of Object.entries(value)) {
258
+ if (filetype === "tailwind" || filetype === "css") {
259
+ theme += css` --color-${key}-${subKey}: ${subValue};
169
260
  `;
170
- if (argv.override) {
171
- theme += css` --color-*: initial;
261
+ } else if (filetype === "scss") {
262
+ theme += css`$color-${key}-${subKey}: ${subValue};
172
263
  `;
173
- }
174
- for (const [key, value] of Object.entries(colors)) {
175
- if (typeof value === "object") {
176
- for (const [subKey, subValue] of Object.entries(value)) {
177
- theme += css` --color-${key}-${subKey}: ${subValue};
264
+ }
265
+ }
266
+ } else {
267
+ if (filetype === "tailwind" || filetype === "css") {
268
+ theme += css` --color-${key}: ${value};
269
+ `;
270
+ } else if (filetype === "scss") {
271
+ theme += css`$color-${key}: ${value};
178
272
  `;
273
+ }
179
274
  }
180
- } else {
181
- theme += css` --color-${key}: ${value};
275
+ }
276
+ return theme;
277
+ }
278
+
279
+ // src/cli/src/css.ts
280
+ var css2 = String.raw;
281
+ function generateCssTheme() {
282
+ let theme = css2`*, *::before, *::after {
283
+ `;
284
+ theme += generateColorVariables("css");
285
+ return theme += css2`}`;
286
+ }
287
+
288
+ // src/cli/src/scss.ts
289
+ var css3 = String.raw;
290
+ function generateScssTheme() {
291
+ let theme = css3``;
292
+ theme += generateColorVariables("scss");
293
+ return theme;
294
+ }
295
+
296
+ // src/cli/src/tailwind.ts
297
+ var css4 = String.raw;
298
+ function generateTailwindTheme(extend) {
299
+ let theme = css4`@import "tailwindcss";
300
+ @theme {
301
+ `;
302
+ if (!extend) {
303
+ theme += css4` --color-*: initial;
182
304
  `;
183
305
  }
306
+ theme += generateColorVariables("tailwind");
307
+ return theme += css4`}`;
308
+ }
309
+
310
+ // src/cli/src/utils/log.ts
311
+ function log(...args) {
312
+ console.log(...args);
313
+ }
314
+
315
+ // src/cli/index.ts
316
+ var filetypes = ["tailwind", "css", "scss"];
317
+ var argv = (0, import_yargs.default)((0, import_helpers.hideBin)(import_node_process.default.argv)).scriptName("@removify/tailwind-preset").usage("$0 [options] > src/style.css").help().options({ extend: { type: "boolean", default: true, alias: "e" } }).options({ filetype: { choices: filetypes, default: "css", alias: "f" } }).parseSync();
318
+ if (argv.filetype === "tailwind") {
319
+ const theme = generateTailwindTheme(argv.extend);
320
+ log(theme);
321
+ }
322
+ if (argv.filetype === "css") {
323
+ const theme = generateCssTheme();
324
+ log(theme);
325
+ }
326
+ if (argv.filetype === "scss") {
327
+ const theme = generateScssTheme();
328
+ log(theme);
184
329
  }
185
- theme += css`}`;
186
- console.log(theme);
@@ -0,0 +1,88 @@
1
+ import {
2
+ colors
3
+ } from "../chunk-A4JTRVFS.js";
4
+
5
+ // src/cli/index.ts
6
+ import { hideBin } from "yargs/helpers";
7
+ import yargs from "yargs";
8
+ import process from "process";
9
+
10
+ // src/cli/src/theme/color.ts
11
+ var css = String.raw;
12
+ function generateColorVariables(filetype) {
13
+ let theme = css``;
14
+ for (const [key, value] of Object.entries(colors)) {
15
+ if (typeof value === "object") {
16
+ for (const [subKey, subValue] of Object.entries(value)) {
17
+ if (filetype === "tailwind" || filetype === "css") {
18
+ theme += css` --color-${key}-${subKey}: ${subValue};
19
+ `;
20
+ } else if (filetype === "scss") {
21
+ theme += css`$color-${key}-${subKey}: ${subValue};
22
+ `;
23
+ }
24
+ }
25
+ } else {
26
+ if (filetype === "tailwind" || filetype === "css") {
27
+ theme += css` --color-${key}: ${value};
28
+ `;
29
+ } else if (filetype === "scss") {
30
+ theme += css`$color-${key}: ${value};
31
+ `;
32
+ }
33
+ }
34
+ }
35
+ return theme;
36
+ }
37
+
38
+ // src/cli/src/css.ts
39
+ var css2 = String.raw;
40
+ function generateCssTheme() {
41
+ let theme = css2`*, *::before, *::after {
42
+ `;
43
+ theme += generateColorVariables("css");
44
+ return theme += css2`}`;
45
+ }
46
+
47
+ // src/cli/src/scss.ts
48
+ var css3 = String.raw;
49
+ function generateScssTheme() {
50
+ let theme = css3``;
51
+ theme += generateColorVariables("scss");
52
+ return theme;
53
+ }
54
+
55
+ // src/cli/src/tailwind.ts
56
+ var css4 = String.raw;
57
+ function generateTailwindTheme(extend) {
58
+ let theme = css4`@import "tailwindcss";
59
+ @theme {
60
+ `;
61
+ if (!extend) {
62
+ theme += css4` --color-*: initial;
63
+ `;
64
+ }
65
+ theme += generateColorVariables("tailwind");
66
+ return theme += css4`}`;
67
+ }
68
+
69
+ // src/cli/src/utils/log.ts
70
+ function log(...args) {
71
+ console.log(...args);
72
+ }
73
+
74
+ // src/cli/index.ts
75
+ var filetypes = ["tailwind", "css", "scss"];
76
+ var argv = yargs(hideBin(process.argv)).scriptName("@removify/tailwind-preset").usage("$0 [options] > src/style.css").help().options({ extend: { type: "boolean", default: true, alias: "e" } }).options({ filetype: { choices: filetypes, default: "css", alias: "f" } }).parseSync();
77
+ if (argv.filetype === "tailwind") {
78
+ const theme = generateTailwindTheme(argv.extend);
79
+ log(theme);
80
+ }
81
+ if (argv.filetype === "css") {
82
+ const theme = generateCssTheme();
83
+ log(theme);
84
+ }
85
+ if (argv.filetype === "scss") {
86
+ const theme = generateScssTheme();
87
+ log(theme);
88
+ }
package/dist/index.cjs CHANGED
@@ -23,6 +23,7 @@ __export(src_exports, {
23
23
  colors: () => colors,
24
24
  config: () => config,
25
25
  default: () => src_default,
26
+ fontFamily: () => customFontFamily,
26
27
  fontSizes: () => fontSizes,
27
28
  shadows: () => shadows,
28
29
  theme: () => theme,
@@ -255,11 +256,18 @@ var shadows = {
255
256
  "elevation-5": "0 12px 24px 0 rgba(0, 0, 0, 0.10)"
256
257
  };
257
258
 
259
+ // src/theme/fontFamily.ts
260
+ var import_defaultTheme = require("tailwindcss/defaultTheme");
261
+ var customFontFamily = {
262
+ sans: ["DM Sans", ...import_defaultTheme.fontFamily.sans]
263
+ };
264
+
258
265
  // src/theme/index.ts
259
266
  var theme = {
260
267
  colors,
261
268
  boxShadow: shadows,
262
- fontSize: fontSizes
269
+ fontSize: fontSizes,
270
+ fontFamily: customFontFamily
263
271
  };
264
272
  var unocssTheme = {
265
273
  colors,
@@ -268,16 +276,16 @@ var unocssTheme = {
268
276
  };
269
277
 
270
278
  // src/index.ts
271
- function config(extend = false) {
272
- if (extend) {
279
+ function config(extend = true) {
280
+ if (extend === false) {
273
281
  return {
274
- theme: {
275
- extend: theme
276
- }
282
+ theme
277
283
  };
278
284
  }
279
285
  return {
280
- theme
286
+ theme: {
287
+ extend: theme
288
+ }
281
289
  };
282
290
  }
283
291
  var src_default = config();
@@ -285,6 +293,7 @@ var src_default = config();
285
293
  0 && (module.exports = {
286
294
  colors,
287
295
  config,
296
+ fontFamily,
288
297
  fontSizes,
289
298
  shadows,
290
299
  theme,
package/dist/index.d.cts CHANGED
@@ -242,6 +242,10 @@ declare const shadows: {
242
242
  'elevation-5': "0 12px 24px 0 rgba(0, 0, 0, 0.10)";
243
243
  };
244
244
 
245
+ declare const customFontFamily: {
246
+ sans: string[];
247
+ };
248
+
245
249
  declare const theme: Config['theme'];
246
250
  declare const unocssTheme: {
247
251
  colors: {
@@ -419,4 +423,4 @@ type Shadows = {
419
423
  declare function config(extend?: boolean): Partial<Config>;
420
424
  declare const _default: Partial<tailwindcss_types_config.Config>;
421
425
 
422
- export { type ColorString, type Colors, type FontSizes, type Shadows, colors, config, _default as default, fontSizes, shadows, theme, unocssTheme };
426
+ export { type ColorString, type Colors, type FontSizes, type Shadows, colors, config, _default as default, customFontFamily as fontFamily, fontSizes, shadows, theme, unocssTheme };
package/dist/index.d.ts CHANGED
@@ -242,6 +242,10 @@ declare const shadows: {
242
242
  'elevation-5': "0 12px 24px 0 rgba(0, 0, 0, 0.10)";
243
243
  };
244
244
 
245
+ declare const customFontFamily: {
246
+ sans: string[];
247
+ };
248
+
245
249
  declare const theme: Config['theme'];
246
250
  declare const unocssTheme: {
247
251
  colors: {
@@ -419,4 +423,4 @@ type Shadows = {
419
423
  declare function config(extend?: boolean): Partial<Config>;
420
424
  declare const _default: Partial<tailwindcss_types_config.Config>;
421
425
 
422
- export { type ColorString, type Colors, type FontSizes, type Shadows, colors, config, _default as default, fontSizes, shadows, theme, unocssTheme };
426
+ export { type ColorString, type Colors, type FontSizes, type Shadows, colors, config, _default as default, customFontFamily as fontFamily, fontSizes, shadows, theme, unocssTheme };
package/dist/index.js CHANGED
@@ -1,121 +1,23 @@
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 = {
98
2
  colors,
99
- boxShadow: shadows,
100
- fontSize: fontSizes
101
- };
102
- var unocssTheme = {
103
- colors,
104
- boxShadow: shadows,
105
- fontSize: unocssFontSizes
106
- };
3
+ customFontFamily,
4
+ fontSizes,
5
+ shadows,
6
+ theme,
7
+ unocssTheme
8
+ } from "./chunk-A4JTRVFS.js";
107
9
 
108
10
  // src/index.ts
109
- function config(extend = false) {
110
- if (extend) {
11
+ function config(extend = true) {
12
+ if (extend === false) {
111
13
  return {
112
- theme: {
113
- extend: theme
114
- }
14
+ theme
115
15
  };
116
16
  }
117
17
  return {
118
- theme
18
+ theme: {
19
+ extend: theme
20
+ }
119
21
  };
120
22
  }
121
23
  var src_default = config();
@@ -123,6 +25,7 @@ export {
123
25
  colors,
124
26
  config,
125
27
  src_default as default,
28
+ customFontFamily as fontFamily,
126
29
  fontSizes,
127
30
  shadows,
128
31
  theme,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@removify/tailwind-preset",
3
3
  "type": "module",
4
- "version": "0.0.8",
4
+ "version": "0.0.9",
5
5
  "description": "Tailwind CSS preset for Removify",
6
6
  "keywords": [
7
7
  "tailwind"
@@ -30,23 +30,23 @@
30
30
  "yargs": "17.7.2"
31
31
  },
32
32
  "devDependencies": {
33
- "@commitlint/cli": "^19.2.1",
34
- "@commitlint/config-conventional": "^19.1.0",
35
- "@types/node": "^20.12.2",
33
+ "@commitlint/cli": "^19.2.2",
34
+ "@commitlint/config-conventional": "^19.2.2",
35
+ "@removify/eslint-config": "^1.3.3",
36
+ "@types/node": "^20.12.7",
36
37
  "@types/yargs": "^17.0.32",
37
38
  "bumpp": "^9.4.0",
38
- "eslint": "^8.57.0",
39
- "eslint-config-removify": "^1.2.14",
39
+ "eslint": "^9.1.0",
40
40
  "husky": "^9.0.11",
41
41
  "lint-staged": "^15.2.2",
42
42
  "rimraf": "^5.0.5",
43
43
  "tailwind-config-viewer": "^2.0.1",
44
44
  "tailwindcss": "^3.4.3",
45
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"
46
+ "tsx": "^4.7.2",
47
+ "typescript": "^5.4.5",
48
+ "vitest": "^1.5.0",
49
+ "@removify/tailwind-preset": "0.0.9"
50
50
  },
51
51
  "lint-staged": {
52
52
  "**/*.{js,ts,vue,html}": [
@@ -55,15 +55,17 @@
55
55
  },
56
56
  "scripts": {
57
57
  "start": "tsx ./src/index.ts",
58
- "build": "rimraf dist && tsup src/index.ts src/cli.ts --format esm,cjs --clean --dts",
58
+ "build": "rimraf dist && tsup src/index.ts src/cli/index.ts --format esm,cjs --clean --dts",
59
59
  "watch": "tsup --format esm,cjs --watch",
60
60
  "dev": "tsx watch ./src/index.ts",
61
+ "dev:cli": "tsx watch ./src/cli/index.ts",
62
+ "dev:playground": "pnpm --filter playground dev",
61
63
  "test": "vitest",
62
64
  "lint": "eslint .",
63
65
  "lint:fix": "eslint --fix .",
64
66
  "husky:install": "husky",
65
67
  "release": "bumpp && pnpm publish --access=public",
66
68
  "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"
69
+ "tailwind-config-viewer:build": "pnpm build && tailwind-config-viewer export tailwind-dist -c tailwind.config.js"
68
70
  }
69
71
  }
@@ -1,137 +0,0 @@
1
- // src/theme/colors.ts
2
- var colors = {
3
- inherit: "inherit",
4
- current: "currentColor",
5
- transparent: "transparent",
6
- danger: "#EA3529",
7
- warning: "#FFA037",
8
- success: "#15A46E",
9
- info: "#3EC2C9",
10
- special: "#686DF4",
11
- black: "#000000",
12
- white: "#FFFFFF",
13
- primary: {
14
- 50: "#E8F1F6",
15
- 100: "#BED9E6",
16
- 200: "#95C0D5",
17
- 300: "#6CA7C3",
18
- 400: "#448DB1",
19
- 500: "#1C749F",
20
- 600: "#166085",
21
- 700: "#104C6A",
22
- 800: "#0B384E",
23
- 900: "#062432"
24
- },
25
- secondary: {
26
- 50: "#FFEFEF",
27
- 100: "#FFD3D2",
28
- 200: "#FFB7B5",
29
- 300: "#FF9B99",
30
- 400: "#FF807E",
31
- 500: "#FF6663",
32
- 600: "#D25350",
33
- 700: "#A6403E",
34
- 800: "#792E2C",
35
- 900: "#4D1C1B"
36
- },
37
- green: {
38
- 50: "#E7F7F1",
39
- 100: "#BCE7D7",
40
- 200: "#91D7BD",
41
- 300: "#67C7A3",
42
- 400: "#3EB688",
43
- 500: "#15A46E",
44
- 600: "#10895B",
45
- 700: "#0B6D48",
46
- 800: "#075035",
47
- 900: "#043322"
48
- },
49
- fuchsia: {
50
- 50: "#FAEBFD",
51
- 100: "#F0C7FA",
52
- 200: "#E6A3F6",
53
- 300: "#DB81F2",
54
- 400: "#D05FED",
55
- 500: "#C53DE7",
56
- 600: "#A431C0",
57
- 700: "#822599",
58
- 800: "#5F1A71",
59
- 900: "#3D1048"
60
- },
61
- indigo: {
62
- 50: "#EFF0FF",
63
- 100: "#D3D5FE",
64
- 200: "#B8BAFC",
65
- 300: "#9DA0FA",
66
- 400: "#8286F7",
67
- 500: "#686DF4",
68
- 600: "#5459CB",
69
- 700: "#4145A1",
70
- 800: "#2F3276",
71
- 900: "#1D1F4B"
72
- },
73
- neutral: {
74
- 50: "#F1F2F5",
75
- 100: "#EAEDF2",
76
- 200: "#E1E5EA",
77
- 300: "#D5DBE2",
78
- 400: "#CAD1D9",
79
- 500: "#BEC7D1",
80
- 600: "#9DA4AD",
81
- 700: "#7B8188",
82
- 800: "#5A5F64",
83
- 900: "#393C3F"
84
- },
85
- orange: {
86
- 50: "#FFF6EA",
87
- 100: "#FFE5C5",
88
- 200: "#FFD3A0",
89
- 300: "#FFC27C",
90
- 400: "#FFB159",
91
- 500: "#FFA037",
92
- 600: "#D2842B",
93
- 700: "#A66821",
94
- 800: "#794C17",
95
- 900: "#4D300E"
96
- },
97
- seafoam: {
98
- 50: "#EBFAFA",
99
- 100: "#C7EFF1",
100
- 200: "#A4E5E8",
101
- 300: "#82DADE",
102
- 400: "#60CED4",
103
- 500: "#3EC2C9",
104
- 600: "#32A1A7",
105
- 700: "#268085",
106
- 800: "#1B5E62",
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"
132
- }
133
- };
134
-
135
- export {
136
- colors
137
- };
package/dist/cli.js DELETED
@@ -1,30 +0,0 @@
1
- import {
2
- colors
3
- } from "./chunk-5LOSNWQT.js";
4
-
5
- // src/cli.ts
6
- import { hideBin } from "yargs/helpers";
7
- import yargs from "yargs";
8
- import process from "process";
9
- var css = String.raw;
10
- var argv = yargs(hideBin(process.argv)).scriptName("@removify/tailwind-preset").usage("$0 [options] > src/style.css").help().options({ override: { type: "boolean", default: false, alias: "o" } }).parseSync();
11
- var theme = css`@import "tailwindcss";
12
- @theme {
13
- `;
14
- if (argv.override) {
15
- theme += css` --color-*: initial;
16
- `;
17
- }
18
- for (const [key, value] of Object.entries(colors)) {
19
- if (typeof value === "object") {
20
- for (const [subKey, subValue] of Object.entries(value)) {
21
- theme += css` --color-${key}-${subKey}: ${subValue};
22
- `;
23
- }
24
- } else {
25
- theme += css` --color-${key}: ${value};
26
- `;
27
- }
28
- }
29
- theme += css`}`;
30
- console.log(theme);
File without changes
File without changes