@removify/tailwind-preset 0.0.5 → 0.0.6

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 ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../dist/cli.js';
@@ -0,0 +1,133 @@
1
+ // src/index.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
+ overlay: "#00000080",
14
+ primary: {
15
+ 50: "#E8F1F6",
16
+ 100: "#BED9E6",
17
+ 200: "#95C0D5",
18
+ 300: "#6CA7C3",
19
+ 400: "#448DB1",
20
+ 500: "#1C749F",
21
+ 600: "#166085",
22
+ 700: "#104C6A",
23
+ 800: "#0B384E",
24
+ 900: "#062432"
25
+ },
26
+ secondary: {
27
+ 50: "#FFEFEF",
28
+ 100: "#FFD3D2",
29
+ 200: "#FFB7B5",
30
+ 300: "#FF9B99",
31
+ 400: "#FF807E",
32
+ 500: "#FF6663",
33
+ 600: "#D25350",
34
+ 700: "#A6403E",
35
+ 800: "#792E2C",
36
+ 900: "#4D1C1B"
37
+ },
38
+ green: {
39
+ 50: "#E7F7F1",
40
+ 100: "#BCE7D7",
41
+ 200: "#91D7BD",
42
+ 300: "#67C7A3",
43
+ 400: "#3EB688",
44
+ 500: "#15A46E",
45
+ 600: "#10895B",
46
+ 700: "#0B6D48",
47
+ 800: "#075035",
48
+ 900: "#043322"
49
+ },
50
+ fuchsia: {
51
+ 50: "#FAEBFD",
52
+ 100: "#F0C7FA",
53
+ 200: "#E6A3F6",
54
+ 300: "#DB81F2",
55
+ 400: "#D05FED",
56
+ 500: "#C53DE7",
57
+ 600: "#A431C0",
58
+ 700: "#822599",
59
+ 800: "#5F1A71",
60
+ 900: "#3D1048"
61
+ },
62
+ indigo: {
63
+ 50: "#EFF0FF",
64
+ 100: "#D3D5FE",
65
+ 200: "#B8BAFC",
66
+ 300: "#9DA0FA",
67
+ 400: "#8286F7",
68
+ 500: "#686DF4",
69
+ 600: "#5459CB",
70
+ 700: "#4145A1",
71
+ 800: "#2F3276",
72
+ 900: "#1D1F4B"
73
+ },
74
+ neutral: {
75
+ 50: "#F1F2F5",
76
+ 100: "#EAEDF2",
77
+ 200: "#E1E5EA",
78
+ 300: "#D5DBE2",
79
+ 400: "#CAD1D9",
80
+ 500: "#BEC7D1",
81
+ 600: "#9DA4AD",
82
+ 700: "#7B8188",
83
+ 800: "#5A5F64",
84
+ 900: "#393C3F"
85
+ },
86
+ orange: {
87
+ 50: "#FFF6EA",
88
+ 100: "#FFE5C5",
89
+ 200: "#FFD3A0",
90
+ 300: "#FFC27C",
91
+ 400: "#FFB159",
92
+ 500: "#FFA037",
93
+ 600: "#D2842B",
94
+ 700: "#A66821",
95
+ 800: "#794C17",
96
+ 900: "#4D300E"
97
+ },
98
+ seafoam: {
99
+ 50: "#EBFAFA",
100
+ 100: "#C7EFF1",
101
+ 200: "#A4E5E8",
102
+ 300: "#82DADE",
103
+ 400: "#60CED4",
104
+ 500: "#3EC2C9",
105
+ 600: "#32A1A7",
106
+ 700: "#268085",
107
+ 800: "#1B5E62",
108
+ 900: "#113C3E"
109
+ }
110
+ };
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
+
129
+ export {
130
+ colors,
131
+ config,
132
+ src_default
133
+ };
package/dist/cli.cjs ADDED
@@ -0,0 +1,180 @@
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 __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+
25
+ // src/cli.ts
26
+ var import_helpers = require("yargs/helpers");
27
+ var import_yargs = __toESM(require("yargs"), 1);
28
+ var import_node_process = __toESM(require("process"), 1);
29
+
30
+ // src/index.ts
31
+ var colors = {
32
+ inherit: "inherit",
33
+ current: "currentColor",
34
+ transparent: "transparent",
35
+ danger: "#EA3529",
36
+ warning: "#FFA037",
37
+ success: "#15A46E",
38
+ info: "#3EC2C9",
39
+ special: "#686DF4",
40
+ black: "#000000",
41
+ white: "#FFFFFF",
42
+ overlay: "#00000080",
43
+ primary: {
44
+ 50: "#E8F1F6",
45
+ 100: "#BED9E6",
46
+ 200: "#95C0D5",
47
+ 300: "#6CA7C3",
48
+ 400: "#448DB1",
49
+ 500: "#1C749F",
50
+ 600: "#166085",
51
+ 700: "#104C6A",
52
+ 800: "#0B384E",
53
+ 900: "#062432"
54
+ },
55
+ secondary: {
56
+ 50: "#FFEFEF",
57
+ 100: "#FFD3D2",
58
+ 200: "#FFB7B5",
59
+ 300: "#FF9B99",
60
+ 400: "#FF807E",
61
+ 500: "#FF6663",
62
+ 600: "#D25350",
63
+ 700: "#A6403E",
64
+ 800: "#792E2C",
65
+ 900: "#4D1C1B"
66
+ },
67
+ green: {
68
+ 50: "#E7F7F1",
69
+ 100: "#BCE7D7",
70
+ 200: "#91D7BD",
71
+ 300: "#67C7A3",
72
+ 400: "#3EB688",
73
+ 500: "#15A46E",
74
+ 600: "#10895B",
75
+ 700: "#0B6D48",
76
+ 800: "#075035",
77
+ 900: "#043322"
78
+ },
79
+ fuchsia: {
80
+ 50: "#FAEBFD",
81
+ 100: "#F0C7FA",
82
+ 200: "#E6A3F6",
83
+ 300: "#DB81F2",
84
+ 400: "#D05FED",
85
+ 500: "#C53DE7",
86
+ 600: "#A431C0",
87
+ 700: "#822599",
88
+ 800: "#5F1A71",
89
+ 900: "#3D1048"
90
+ },
91
+ indigo: {
92
+ 50: "#EFF0FF",
93
+ 100: "#D3D5FE",
94
+ 200: "#B8BAFC",
95
+ 300: "#9DA0FA",
96
+ 400: "#8286F7",
97
+ 500: "#686DF4",
98
+ 600: "#5459CB",
99
+ 700: "#4145A1",
100
+ 800: "#2F3276",
101
+ 900: "#1D1F4B"
102
+ },
103
+ neutral: {
104
+ 50: "#F1F2F5",
105
+ 100: "#EAEDF2",
106
+ 200: "#E1E5EA",
107
+ 300: "#D5DBE2",
108
+ 400: "#CAD1D9",
109
+ 500: "#BEC7D1",
110
+ 600: "#9DA4AD",
111
+ 700: "#7B8188",
112
+ 800: "#5A5F64",
113
+ 900: "#393C3F"
114
+ },
115
+ orange: {
116
+ 50: "#FFF6EA",
117
+ 100: "#FFE5C5",
118
+ 200: "#FFD3A0",
119
+ 300: "#FFC27C",
120
+ 400: "#FFB159",
121
+ 500: "#FFA037",
122
+ 600: "#D2842B",
123
+ 700: "#A66821",
124
+ 800: "#794C17",
125
+ 900: "#4D300E"
126
+ },
127
+ seafoam: {
128
+ 50: "#EBFAFA",
129
+ 100: "#C7EFF1",
130
+ 200: "#A4E5E8",
131
+ 300: "#82DADE",
132
+ 400: "#60CED4",
133
+ 500: "#3EC2C9",
134
+ 600: "#32A1A7",
135
+ 700: "#268085",
136
+ 800: "#1B5E62",
137
+ 900: "#113C3E"
138
+ }
139
+ };
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
+
158
+ // src/cli.ts
159
+ var css = String.raw;
160
+ 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();
161
+ var theme = css`@import "tailwindcss";
162
+ @theme {
163
+ `;
164
+ if (argv.override) {
165
+ theme += css` --color-*: initial;
166
+ `;
167
+ }
168
+ for (const [key, value] of Object.entries(colors)) {
169
+ if (typeof value === "object") {
170
+ for (const [subKey, subValue] of Object.entries(value)) {
171
+ theme += css` --color-${key}-${subKey}: ${subValue};
172
+ `;
173
+ }
174
+ } else {
175
+ theme += css` --color-${key}: ${value};
176
+ `;
177
+ }
178
+ }
179
+ theme += css`}`;
180
+ console.log(theme);
package/dist/cli.d.cts ADDED
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/cli.js ADDED
@@ -0,0 +1,30 @@
1
+ import {
2
+ colors
3
+ } from "./chunk-W4S5IMYJ.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);
package/dist/index.js CHANGED
@@ -1,130 +1,8 @@
1
- // src/index.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
- overlay: "#00000080",
14
- primary: {
15
- 50: "#E8F1F6",
16
- 100: "#BED9E6",
17
- 200: "#95C0D5",
18
- 300: "#6CA7C3",
19
- 400: "#448DB1",
20
- 500: "#1C749F",
21
- 600: "#166085",
22
- 700: "#104C6A",
23
- 800: "#0B384E",
24
- 900: "#062432"
25
- },
26
- secondary: {
27
- 50: "#FFEFEF",
28
- 100: "#FFD3D2",
29
- 200: "#FFB7B5",
30
- 300: "#FF9B99",
31
- 400: "#FF807E",
32
- 500: "#FF6663",
33
- 600: "#D25350",
34
- 700: "#A6403E",
35
- 800: "#792E2C",
36
- 900: "#4D1C1B"
37
- },
38
- green: {
39
- 50: "#E7F7F1",
40
- 100: "#BCE7D7",
41
- 200: "#91D7BD",
42
- 300: "#67C7A3",
43
- 400: "#3EB688",
44
- 500: "#15A46E",
45
- 600: "#10895B",
46
- 700: "#0B6D48",
47
- 800: "#075035",
48
- 900: "#043322"
49
- },
50
- fuchsia: {
51
- 50: "#FAEBFD",
52
- 100: "#F0C7FA",
53
- 200: "#E6A3F6",
54
- 300: "#DB81F2",
55
- 400: "#D05FED",
56
- 500: "#C53DE7",
57
- 600: "#A431C0",
58
- 700: "#822599",
59
- 800: "#5F1A71",
60
- 900: "#3D1048"
61
- },
62
- indigo: {
63
- 50: "#EFF0FF",
64
- 100: "#D3D5FE",
65
- 200: "#B8BAFC",
66
- 300: "#9DA0FA",
67
- 400: "#8286F7",
68
- 500: "#686DF4",
69
- 600: "#5459CB",
70
- 700: "#4145A1",
71
- 800: "#2F3276",
72
- 900: "#1D1F4B"
73
- },
74
- neutral: {
75
- 50: "#F1F2F5",
76
- 100: "#EAEDF2",
77
- 200: "#E1E5EA",
78
- 300: "#D5DBE2",
79
- 400: "#CAD1D9",
80
- 500: "#BEC7D1",
81
- 600: "#9DA4AD",
82
- 700: "#7B8188",
83
- 800: "#5A5F64",
84
- 900: "#393C3F"
85
- },
86
- orange: {
87
- 50: "#FFF6EA",
88
- 100: "#FFE5C5",
89
- 200: "#FFD3A0",
90
- 300: "#FFC27C",
91
- 400: "#FFB159",
92
- 500: "#FFA037",
93
- 600: "#D2842B",
94
- 700: "#A66821",
95
- 800: "#794C17",
96
- 900: "#4D300E"
97
- },
98
- seafoam: {
99
- 50: "#EBFAFA",
100
- 100: "#C7EFF1",
101
- 200: "#A4E5E8",
102
- 300: "#82DADE",
103
- 400: "#60CED4",
104
- 500: "#3EC2C9",
105
- 600: "#32A1A7",
106
- 700: "#268085",
107
- 800: "#1B5E62",
108
- 900: "#113C3E"
109
- }
110
- };
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();
1
+ import {
2
+ colors,
3
+ config,
4
+ src_default
5
+ } from "./chunk-W4S5IMYJ.js";
128
6
  export {
129
7
  colors,
130
8
  config,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@removify/tailwind-preset",
3
3
  "type": "module",
4
- "version": "0.0.5",
4
+ "version": "0.0.6",
5
5
  "description": "Tailwind CSS preset for Removify",
6
6
  "keywords": [
7
7
  "tailwind"
@@ -14,16 +14,25 @@
14
14
  },
15
15
  "main": "./dist/index.js",
16
16
  "types": "./dist/index.d.ts",
17
+ "bin": "./bin/index.js",
17
18
  "files": [
19
+ "bin",
18
20
  "dist"
19
21
  ],
20
22
  "engines": {
21
23
  "node": ">=18"
22
24
  },
25
+ "peerDependencies": {
26
+ "tailwindcss": "^3.0.0"
27
+ },
28
+ "dependencies": {
29
+ "yargs": "17.7.2"
30
+ },
23
31
  "devDependencies": {
24
32
  "@commitlint/cli": "^18.6.0",
25
33
  "@commitlint/config-conventional": "^18.6.0",
26
34
  "@types/node": "^20.11.10",
35
+ "@types/yargs": "^17.0.32",
27
36
  "bumpp": "^9.3.0",
28
37
  "eslint": "^8.56.0",
29
38
  "eslint-config-removify": "^1.2.11",
@@ -35,7 +44,7 @@
35
44
  "tsx": "^4.7.0",
36
45
  "typescript": "^5.3.3",
37
46
  "vitest": "^1.2.2",
38
- "removify-tailwind-preset": "npm:@removify/tailwind-preset@0.0.5"
47
+ "@removify/tailwind-preset": "0.0.6"
39
48
  },
40
49
  "lint-staged": {
41
50
  "**/*.{js,ts,vue,html}": [
@@ -44,7 +53,7 @@
44
53
  },
45
54
  "scripts": {
46
55
  "start": "tsx ./src/index.ts",
47
- "build": "tsup src/index.ts --format esm,cjs --clean --dts",
56
+ "build": "tsup src/index.ts src/cli.ts --format esm,cjs --clean --dts",
48
57
  "watch": "tsup --format esm,cjs --watch",
49
58
  "dev": "tsx watch ./src/index.ts",
50
59
  "test": "vitest",
package/readme.md CHANGED
@@ -12,6 +12,14 @@ yarn add -D removify-tailwind-preset
12
12
  pnpm add -D removify-tailwind-preset
13
13
  ```
14
14
 
15
+ ### Use cli to generate tailwind v4 theme
16
+
17
+ **Note:** Tailwind v4 is in alpha stage, therefor the cli is subjected to change in the future.
18
+
19
+ ```bash
20
+ npx @removify/tailwind-preset > src/style.css
21
+ ```
22
+
15
23
  ```ts
16
24
  // tailwind.config.{t,j}s
17
25
  import removify from 'removify-tailwind-preset';