├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── build.mjs ├── examples ├── corti.html ├── flowbite.html ├── form.html ├── gamelobby.html ├── module.html └── playground.html ├── package-lock.json ├── package.json ├── src ├── colors.preprocess.ts ├── iife.ts ├── index.css ├── index.ts ├── parser.ts ├── states.ts ├── templates.preprocess.ts └── utils.ts ├── tailwind.config.cjs ├── tsconfig.json └── types.d.ts /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .vscode 3 | dist -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .vscode 3 | src 4 | examples 5 | 6 | build.js 7 | bun.lockb -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Nick Mudge 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RunCSS 2 | 3 | RunCSS is the runtime equivalent of TailwindCSS, featuring the same CSS utility class names, but with no build step required. It achieves this by generating CSS on the fly with JavaScript. 4 | 5 | 6 | RunCSS comes with batteries included. By default all [additional variants](https://tailwindcss.com/docs/configuring-variants) such as `hover`, `active`, `visited`, `group-hover`, `sm`, `lg` etc work with all class names. All packaged in a single 25kb (8kb after compression) JS file! 7 | 8 | 9 | ## Usage 10 | 11 | Add to ``: 12 | ```html 13 | 14 | 15 | ``` 16 | Done! RunCSS will parse the documents and generate the corresponding classes, with no further configuration required. RunCSS will also watch for new element insertions and parse them. Remove the `watch` attribute to disable this feature. 17 | 18 | Check the `examples/` directory for some examples. 19 | 20 | ### Avoid element popup 21 | 22 | You may add the `runcss-cloak` attribute to any element to hide it until RunCSS processes it. 23 | 24 | For example: 25 | ```html 26 | 27 | 28 | 29 | ``` 30 | 31 | ### Custom configuration 32 | **TODO - WORK IN PROGRESS** 33 | Before loading `runcss.js`, add the following script: 34 | ```html 35 | 55 | 56 | ``` 57 | 58 | You may use it to either extend or override default values. Currently, this is not yet implemented. `colors`, `screens` and `fontFamily`. 59 | 60 | ## Advanced usage as module 61 | ```html 62 | 102 | ``` 103 | 104 | ## Caveats and differences with TailwindCSS 105 | Currently, the project is production-ready, and should cover the totality of TailwindCSS classes. 106 | However, since we underwent a major rewrite recently, there may be some less common feature missing or misbehaving compared to Tailwind. 107 | 108 | If you find something missing, feel free to open an issue. 109 | 110 | By design, this parser is way less strict than Tailwind's one. This allows smaller builds and faster load times, but also means that wrong values may be turned into CSS rules regardless. This is intentional, because the browser will discard those rules anyway. 111 | 112 | ### VSCode Intellisense 113 | To enable Tailwind's autocompletion, install the [official Tailwind extension](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss), and create an empty file called `tailwind.config.js` in the same folder of your html files. 114 | 115 | 116 | ## Build / contribute 117 | Clone this repository and use [npm](https://nodejs.org/en/download/package-manager) to install dependencies: 118 | ```bash 119 | git clone https://github.com/lucafabbian/runcss.git 120 | cd runcss 121 | npm i 122 | ``` 123 | 124 | Then, you may use: 125 | ```bash 126 | npm run build # Build for production 127 | npm run dev # Build, watch for changes + start server with live reload! 128 | ``` 129 | 130 | 131 | ## Authors and License 132 | 133 | Current author: Luca Fabbian 134 | 135 | Based on RunCSS of mudgen, [follow him on twitter](https://twitter.com/mudgen). 136 | 137 | Distributed under MIT License. 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /build.mjs: -------------------------------------------------------------------------------- 1 | import * as esbuild from 'esbuild' 2 | import * as path from 'path' 3 | import Module from 'module' 4 | 5 | 6 | const buildWithESBuildAndEval = async(filepath) => { 7 | const result = await esbuild.build({ 8 | entryPoints: [filepath], 9 | bundle: true, 10 | format: 'cjs', 11 | target: [`node12`], 12 | write: false, 13 | }) 14 | const builtModuleAsString = new TextDecoder("utf-8").decode(result.outputFiles[0].contents) 15 | var m = new Module(); 16 | m._compile(builtModuleAsString, ''); 17 | return m.exports; 18 | } 19 | 20 | /** This hook would run ".preprocess.ts" files at build time and 21 | * include the result instead of the source files. */ 22 | const preprocessPlugin = { 23 | name: 'preprocess', 24 | setup(build) { 25 | build.onLoad({ filter: /\.preprocess(\.js|\.ts|)$/ }, async (args) =>{ 26 | const module = await buildWithESBuildAndEval(args.path); 27 | let contents = '' 28 | for(let [key, value] of Object.entries(module)){ 29 | contents+=`export ${key === 'default' ? 'default' : 'const ' + key + ' ='} ${JSON.stringify(value)}\n` 30 | } 31 | return { contents, loader: "js" }; 32 | }) 33 | }, 34 | } 35 | 36 | // css 37 | esbuild.build({ 38 | entryPoints: ['./src/index.css'], 39 | bundle: true, 40 | outfile: 'dist/runcss.css', 41 | }) 42 | 43 | esbuild.build({ 44 | entryPoints: ['./src/index.css'], 45 | bundle: true, 46 | minify: true, 47 | outfile: 'dist/runcss.min.css', 48 | }) 49 | 50 | 51 | // iife script 52 | esbuild.build({ 53 | entryPoints: ['./src/iife.js'], 54 | bundle: true, 55 | outfile: 'dist/runcss.js', 56 | plugins: [preprocessPlugin] 57 | }) 58 | 59 | esbuild.build({ 60 | entryPoints: ['./src/iife.js'], 61 | bundle: true, 62 | minify: true, 63 | outfile: 'dist/runcss.min.js', 64 | plugins: [preprocessPlugin] 65 | }) 66 | 67 | 68 | // module 69 | esbuild.build({ 70 | entryPoints: ['./src/index.js'], 71 | bundle: true, 72 | format: 'esm', 73 | outfile: 'dist/runcss.mjs', 74 | plugins: [preprocessPlugin] 75 | }) 76 | 77 | esbuild.build({ 78 | entryPoints: ['./src/index.js'], 79 | bundle: true, 80 | minify: true, 81 | format: 'esm', 82 | outfile: 'dist/runcss.min.mjs', 83 | plugins: [preprocessPlugin] 84 | }) 85 | 86 | -------------------------------------------------------------------------------- /examples/corti.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | I Corti di LGL - Concorso racconti Librogame 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 47 | 48 | 49 | 50 |
51 | 57 |
58 |
59 |
60 |
61 | 62 |

Chi siamo? 63 |
64 |

65 |

"I corti di Librogame's Land" è il 66 | più grande concorso italiano dedicato ai racconti interattivi (librogame).

67 | 68 |

Gestito dalla community con il supporto delle case editrici del settore, il concorso consente agli autori 69 | di sfidarsi su un tema che cambia di anno in anno, sottoponendo i propri racconti brevi e brevissimi al 70 | giudizio 71 | del pubblico. 72 |

Per tutte le novità sul concorso vi rimandiamo 73 | alla pagina Facebook apposita o, in alternativa, al Forum di LGL. 75 | 76 |

77 | 78 |
79 |
80 |
81 | 82 | 83 |
84 |
85 |
86 |

Archivio racconti

87 | Scarica .zip (~250MB) 89 |
90 | 128 | 129 |
130 |
131 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /examples/flowbite.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 |
9 |

10 | 16 |

17 |
18 |
19 |

Flowbite is an open-source library of interactive components built on top of Tailwind CSS including buttons, dropdowns, modals, navbars, and more.

20 |

Check out this guide to learn how to get started and start developing websites even faster with components on top of Tailwind CSS.

21 |
22 |
23 |

24 | 30 |

31 | 37 |

38 | 44 |

45 | 56 |
57 |
58 | 59 | 60 |
61 | 64 | 67 | 70 | 73 | 76 |
77 | 78 | 79 |
80 | 81 |
82 | 83 | 84 |
85 |
86 | 87 | 88 |
89 |
90 | 91 | 92 |
93 | 94 |
95 | 96 |
97 |
98 | 99 |
100 | 101 | 102 |
103 |
104 | 105 | 106 |
107 | 108 | 109 |
110 |
111 | 112 |
113 |

114 | ciao 115 |

116 |
117 | 118 | 119 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /examples/form.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
10 |
11 |
12 |
13 |
14 | 18 |
19 | 26 |
27 |
28 |
29 | 32 |
33 | 40 |
41 |
42 |
43 | 46 |
47 | 54 |
55 |
56 |
57 | 60 |
61 | 68 |
69 |
70 |
71 | 74 |
75 | 82 |
83 |
84 |
85 |
86 |
87 |
88 | 89 |
90 | 91 |
92 |
93 | 94 |
95 | 96 |
97 | 98 |
99 |
100 | 101 |
102 | 103 |
104 | 105 |
106 |
107 |
108 | 109 |
110 | 111 | 112 |
113 |
114 |
115 |
116 | 117 |
118 |
01
119 |
02
120 |
03
121 |
122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 |
StateCity
IndianaIndianapolis
OhioColumbus
MichiganDetroit
145 | 146 | 147 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /examples/gamelobby.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 17 | 18 | 19 |
20 |
21 |
22 |
23 |
Josef256 Lobby
24 |
Waiting for more players...
25 |
26 |
27 |
28 | 47 |
48 |
49 |
50 |
51 |
52 |
53 | Logo 54 |
55 |
Lirik
56 |
Level 6 - Warlock
57 |
58 |
59 |
60 | 65 |
66 |
67 |
68 |
69 | Logo 70 |
71 | 72 |
Level 4 - Monk
73 |
74 |
75 |
76 | 81 |
82 |
83 |
84 |
85 | Logo 86 |
87 |
DansGaming
88 |
Level 12 - Paladan
89 |
90 |
91 |
92 | 97 |
98 |
99 |
100 |
101 |
102 | 103 | 104 | 105 |
106 |
Invite a friend
107 |
108 |
109 |
110 |
111 | 112 |
113 |
114 |
115 | 116 | 117 | -------------------------------------------------------------------------------- /examples/module.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

hello world!

8 | 9 | 10 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /examples/playground.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
11 |
hello
12 |
13 | 14 |
15 | dark custom color 16 |
17 | 18 |
19 |
md shadow
20 |
lg shadow
21 |
xl shadow
22 |
2xl shadow
23 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "runcss", 3 | "version": "0.1.7", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "runcss", 9 | "version": "0.1.7", 10 | "license": "MIT", 11 | "devDependencies": { 12 | "concurrently": "^8.2.1", 13 | "esbuild": "^0.19.4", 14 | "five-server": "^0.3.1" 15 | } 16 | }, 17 | "node_modules/@babel/code-frame": { 18 | "version": "7.22.13", 19 | "dev": true, 20 | "license": "MIT", 21 | "dependencies": { 22 | "@babel/highlight": "^7.22.13", 23 | "chalk": "^2.4.2" 24 | }, 25 | "engines": { 26 | "node": ">=6.9.0" 27 | } 28 | }, 29 | "node_modules/@babel/code-frame/node_modules/chalk": { 30 | "version": "2.4.2", 31 | "dev": true, 32 | "license": "MIT", 33 | "dependencies": { 34 | "ansi-styles": "^3.2.1", 35 | "escape-string-regexp": "^1.0.5", 36 | "supports-color": "^5.3.0" 37 | }, 38 | "engines": { 39 | "node": ">=4" 40 | } 41 | }, 42 | "node_modules/@babel/code-frame/node_modules/chalk/node_modules/ansi-styles": { 43 | "version": "3.2.1", 44 | "dev": true, 45 | "license": "MIT", 46 | "dependencies": { 47 | "color-convert": "^1.9.0" 48 | }, 49 | "engines": { 50 | "node": ">=4" 51 | } 52 | }, 53 | "node_modules/@babel/code-frame/node_modules/chalk/node_modules/ansi-styles/node_modules/color-convert": { 54 | "version": "1.9.3", 55 | "dev": true, 56 | "license": "MIT", 57 | "dependencies": { 58 | "color-name": "1.1.3" 59 | } 60 | }, 61 | "node_modules/@babel/code-frame/node_modules/chalk/node_modules/ansi-styles/node_modules/color-convert/node_modules/color-name": { 62 | "version": "1.1.3", 63 | "dev": true, 64 | "license": "MIT" 65 | }, 66 | "node_modules/@babel/code-frame/node_modules/chalk/node_modules/supports-color": { 67 | "version": "5.5.0", 68 | "dev": true, 69 | "license": "MIT", 70 | "dependencies": { 71 | "has-flag": "^3.0.0" 72 | }, 73 | "engines": { 74 | "node": ">=4" 75 | } 76 | }, 77 | "node_modules/@babel/code-frame/node_modules/chalk/node_modules/supports-color/node_modules/has-flag": { 78 | "version": "3.0.0", 79 | "dev": true, 80 | "license": "MIT", 81 | "engines": { 82 | "node": ">=4" 83 | } 84 | }, 85 | "node_modules/@babel/helper-validator-identifier": { 86 | "version": "7.22.20", 87 | "dev": true, 88 | "license": "MIT", 89 | "engines": { 90 | "node": ">=6.9.0" 91 | } 92 | }, 93 | "node_modules/@babel/highlight": { 94 | "version": "7.22.20", 95 | "dev": true, 96 | "license": "MIT", 97 | "dependencies": { 98 | "@babel/helper-validator-identifier": "^7.22.20", 99 | "chalk": "^2.4.2", 100 | "js-tokens": "^4.0.0" 101 | }, 102 | "engines": { 103 | "node": ">=6.9.0" 104 | } 105 | }, 106 | "node_modules/@babel/highlight/node_modules/chalk": { 107 | "version": "2.4.2", 108 | "dev": true, 109 | "license": "MIT", 110 | "dependencies": { 111 | "ansi-styles": "^3.2.1", 112 | "escape-string-regexp": "^1.0.5", 113 | "supports-color": "^5.3.0" 114 | }, 115 | "engines": { 116 | "node": ">=4" 117 | } 118 | }, 119 | "node_modules/@babel/highlight/node_modules/chalk/node_modules/ansi-styles": { 120 | "version": "3.2.1", 121 | "dev": true, 122 | "license": "MIT", 123 | "dependencies": { 124 | "color-convert": "^1.9.0" 125 | }, 126 | "engines": { 127 | "node": ">=4" 128 | } 129 | }, 130 | "node_modules/@babel/highlight/node_modules/chalk/node_modules/ansi-styles/node_modules/color-convert": { 131 | "version": "1.9.3", 132 | "dev": true, 133 | "license": "MIT", 134 | "dependencies": { 135 | "color-name": "1.1.3" 136 | } 137 | }, 138 | "node_modules/@babel/highlight/node_modules/chalk/node_modules/ansi-styles/node_modules/color-convert/node_modules/color-name": { 139 | "version": "1.1.3", 140 | "dev": true, 141 | "license": "MIT" 142 | }, 143 | "node_modules/@babel/highlight/node_modules/chalk/node_modules/supports-color": { 144 | "version": "5.5.0", 145 | "dev": true, 146 | "license": "MIT", 147 | "dependencies": { 148 | "has-flag": "^3.0.0" 149 | }, 150 | "engines": { 151 | "node": ">=4" 152 | } 153 | }, 154 | "node_modules/@babel/highlight/node_modules/chalk/node_modules/supports-color/node_modules/has-flag": { 155 | "version": "3.0.0", 156 | "dev": true, 157 | "license": "MIT", 158 | "engines": { 159 | "node": ">=4" 160 | } 161 | }, 162 | "node_modules/@babel/runtime": { 163 | "version": "7.23.2", 164 | "dev": true, 165 | "license": "MIT", 166 | "dependencies": { 167 | "regenerator-runtime": "^0.14.0" 168 | }, 169 | "engines": { 170 | "node": ">=6.9.0" 171 | } 172 | }, 173 | "node_modules/@esbuild/android-arm64": { 174 | "version": "0.19.5", 175 | "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.5.tgz", 176 | "integrity": "sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==", 177 | "cpu": [ 178 | "arm64" 179 | ], 180 | "dev": true, 181 | "optional": true, 182 | "os": [ 183 | "android" 184 | ], 185 | "engines": { 186 | "node": ">=12" 187 | } 188 | }, 189 | "node_modules/@esbuild/android-x64": { 190 | "version": "0.19.5", 191 | "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.5.tgz", 192 | "integrity": "sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==", 193 | "cpu": [ 194 | "x64" 195 | ], 196 | "dev": true, 197 | "optional": true, 198 | "os": [ 199 | "android" 200 | ], 201 | "engines": { 202 | "node": ">=12" 203 | } 204 | }, 205 | "node_modules/@esbuild/darwin-arm64": { 206 | "version": "0.19.5", 207 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.5.tgz", 208 | "integrity": "sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==", 209 | "cpu": [ 210 | "arm64" 211 | ], 212 | "dev": true, 213 | "optional": true, 214 | "os": [ 215 | "darwin" 216 | ], 217 | "engines": { 218 | "node": ">=12" 219 | } 220 | }, 221 | "node_modules/@esbuild/darwin-x64": { 222 | "version": "0.19.5", 223 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.5.tgz", 224 | "integrity": "sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==", 225 | "cpu": [ 226 | "x64" 227 | ], 228 | "dev": true, 229 | "optional": true, 230 | "os": [ 231 | "darwin" 232 | ], 233 | "engines": { 234 | "node": ">=12" 235 | } 236 | }, 237 | "node_modules/@esbuild/freebsd-arm64": { 238 | "version": "0.19.5", 239 | "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.5.tgz", 240 | "integrity": "sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==", 241 | "cpu": [ 242 | "arm64" 243 | ], 244 | "dev": true, 245 | "optional": true, 246 | "os": [ 247 | "freebsd" 248 | ], 249 | "engines": { 250 | "node": ">=12" 251 | } 252 | }, 253 | "node_modules/@esbuild/freebsd-x64": { 254 | "version": "0.19.5", 255 | "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.5.tgz", 256 | "integrity": "sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==", 257 | "cpu": [ 258 | "x64" 259 | ], 260 | "dev": true, 261 | "optional": true, 262 | "os": [ 263 | "freebsd" 264 | ], 265 | "engines": { 266 | "node": ">=12" 267 | } 268 | }, 269 | "node_modules/@esbuild/linux-arm": { 270 | "version": "0.19.5", 271 | "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.5.tgz", 272 | "integrity": "sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==", 273 | "cpu": [ 274 | "arm" 275 | ], 276 | "dev": true, 277 | "optional": true, 278 | "os": [ 279 | "linux" 280 | ], 281 | "engines": { 282 | "node": ">=12" 283 | } 284 | }, 285 | "node_modules/@esbuild/linux-arm64": { 286 | "version": "0.19.5", 287 | "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.5.tgz", 288 | "integrity": "sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==", 289 | "cpu": [ 290 | "arm64" 291 | ], 292 | "dev": true, 293 | "optional": true, 294 | "os": [ 295 | "linux" 296 | ], 297 | "engines": { 298 | "node": ">=12" 299 | } 300 | }, 301 | "node_modules/@esbuild/linux-ia32": { 302 | "version": "0.19.5", 303 | "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.5.tgz", 304 | "integrity": "sha512-MkjHXS03AXAkNp1KKkhSKPOCYztRtK+KXDNkBa6P78F8Bw0ynknCSClO/ztGszILZtyO/lVKpa7MolbBZ6oJtQ==", 305 | "cpu": [ 306 | "ia32" 307 | ], 308 | "dev": true, 309 | "optional": true, 310 | "os": [ 311 | "linux" 312 | ], 313 | "engines": { 314 | "node": ">=12" 315 | } 316 | }, 317 | "node_modules/@esbuild/linux-mips64el": { 318 | "version": "0.19.5", 319 | "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.5.tgz", 320 | "integrity": "sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==", 321 | "cpu": [ 322 | "mips64el" 323 | ], 324 | "dev": true, 325 | "optional": true, 326 | "os": [ 327 | "linux" 328 | ], 329 | "engines": { 330 | "node": ">=12" 331 | } 332 | }, 333 | "node_modules/@esbuild/linux-ppc64": { 334 | "version": "0.19.5", 335 | "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.5.tgz", 336 | "integrity": "sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==", 337 | "cpu": [ 338 | "ppc64" 339 | ], 340 | "dev": true, 341 | "optional": true, 342 | "os": [ 343 | "linux" 344 | ], 345 | "engines": { 346 | "node": ">=12" 347 | } 348 | }, 349 | "node_modules/@esbuild/linux-riscv64": { 350 | "version": "0.19.5", 351 | "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.5.tgz", 352 | "integrity": "sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==", 353 | "cpu": [ 354 | "riscv64" 355 | ], 356 | "dev": true, 357 | "optional": true, 358 | "os": [ 359 | "linux" 360 | ], 361 | "engines": { 362 | "node": ">=12" 363 | } 364 | }, 365 | "node_modules/@esbuild/linux-s390x": { 366 | "version": "0.19.5", 367 | "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.5.tgz", 368 | "integrity": "sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==", 369 | "cpu": [ 370 | "s390x" 371 | ], 372 | "dev": true, 373 | "optional": true, 374 | "os": [ 375 | "linux" 376 | ], 377 | "engines": { 378 | "node": ">=12" 379 | } 380 | }, 381 | "node_modules/@esbuild/linux-x64": { 382 | "version": "0.19.5", 383 | "cpu": [ 384 | "x64" 385 | ], 386 | "dev": true, 387 | "license": "MIT", 388 | "optional": true, 389 | "os": [ 390 | "linux" 391 | ], 392 | "engines": { 393 | "node": ">=12" 394 | } 395 | }, 396 | "node_modules/@esbuild/netbsd-x64": { 397 | "version": "0.19.5", 398 | "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.5.tgz", 399 | "integrity": "sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==", 400 | "cpu": [ 401 | "x64" 402 | ], 403 | "dev": true, 404 | "optional": true, 405 | "os": [ 406 | "netbsd" 407 | ], 408 | "engines": { 409 | "node": ">=12" 410 | } 411 | }, 412 | "node_modules/@esbuild/openbsd-x64": { 413 | "version": "0.19.5", 414 | "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.5.tgz", 415 | "integrity": "sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==", 416 | "cpu": [ 417 | "x64" 418 | ], 419 | "dev": true, 420 | "optional": true, 421 | "os": [ 422 | "openbsd" 423 | ], 424 | "engines": { 425 | "node": ">=12" 426 | } 427 | }, 428 | "node_modules/@esbuild/sunos-x64": { 429 | "version": "0.19.5", 430 | "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.5.tgz", 431 | "integrity": "sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==", 432 | "cpu": [ 433 | "x64" 434 | ], 435 | "dev": true, 436 | "optional": true, 437 | "os": [ 438 | "sunos" 439 | ], 440 | "engines": { 441 | "node": ">=12" 442 | } 443 | }, 444 | "node_modules/@esbuild/win32-arm64": { 445 | "version": "0.19.5", 446 | "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.5.tgz", 447 | "integrity": "sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==", 448 | "cpu": [ 449 | "arm64" 450 | ], 451 | "dev": true, 452 | "optional": true, 453 | "os": [ 454 | "win32" 455 | ], 456 | "engines": { 457 | "node": ">=12" 458 | } 459 | }, 460 | "node_modules/@esbuild/win32-ia32": { 461 | "version": "0.19.5", 462 | "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.5.tgz", 463 | "integrity": "sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==", 464 | "cpu": [ 465 | "ia32" 466 | ], 467 | "dev": true, 468 | "optional": true, 469 | "os": [ 470 | "win32" 471 | ], 472 | "engines": { 473 | "node": ">=12" 474 | } 475 | }, 476 | "node_modules/@esbuild/win32-x64": { 477 | "version": "0.19.5", 478 | "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.5.tgz", 479 | "integrity": "sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==", 480 | "cpu": [ 481 | "x64" 482 | ], 483 | "dev": true, 484 | "optional": true, 485 | "os": [ 486 | "win32" 487 | ], 488 | "engines": { 489 | "node": ">=12" 490 | } 491 | }, 492 | "node_modules/@html-validate/stylish": { 493 | "version": "4.2.0", 494 | "dev": true, 495 | "license": "MIT", 496 | "dependencies": { 497 | "kleur": "^4.0.0" 498 | }, 499 | "engines": { 500 | "node": ">= 16" 501 | } 502 | }, 503 | "node_modules/@isaacs/cliui": { 504 | "version": "8.0.2", 505 | "dev": true, 506 | "license": "ISC", 507 | "dependencies": { 508 | "string-width": "^5.1.2", 509 | "string-width-cjs": "npm:string-width@^4.2.0", 510 | "strip-ansi": "^7.0.1", 511 | "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", 512 | "wrap-ansi": "^8.1.0", 513 | "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" 514 | }, 515 | "engines": { 516 | "node": ">=12" 517 | } 518 | }, 519 | "node_modules/@isaacs/cliui/node_modules/string-width": { 520 | "version": "5.1.2", 521 | "dev": true, 522 | "license": "MIT", 523 | "dependencies": { 524 | "eastasianwidth": "^0.2.0", 525 | "emoji-regex": "^9.2.2", 526 | "strip-ansi": "^7.0.1" 527 | }, 528 | "engines": { 529 | "node": ">=12" 530 | }, 531 | "funding": { 532 | "url": "https://github.com/sponsors/sindresorhus" 533 | } 534 | }, 535 | "node_modules/@isaacs/cliui/node_modules/string-width-cjs": { 536 | "name": "string-width", 537 | "version": "4.2.3", 538 | "dev": true, 539 | "license": "MIT", 540 | "dependencies": { 541 | "emoji-regex": "^8.0.0", 542 | "is-fullwidth-code-point": "^3.0.0", 543 | "strip-ansi": "^6.0.1" 544 | }, 545 | "engines": { 546 | "node": ">=8" 547 | } 548 | }, 549 | "node_modules/@isaacs/cliui/node_modules/string-width-cjs/node_modules/strip-ansi": { 550 | "version": "6.0.1", 551 | "dev": true, 552 | "license": "MIT", 553 | "dependencies": { 554 | "ansi-regex": "^5.0.1" 555 | }, 556 | "engines": { 557 | "node": ">=8" 558 | } 559 | }, 560 | "node_modules/@isaacs/cliui/node_modules/string-width/node_modules/emoji-regex": { 561 | "version": "9.2.2", 562 | "dev": true, 563 | "license": "MIT" 564 | }, 565 | "node_modules/@isaacs/cliui/node_modules/strip-ansi": { 566 | "version": "7.1.0", 567 | "dev": true, 568 | "license": "MIT", 569 | "dependencies": { 570 | "ansi-regex": "^6.0.1" 571 | }, 572 | "engines": { 573 | "node": ">=12" 574 | }, 575 | "funding": { 576 | "url": "https://github.com/chalk/strip-ansi?sponsor=1" 577 | } 578 | }, 579 | "node_modules/@isaacs/cliui/node_modules/strip-ansi-cjs": { 580 | "name": "strip-ansi", 581 | "version": "6.0.1", 582 | "dev": true, 583 | "license": "MIT", 584 | "dependencies": { 585 | "ansi-regex": "^5.0.1" 586 | }, 587 | "engines": { 588 | "node": ">=8" 589 | } 590 | }, 591 | "node_modules/@isaacs/cliui/node_modules/strip-ansi/node_modules/ansi-regex": { 592 | "version": "6.0.1", 593 | "dev": true, 594 | "license": "MIT", 595 | "engines": { 596 | "node": ">=12" 597 | }, 598 | "funding": { 599 | "url": "https://github.com/chalk/ansi-regex?sponsor=1" 600 | } 601 | }, 602 | "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { 603 | "version": "8.1.0", 604 | "dev": true, 605 | "license": "MIT", 606 | "dependencies": { 607 | "ansi-styles": "^6.1.0", 608 | "string-width": "^5.0.1", 609 | "strip-ansi": "^7.0.1" 610 | }, 611 | "engines": { 612 | "node": ">=12" 613 | }, 614 | "funding": { 615 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 616 | } 617 | }, 618 | "node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs": { 619 | "name": "wrap-ansi", 620 | "version": "7.0.0", 621 | "dev": true, 622 | "license": "MIT", 623 | "dependencies": { 624 | "ansi-styles": "^4.0.0", 625 | "string-width": "^4.1.0", 626 | "strip-ansi": "^6.0.0" 627 | }, 628 | "engines": { 629 | "node": ">=10" 630 | }, 631 | "funding": { 632 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 633 | } 634 | }, 635 | "node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/string-width": { 636 | "version": "4.2.3", 637 | "dev": true, 638 | "license": "MIT", 639 | "dependencies": { 640 | "emoji-regex": "^8.0.0", 641 | "is-fullwidth-code-point": "^3.0.0", 642 | "strip-ansi": "^6.0.1" 643 | }, 644 | "engines": { 645 | "node": ">=8" 646 | } 647 | }, 648 | "node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { 649 | "version": "6.0.1", 650 | "dev": true, 651 | "license": "MIT", 652 | "dependencies": { 653 | "ansi-regex": "^5.0.1" 654 | }, 655 | "engines": { 656 | "node": ">=8" 657 | } 658 | }, 659 | "node_modules/@isaacs/cliui/node_modules/wrap-ansi/node_modules/ansi-styles": { 660 | "version": "6.2.1", 661 | "dev": true, 662 | "license": "MIT", 663 | "engines": { 664 | "node": ">=12" 665 | }, 666 | "funding": { 667 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 668 | } 669 | }, 670 | "node_modules/@pkgjs/parseargs": { 671 | "version": "0.11.0", 672 | "dev": true, 673 | "license": "MIT", 674 | "optional": true, 675 | "engines": { 676 | "node": ">=14" 677 | } 678 | }, 679 | "node_modules/@sidvind/better-ajv-errors": { 680 | "version": "2.1.0", 681 | "dev": true, 682 | "license": "Apache-2.0", 683 | "dependencies": { 684 | "@babel/code-frame": "^7.16.0", 685 | "chalk": "^4.1.0" 686 | }, 687 | "engines": { 688 | "node": ">= 14.0.0" 689 | }, 690 | "peerDependencies": { 691 | "ajv": "4.11.8 - 8" 692 | } 693 | }, 694 | "node_modules/@yandeu/open-cjs": { 695 | "version": "0.0.0", 696 | "dev": true, 697 | "license": "ISC" 698 | }, 699 | "node_modules/accepts": { 700 | "version": "1.3.8", 701 | "dev": true, 702 | "license": "MIT", 703 | "dependencies": { 704 | "mime-types": "~2.1.34", 705 | "negotiator": "0.6.3" 706 | }, 707 | "engines": { 708 | "node": ">= 0.6" 709 | } 710 | }, 711 | "node_modules/acorn": { 712 | "version": "8.10.0", 713 | "dev": true, 714 | "license": "MIT", 715 | "bin": { 716 | "acorn": "bin/acorn" 717 | }, 718 | "engines": { 719 | "node": ">=0.4.0" 720 | } 721 | }, 722 | "node_modules/acorn-jsx": { 723 | "version": "5.3.2", 724 | "dev": true, 725 | "license": "MIT", 726 | "peerDependencies": { 727 | "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" 728 | } 729 | }, 730 | "node_modules/acorn-walk": { 731 | "version": "8.2.0", 732 | "dev": true, 733 | "license": "MIT", 734 | "engines": { 735 | "node": ">=0.4.0" 736 | } 737 | }, 738 | "node_modules/ajv": { 739 | "version": "8.12.0", 740 | "dev": true, 741 | "license": "MIT", 742 | "dependencies": { 743 | "fast-deep-equal": "^3.1.1", 744 | "json-schema-traverse": "^1.0.0", 745 | "require-from-string": "^2.0.2", 746 | "uri-js": "^4.2.2" 747 | }, 748 | "funding": { 749 | "type": "github", 750 | "url": "https://github.com/sponsors/epoberezkin" 751 | } 752 | }, 753 | "node_modules/ansi-regex": { 754 | "version": "5.0.1", 755 | "dev": true, 756 | "license": "MIT", 757 | "engines": { 758 | "node": ">=8" 759 | } 760 | }, 761 | "node_modules/ansi-styles": { 762 | "version": "4.3.0", 763 | "dev": true, 764 | "license": "MIT", 765 | "dependencies": { 766 | "color-convert": "^2.0.1" 767 | }, 768 | "engines": { 769 | "node": ">=8" 770 | }, 771 | "funding": { 772 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 773 | } 774 | }, 775 | "node_modules/anymatch": { 776 | "version": "3.1.3", 777 | "dev": true, 778 | "license": "ISC", 779 | "dependencies": { 780 | "normalize-path": "^3.0.0", 781 | "picomatch": "^2.0.4" 782 | }, 783 | "engines": { 784 | "node": ">= 8" 785 | } 786 | }, 787 | "node_modules/array-flatten": { 788 | "version": "3.0.0", 789 | "dev": true, 790 | "license": "MIT" 791 | }, 792 | "node_modules/balanced-match": { 793 | "version": "1.0.2", 794 | "dev": true, 795 | "license": "MIT" 796 | }, 797 | "node_modules/binary-extensions": { 798 | "version": "2.2.0", 799 | "dev": true, 800 | "license": "MIT", 801 | "engines": { 802 | "node": ">=8" 803 | } 804 | }, 805 | "node_modules/boolbase": { 806 | "version": "1.0.0", 807 | "dev": true, 808 | "license": "ISC" 809 | }, 810 | "node_modules/brace-expansion": { 811 | "version": "2.0.1", 812 | "dev": true, 813 | "license": "MIT", 814 | "dependencies": { 815 | "balanced-match": "^1.0.0" 816 | } 817 | }, 818 | "node_modules/braces": { 819 | "version": "3.0.2", 820 | "dev": true, 821 | "license": "MIT", 822 | "dependencies": { 823 | "fill-range": "^7.0.1" 824 | }, 825 | "engines": { 826 | "node": ">=8" 827 | } 828 | }, 829 | "node_modules/call-bind": { 830 | "version": "1.0.2", 831 | "dev": true, 832 | "license": "MIT", 833 | "dependencies": { 834 | "function-bind": "^1.1.1", 835 | "get-intrinsic": "^1.0.2" 836 | }, 837 | "funding": { 838 | "url": "https://github.com/sponsors/ljharb" 839 | } 840 | }, 841 | "node_modules/chalk": { 842 | "version": "4.1.2", 843 | "dev": true, 844 | "license": "MIT", 845 | "dependencies": { 846 | "ansi-styles": "^4.1.0", 847 | "supports-color": "^7.1.0" 848 | }, 849 | "engines": { 850 | "node": ">=10" 851 | }, 852 | "funding": { 853 | "url": "https://github.com/chalk/chalk?sponsor=1" 854 | } 855 | }, 856 | "node_modules/chalk/node_modules/supports-color": { 857 | "version": "7.2.0", 858 | "dev": true, 859 | "license": "MIT", 860 | "dependencies": { 861 | "has-flag": "^4.0.0" 862 | }, 863 | "engines": { 864 | "node": ">=8" 865 | } 866 | }, 867 | "node_modules/chokidar": { 868 | "version": "3.5.3", 869 | "dev": true, 870 | "funding": [ 871 | { 872 | "type": "individual", 873 | "url": "https://paulmillr.com/funding/" 874 | } 875 | ], 876 | "license": "MIT", 877 | "dependencies": { 878 | "anymatch": "~3.1.2", 879 | "braces": "~3.0.2", 880 | "glob-parent": "~5.1.2", 881 | "is-binary-path": "~2.1.0", 882 | "is-glob": "~4.0.1", 883 | "normalize-path": "~3.0.0", 884 | "readdirp": "~3.6.0" 885 | }, 886 | "engines": { 887 | "node": ">= 8.10.0" 888 | }, 889 | "optionalDependencies": { 890 | "fsevents": "~2.3.2" 891 | } 892 | }, 893 | "node_modules/cliui": { 894 | "version": "8.0.1", 895 | "dev": true, 896 | "license": "ISC", 897 | "dependencies": { 898 | "string-width": "^4.2.0", 899 | "strip-ansi": "^6.0.1", 900 | "wrap-ansi": "^7.0.0" 901 | }, 902 | "engines": { 903 | "node": ">=12" 904 | } 905 | }, 906 | "node_modules/color-convert": { 907 | "version": "2.0.1", 908 | "dev": true, 909 | "license": "MIT", 910 | "dependencies": { 911 | "color-name": "~1.1.4" 912 | }, 913 | "engines": { 914 | "node": ">=7.0.0" 915 | } 916 | }, 917 | "node_modules/color-name": { 918 | "version": "1.1.4", 919 | "dev": true, 920 | "license": "MIT" 921 | }, 922 | "node_modules/concurrently": { 923 | "version": "8.2.1", 924 | "dev": true, 925 | "license": "MIT", 926 | "dependencies": { 927 | "chalk": "^4.1.2", 928 | "date-fns": "^2.30.0", 929 | "lodash": "^4.17.21", 930 | "rxjs": "^7.8.1", 931 | "shell-quote": "^1.8.1", 932 | "spawn-command": "0.0.2", 933 | "supports-color": "^8.1.1", 934 | "tree-kill": "^1.2.2", 935 | "yargs": "^17.7.2" 936 | }, 937 | "bin": { 938 | "conc": "dist/bin/concurrently.js", 939 | "concurrently": "dist/bin/concurrently.js" 940 | }, 941 | "engines": { 942 | "node": "^14.13.0 || >=16.0.0" 943 | }, 944 | "funding": { 945 | "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" 946 | } 947 | }, 948 | "node_modules/content-disposition": { 949 | "version": "0.5.4", 950 | "dev": true, 951 | "license": "MIT", 952 | "dependencies": { 953 | "safe-buffer": "5.2.1" 954 | }, 955 | "engines": { 956 | "node": ">= 0.6" 957 | } 958 | }, 959 | "node_modules/content-type": { 960 | "version": "1.0.5", 961 | "dev": true, 962 | "license": "MIT", 963 | "engines": { 964 | "node": ">= 0.6" 965 | } 966 | }, 967 | "node_modules/cookie": { 968 | "version": "0.4.2", 969 | "dev": true, 970 | "license": "MIT", 971 | "engines": { 972 | "node": ">= 0.6" 973 | } 974 | }, 975 | "node_modules/cookie-signature": { 976 | "version": "1.2.1", 977 | "dev": true, 978 | "license": "MIT", 979 | "engines": { 980 | "node": ">=6.6.0" 981 | } 982 | }, 983 | "node_modules/cors": { 984 | "version": "2.8.5", 985 | "dev": true, 986 | "license": "MIT", 987 | "dependencies": { 988 | "object-assign": "^4", 989 | "vary": "^1" 990 | }, 991 | "engines": { 992 | "node": ">= 0.10" 993 | } 994 | }, 995 | "node_modules/cross-spawn": { 996 | "version": "7.0.3", 997 | "dev": true, 998 | "license": "MIT", 999 | "dependencies": { 1000 | "path-key": "^3.1.0", 1001 | "shebang-command": "^2.0.0", 1002 | "which": "^2.0.1" 1003 | }, 1004 | "engines": { 1005 | "node": ">= 8" 1006 | } 1007 | }, 1008 | "node_modules/css-select": { 1009 | "version": "4.3.0", 1010 | "dev": true, 1011 | "license": "BSD-2-Clause", 1012 | "dependencies": { 1013 | "boolbase": "^1.0.0", 1014 | "css-what": "^6.0.1", 1015 | "domhandler": "^4.3.1", 1016 | "domutils": "^2.8.0", 1017 | "nth-check": "^2.0.1" 1018 | }, 1019 | "funding": { 1020 | "url": "https://github.com/sponsors/fb55" 1021 | } 1022 | }, 1023 | "node_modules/css-what": { 1024 | "version": "6.1.0", 1025 | "dev": true, 1026 | "license": "BSD-2-Clause", 1027 | "engines": { 1028 | "node": ">= 6" 1029 | }, 1030 | "funding": { 1031 | "url": "https://github.com/sponsors/fb55" 1032 | } 1033 | }, 1034 | "node_modules/date-fns": { 1035 | "version": "2.30.0", 1036 | "dev": true, 1037 | "license": "MIT", 1038 | "dependencies": { 1039 | "@babel/runtime": "^7.21.0" 1040 | }, 1041 | "engines": { 1042 | "node": ">=0.11" 1043 | }, 1044 | "funding": { 1045 | "type": "opencollective", 1046 | "url": "https://opencollective.com/date-fns" 1047 | } 1048 | }, 1049 | "node_modules/debug": { 1050 | "version": "4.3.4", 1051 | "dev": true, 1052 | "license": "MIT", 1053 | "dependencies": { 1054 | "ms": "2.1.2" 1055 | }, 1056 | "engines": { 1057 | "node": ">=6.0" 1058 | }, 1059 | "peerDependenciesMeta": { 1060 | "supports-color": { 1061 | "optional": true 1062 | } 1063 | } 1064 | }, 1065 | "node_modules/deepmerge": { 1066 | "version": "4.3.1", 1067 | "dev": true, 1068 | "license": "MIT", 1069 | "engines": { 1070 | "node": ">=0.10.0" 1071 | } 1072 | }, 1073 | "node_modules/depd": { 1074 | "version": "1.1.2", 1075 | "dev": true, 1076 | "license": "MIT", 1077 | "engines": { 1078 | "node": ">= 0.6" 1079 | } 1080 | }, 1081 | "node_modules/destroy": { 1082 | "version": "1.0.4", 1083 | "dev": true, 1084 | "license": "MIT" 1085 | }, 1086 | "node_modules/dom-serializer": { 1087 | "version": "1.4.1", 1088 | "dev": true, 1089 | "license": "MIT", 1090 | "dependencies": { 1091 | "domelementtype": "^2.0.1", 1092 | "domhandler": "^4.2.0", 1093 | "entities": "^2.0.0" 1094 | }, 1095 | "funding": { 1096 | "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" 1097 | } 1098 | }, 1099 | "node_modules/domelementtype": { 1100 | "version": "2.3.0", 1101 | "dev": true, 1102 | "funding": [ 1103 | { 1104 | "type": "github", 1105 | "url": "https://github.com/sponsors/fb55" 1106 | } 1107 | ], 1108 | "license": "BSD-2-Clause" 1109 | }, 1110 | "node_modules/domhandler": { 1111 | "version": "4.3.1", 1112 | "dev": true, 1113 | "license": "BSD-2-Clause", 1114 | "dependencies": { 1115 | "domelementtype": "^2.2.0" 1116 | }, 1117 | "engines": { 1118 | "node": ">= 4" 1119 | }, 1120 | "funding": { 1121 | "url": "https://github.com/fb55/domhandler?sponsor=1" 1122 | } 1123 | }, 1124 | "node_modules/domutils": { 1125 | "version": "2.8.0", 1126 | "dev": true, 1127 | "license": "BSD-2-Clause", 1128 | "dependencies": { 1129 | "dom-serializer": "^1.0.1", 1130 | "domelementtype": "^2.2.0", 1131 | "domhandler": "^4.2.0" 1132 | }, 1133 | "funding": { 1134 | "url": "https://github.com/fb55/domutils?sponsor=1" 1135 | } 1136 | }, 1137 | "node_modules/eastasianwidth": { 1138 | "version": "0.2.0", 1139 | "dev": true, 1140 | "license": "MIT" 1141 | }, 1142 | "node_modules/ee-first": { 1143 | "version": "1.1.1", 1144 | "dev": true, 1145 | "license": "MIT" 1146 | }, 1147 | "node_modules/emoji-regex": { 1148 | "version": "8.0.0", 1149 | "dev": true, 1150 | "license": "MIT" 1151 | }, 1152 | "node_modules/encodeurl": { 1153 | "version": "1.0.2", 1154 | "dev": true, 1155 | "license": "MIT", 1156 | "engines": { 1157 | "node": ">= 0.8" 1158 | } 1159 | }, 1160 | "node_modules/entities": { 1161 | "version": "2.2.0", 1162 | "dev": true, 1163 | "license": "BSD-2-Clause", 1164 | "funding": { 1165 | "url": "https://github.com/fb55/entities?sponsor=1" 1166 | } 1167 | }, 1168 | "node_modules/esbuild": { 1169 | "version": "0.19.5", 1170 | "dev": true, 1171 | "hasInstallScript": true, 1172 | "license": "MIT", 1173 | "bin": { 1174 | "esbuild": "bin/esbuild" 1175 | }, 1176 | "engines": { 1177 | "node": ">=12" 1178 | }, 1179 | "optionalDependencies": { 1180 | "@esbuild/android-arm": "0.19.5", 1181 | "@esbuild/android-arm64": "0.19.5", 1182 | "@esbuild/android-x64": "0.19.5", 1183 | "@esbuild/darwin-arm64": "0.19.5", 1184 | "@esbuild/darwin-x64": "0.19.5", 1185 | "@esbuild/freebsd-arm64": "0.19.5", 1186 | "@esbuild/freebsd-x64": "0.19.5", 1187 | "@esbuild/linux-arm": "0.19.5", 1188 | "@esbuild/linux-arm64": "0.19.5", 1189 | "@esbuild/linux-ia32": "0.19.5", 1190 | "@esbuild/linux-loong64": "0.19.5", 1191 | "@esbuild/linux-mips64el": "0.19.5", 1192 | "@esbuild/linux-ppc64": "0.19.5", 1193 | "@esbuild/linux-riscv64": "0.19.5", 1194 | "@esbuild/linux-s390x": "0.19.5", 1195 | "@esbuild/linux-x64": "0.19.5", 1196 | "@esbuild/netbsd-x64": "0.19.5", 1197 | "@esbuild/openbsd-x64": "0.19.5", 1198 | "@esbuild/sunos-x64": "0.19.5", 1199 | "@esbuild/win32-arm64": "0.19.5", 1200 | "@esbuild/win32-ia32": "0.19.5", 1201 | "@esbuild/win32-x64": "0.19.5" 1202 | } 1203 | }, 1204 | "node_modules/esbuild/node_modules/@esbuild/android-arm": { 1205 | "version": "0.19.5", 1206 | "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.5.tgz", 1207 | "integrity": "sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==", 1208 | "cpu": [ 1209 | "arm" 1210 | ], 1211 | "dev": true, 1212 | "optional": true, 1213 | "os": [ 1214 | "android" 1215 | ], 1216 | "engines": { 1217 | "node": ">=12" 1218 | } 1219 | }, 1220 | "node_modules/esbuild/node_modules/@esbuild/linux-loong64": { 1221 | "version": "0.19.5", 1222 | "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.5.tgz", 1223 | "integrity": "sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==", 1224 | "cpu": [ 1225 | "loong64" 1226 | ], 1227 | "dev": true, 1228 | "optional": true, 1229 | "os": [ 1230 | "linux" 1231 | ], 1232 | "engines": { 1233 | "node": ">=12" 1234 | } 1235 | }, 1236 | "node_modules/escalade": { 1237 | "version": "3.1.1", 1238 | "dev": true, 1239 | "license": "MIT", 1240 | "engines": { 1241 | "node": ">=6" 1242 | } 1243 | }, 1244 | "node_modules/escape-html": { 1245 | "version": "1.0.3", 1246 | "dev": true, 1247 | "license": "MIT" 1248 | }, 1249 | "node_modules/escape-string-regexp": { 1250 | "version": "1.0.5", 1251 | "dev": true, 1252 | "license": "MIT", 1253 | "engines": { 1254 | "node": ">=0.8.0" 1255 | } 1256 | }, 1257 | "node_modules/eslint-visitor-keys": { 1258 | "version": "3.4.3", 1259 | "dev": true, 1260 | "license": "Apache-2.0", 1261 | "engines": { 1262 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 1263 | }, 1264 | "funding": { 1265 | "url": "https://opencollective.com/eslint" 1266 | } 1267 | }, 1268 | "node_modules/espree": { 1269 | "version": "9.6.1", 1270 | "dev": true, 1271 | "license": "BSD-2-Clause", 1272 | "dependencies": { 1273 | "acorn": "^8.9.0", 1274 | "acorn-jsx": "^5.3.2", 1275 | "eslint-visitor-keys": "^3.4.1" 1276 | }, 1277 | "engines": { 1278 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 1279 | }, 1280 | "funding": { 1281 | "url": "https://opencollective.com/eslint" 1282 | } 1283 | }, 1284 | "node_modules/etag": { 1285 | "version": "1.8.1", 1286 | "dev": true, 1287 | "license": "MIT", 1288 | "engines": { 1289 | "node": ">= 0.6" 1290 | } 1291 | }, 1292 | "node_modules/express6": { 1293 | "version": "0.1.2", 1294 | "dev": true, 1295 | "license": "MIT", 1296 | "dependencies": { 1297 | "accepts": "^1.3.7", 1298 | "array-flatten": "^3.0.0", 1299 | "content-disposition": "^0.5.3", 1300 | "content-type": "^1.0.4", 1301 | "cookie": "^0.4.0", 1302 | "cookie-signature": "^1.0.6", 1303 | "debug": "^4.3.2", 1304 | "encodeurl": "^1.0.2", 1305 | "escape-html": "^1.0.3", 1306 | "etag": "^1.8.1", 1307 | "finalhandler": "^1.1.2", 1308 | "fresh": "^0.5.2", 1309 | "merge-descriptors": "^1.0.1", 1310 | "methods": "^1.1.2", 1311 | "on-finished": "^2.3.0", 1312 | "parseurl": "^1.3.3", 1313 | "path-to-regexp": "^0.1.7", 1314 | "proxy-addr": "^2.0.5", 1315 | "qs": "^6.7.0", 1316 | "range-parser": "^1.2.1", 1317 | "send": "^0.17.1", 1318 | "serve-static": "^1.14.1", 1319 | "statuses": "^2.0.1", 1320 | "type-is": "^1.6.18", 1321 | "utils-merge": "^1.0.1", 1322 | "vary": "^1.1.2" 1323 | }, 1324 | "engines": { 1325 | "node": "^14.15 || >=16" 1326 | } 1327 | }, 1328 | "node_modules/fast-deep-equal": { 1329 | "version": "3.1.3", 1330 | "dev": true, 1331 | "license": "MIT" 1332 | }, 1333 | "node_modules/fill-range": { 1334 | "version": "7.0.1", 1335 | "dev": true, 1336 | "license": "MIT", 1337 | "dependencies": { 1338 | "to-regex-range": "^5.0.1" 1339 | }, 1340 | "engines": { 1341 | "node": ">=8" 1342 | } 1343 | }, 1344 | "node_modules/finalhandler": { 1345 | "version": "1.2.0", 1346 | "dev": true, 1347 | "license": "MIT", 1348 | "dependencies": { 1349 | "debug": "2.6.9", 1350 | "encodeurl": "~1.0.2", 1351 | "escape-html": "~1.0.3", 1352 | "on-finished": "2.4.1", 1353 | "parseurl": "~1.3.3", 1354 | "statuses": "2.0.1", 1355 | "unpipe": "~1.0.0" 1356 | }, 1357 | "engines": { 1358 | "node": ">= 0.8" 1359 | } 1360 | }, 1361 | "node_modules/finalhandler/node_modules/debug": { 1362 | "version": "2.6.9", 1363 | "dev": true, 1364 | "license": "MIT", 1365 | "dependencies": { 1366 | "ms": "2.0.0" 1367 | } 1368 | }, 1369 | "node_modules/finalhandler/node_modules/debug/node_modules/ms": { 1370 | "version": "2.0.0", 1371 | "dev": true, 1372 | "license": "MIT" 1373 | }, 1374 | "node_modules/five-server": { 1375 | "version": "0.3.1", 1376 | "dev": true, 1377 | "license": "SEE LICENSE IN LICENSE", 1378 | "dependencies": { 1379 | "@yandeu/open-cjs": "^0.0.0", 1380 | "chokidar": "^3.5.1", 1381 | "cors": "^2.8.5", 1382 | "debug": "^4.3.1", 1383 | "express6": "^0.1.2", 1384 | "html-validate": "^7.1.1", 1385 | "mime-types": "~2.1.24", 1386 | "node-html-parser": "~5.4.1", 1387 | "parseurl": "~1.3.3", 1388 | "selfsigned": "^2.0.0", 1389 | "ws": "^8.2.0" 1390 | }, 1391 | "bin": { 1392 | "five-server": "lib/bin.js", 1393 | "live-server": "lib/bin.js" 1394 | }, 1395 | "engines": { 1396 | "node": ">=14" 1397 | }, 1398 | "funding": { 1399 | "url": "https://github.com/sponsors/yandeu" 1400 | } 1401 | }, 1402 | "node_modules/foreground-child": { 1403 | "version": "3.1.1", 1404 | "dev": true, 1405 | "license": "ISC", 1406 | "dependencies": { 1407 | "cross-spawn": "^7.0.0", 1408 | "signal-exit": "^4.0.1" 1409 | }, 1410 | "engines": { 1411 | "node": ">=14" 1412 | }, 1413 | "funding": { 1414 | "url": "https://github.com/sponsors/isaacs" 1415 | } 1416 | }, 1417 | "node_modules/forwarded": { 1418 | "version": "0.2.0", 1419 | "dev": true, 1420 | "license": "MIT", 1421 | "engines": { 1422 | "node": ">= 0.6" 1423 | } 1424 | }, 1425 | "node_modules/fresh": { 1426 | "version": "0.5.2", 1427 | "dev": true, 1428 | "license": "MIT", 1429 | "engines": { 1430 | "node": ">= 0.6" 1431 | } 1432 | }, 1433 | "node_modules/function-bind": { 1434 | "version": "1.1.2", 1435 | "dev": true, 1436 | "license": "MIT", 1437 | "funding": { 1438 | "url": "https://github.com/sponsors/ljharb" 1439 | } 1440 | }, 1441 | "node_modules/get-caller-file": { 1442 | "version": "2.0.5", 1443 | "dev": true, 1444 | "license": "ISC", 1445 | "engines": { 1446 | "node": "6.* || 8.* || >= 10.*" 1447 | } 1448 | }, 1449 | "node_modules/get-intrinsic": { 1450 | "version": "1.2.1", 1451 | "dev": true, 1452 | "license": "MIT", 1453 | "dependencies": { 1454 | "function-bind": "^1.1.1", 1455 | "has": "^1.0.3", 1456 | "has-proto": "^1.0.1", 1457 | "has-symbols": "^1.0.3" 1458 | }, 1459 | "funding": { 1460 | "url": "https://github.com/sponsors/ljharb" 1461 | } 1462 | }, 1463 | "node_modules/glob": { 1464 | "version": "10.3.10", 1465 | "dev": true, 1466 | "license": "ISC", 1467 | "dependencies": { 1468 | "foreground-child": "^3.1.0", 1469 | "jackspeak": "^2.3.5", 1470 | "minimatch": "^9.0.1", 1471 | "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", 1472 | "path-scurry": "^1.10.1" 1473 | }, 1474 | "bin": { 1475 | "glob": "dist/esm/bin.mjs" 1476 | }, 1477 | "engines": { 1478 | "node": ">=16 || 14 >=14.17" 1479 | }, 1480 | "funding": { 1481 | "url": "https://github.com/sponsors/isaacs" 1482 | } 1483 | }, 1484 | "node_modules/glob-parent": { 1485 | "version": "5.1.2", 1486 | "dev": true, 1487 | "license": "ISC", 1488 | "dependencies": { 1489 | "is-glob": "^4.0.1" 1490 | }, 1491 | "engines": { 1492 | "node": ">= 6" 1493 | } 1494 | }, 1495 | "node_modules/has": { 1496 | "version": "1.0.4", 1497 | "dev": true, 1498 | "license": "MIT", 1499 | "engines": { 1500 | "node": ">= 0.4.0" 1501 | } 1502 | }, 1503 | "node_modules/has-flag": { 1504 | "version": "4.0.0", 1505 | "dev": true, 1506 | "license": "MIT", 1507 | "engines": { 1508 | "node": ">=8" 1509 | } 1510 | }, 1511 | "node_modules/has-proto": { 1512 | "version": "1.0.1", 1513 | "dev": true, 1514 | "license": "MIT", 1515 | "engines": { 1516 | "node": ">= 0.4" 1517 | }, 1518 | "funding": { 1519 | "url": "https://github.com/sponsors/ljharb" 1520 | } 1521 | }, 1522 | "node_modules/has-symbols": { 1523 | "version": "1.0.3", 1524 | "dev": true, 1525 | "license": "MIT", 1526 | "engines": { 1527 | "node": ">= 0.4" 1528 | }, 1529 | "funding": { 1530 | "url": "https://github.com/sponsors/ljharb" 1531 | } 1532 | }, 1533 | "node_modules/he": { 1534 | "version": "1.2.0", 1535 | "dev": true, 1536 | "license": "MIT", 1537 | "bin": { 1538 | "he": "bin/he" 1539 | } 1540 | }, 1541 | "node_modules/html-validate": { 1542 | "version": "7.18.1", 1543 | "dev": true, 1544 | "license": "MIT", 1545 | "workspaces": [ 1546 | "docs" 1547 | ], 1548 | "dependencies": { 1549 | "@babel/code-frame": "^7.10.0", 1550 | "@html-validate/stylish": "^4.0.1", 1551 | "@sidvind/better-ajv-errors": "^2.0.0", 1552 | "acorn-walk": "^8.0.0", 1553 | "ajv": "^8.0.0", 1554 | "deepmerge": "^4.2.0", 1555 | "espree": "^9.0.0", 1556 | "glob": "^10.0.0", 1557 | "ignore": "^5.0.0", 1558 | "kleur": "^4.1.0", 1559 | "minimist": "^1.2.0", 1560 | "prompts": "^2.0.0", 1561 | "semver": "^7.0.0" 1562 | }, 1563 | "bin": { 1564 | "html-validate": "bin/html-validate.js" 1565 | }, 1566 | "engines": { 1567 | "node": ">= 14.0" 1568 | }, 1569 | "peerDependencies": { 1570 | "jest": "^25.1 || ^26 || ^27.1 || ^28.1.3 || ^29.0.3", 1571 | "jest-diff": "^25.1 || ^26 || ^27.1 || ^28.1.3 || ^29.0.3", 1572 | "jest-snapshot": "^25.1 || ^26 || ^27.1 || ^28.1.3 || ^29.0.3" 1573 | }, 1574 | "peerDependenciesMeta": { 1575 | "jest": { 1576 | "optional": true 1577 | }, 1578 | "jest-diff": { 1579 | "optional": true 1580 | }, 1581 | "jest-snapshot": { 1582 | "optional": true 1583 | } 1584 | } 1585 | }, 1586 | "node_modules/http-errors": { 1587 | "version": "1.8.1", 1588 | "dev": true, 1589 | "license": "MIT", 1590 | "dependencies": { 1591 | "depd": "~1.1.2", 1592 | "inherits": "2.0.4", 1593 | "setprototypeof": "1.2.0", 1594 | "statuses": ">= 1.5.0 < 2", 1595 | "toidentifier": "1.0.1" 1596 | }, 1597 | "engines": { 1598 | "node": ">= 0.6" 1599 | } 1600 | }, 1601 | "node_modules/http-errors/node_modules/statuses": { 1602 | "version": "1.5.0", 1603 | "dev": true, 1604 | "license": "MIT", 1605 | "engines": { 1606 | "node": ">= 0.6" 1607 | } 1608 | }, 1609 | "node_modules/ignore": { 1610 | "version": "5.2.4", 1611 | "dev": true, 1612 | "license": "MIT", 1613 | "engines": { 1614 | "node": ">= 4" 1615 | } 1616 | }, 1617 | "node_modules/inherits": { 1618 | "version": "2.0.4", 1619 | "dev": true, 1620 | "license": "ISC" 1621 | }, 1622 | "node_modules/ipaddr.js": { 1623 | "version": "1.9.1", 1624 | "dev": true, 1625 | "license": "MIT", 1626 | "engines": { 1627 | "node": ">= 0.10" 1628 | } 1629 | }, 1630 | "node_modules/is-binary-path": { 1631 | "version": "2.1.0", 1632 | "dev": true, 1633 | "license": "MIT", 1634 | "dependencies": { 1635 | "binary-extensions": "^2.0.0" 1636 | }, 1637 | "engines": { 1638 | "node": ">=8" 1639 | } 1640 | }, 1641 | "node_modules/is-extglob": { 1642 | "version": "2.1.1", 1643 | "dev": true, 1644 | "license": "MIT", 1645 | "engines": { 1646 | "node": ">=0.10.0" 1647 | } 1648 | }, 1649 | "node_modules/is-fullwidth-code-point": { 1650 | "version": "3.0.0", 1651 | "dev": true, 1652 | "license": "MIT", 1653 | "engines": { 1654 | "node": ">=8" 1655 | } 1656 | }, 1657 | "node_modules/is-glob": { 1658 | "version": "4.0.3", 1659 | "dev": true, 1660 | "license": "MIT", 1661 | "dependencies": { 1662 | "is-extglob": "^2.1.1" 1663 | }, 1664 | "engines": { 1665 | "node": ">=0.10.0" 1666 | } 1667 | }, 1668 | "node_modules/is-number": { 1669 | "version": "7.0.0", 1670 | "dev": true, 1671 | "license": "MIT", 1672 | "engines": { 1673 | "node": ">=0.12.0" 1674 | } 1675 | }, 1676 | "node_modules/isexe": { 1677 | "version": "2.0.0", 1678 | "dev": true, 1679 | "license": "ISC" 1680 | }, 1681 | "node_modules/jackspeak": { 1682 | "version": "2.3.6", 1683 | "dev": true, 1684 | "license": "BlueOak-1.0.0", 1685 | "dependencies": { 1686 | "@isaacs/cliui": "^8.0.2" 1687 | }, 1688 | "engines": { 1689 | "node": ">=14" 1690 | }, 1691 | "funding": { 1692 | "url": "https://github.com/sponsors/isaacs" 1693 | }, 1694 | "optionalDependencies": { 1695 | "@pkgjs/parseargs": "^0.11.0" 1696 | } 1697 | }, 1698 | "node_modules/js-tokens": { 1699 | "version": "4.0.0", 1700 | "dev": true, 1701 | "license": "MIT" 1702 | }, 1703 | "node_modules/json-schema-traverse": { 1704 | "version": "1.0.0", 1705 | "dev": true, 1706 | "license": "MIT" 1707 | }, 1708 | "node_modules/kleur": { 1709 | "version": "4.1.5", 1710 | "dev": true, 1711 | "license": "MIT", 1712 | "engines": { 1713 | "node": ">=6" 1714 | } 1715 | }, 1716 | "node_modules/lodash": { 1717 | "version": "4.17.21", 1718 | "dev": true, 1719 | "license": "MIT" 1720 | }, 1721 | "node_modules/lru-cache": { 1722 | "version": "6.0.0", 1723 | "dev": true, 1724 | "license": "ISC", 1725 | "dependencies": { 1726 | "yallist": "^4.0.0" 1727 | }, 1728 | "engines": { 1729 | "node": ">=10" 1730 | } 1731 | }, 1732 | "node_modules/media-typer": { 1733 | "version": "0.3.0", 1734 | "dev": true, 1735 | "license": "MIT", 1736 | "engines": { 1737 | "node": ">= 0.6" 1738 | } 1739 | }, 1740 | "node_modules/merge-descriptors": { 1741 | "version": "1.0.1", 1742 | "dev": true, 1743 | "license": "MIT" 1744 | }, 1745 | "node_modules/methods": { 1746 | "version": "1.1.2", 1747 | "dev": true, 1748 | "license": "MIT", 1749 | "engines": { 1750 | "node": ">= 0.6" 1751 | } 1752 | }, 1753 | "node_modules/mime": { 1754 | "version": "1.6.0", 1755 | "dev": true, 1756 | "license": "MIT", 1757 | "bin": { 1758 | "mime": "cli.js" 1759 | }, 1760 | "engines": { 1761 | "node": ">=4" 1762 | } 1763 | }, 1764 | "node_modules/mime-db": { 1765 | "version": "1.52.0", 1766 | "dev": true, 1767 | "license": "MIT", 1768 | "engines": { 1769 | "node": ">= 0.6" 1770 | } 1771 | }, 1772 | "node_modules/mime-types": { 1773 | "version": "2.1.35", 1774 | "dev": true, 1775 | "license": "MIT", 1776 | "dependencies": { 1777 | "mime-db": "1.52.0" 1778 | }, 1779 | "engines": { 1780 | "node": ">= 0.6" 1781 | } 1782 | }, 1783 | "node_modules/minimatch": { 1784 | "version": "9.0.3", 1785 | "dev": true, 1786 | "license": "ISC", 1787 | "dependencies": { 1788 | "brace-expansion": "^2.0.1" 1789 | }, 1790 | "engines": { 1791 | "node": ">=16 || 14 >=14.17" 1792 | }, 1793 | "funding": { 1794 | "url": "https://github.com/sponsors/isaacs" 1795 | } 1796 | }, 1797 | "node_modules/minimist": { 1798 | "version": "1.2.8", 1799 | "dev": true, 1800 | "license": "MIT", 1801 | "funding": { 1802 | "url": "https://github.com/sponsors/ljharb" 1803 | } 1804 | }, 1805 | "node_modules/minipass": { 1806 | "version": "7.0.4", 1807 | "dev": true, 1808 | "license": "ISC", 1809 | "engines": { 1810 | "node": ">=16 || 14 >=14.17" 1811 | } 1812 | }, 1813 | "node_modules/ms": { 1814 | "version": "2.1.2", 1815 | "dev": true, 1816 | "license": "MIT" 1817 | }, 1818 | "node_modules/negotiator": { 1819 | "version": "0.6.3", 1820 | "dev": true, 1821 | "license": "MIT", 1822 | "engines": { 1823 | "node": ">= 0.6" 1824 | } 1825 | }, 1826 | "node_modules/node-forge": { 1827 | "version": "1.3.1", 1828 | "dev": true, 1829 | "license": "(BSD-3-Clause OR GPL-2.0)", 1830 | "engines": { 1831 | "node": ">= 6.13.0" 1832 | } 1833 | }, 1834 | "node_modules/node-html-parser": { 1835 | "version": "5.4.2", 1836 | "dev": true, 1837 | "license": "MIT", 1838 | "dependencies": { 1839 | "css-select": "^4.2.1", 1840 | "he": "1.2.0" 1841 | } 1842 | }, 1843 | "node_modules/normalize-path": { 1844 | "version": "3.0.0", 1845 | "dev": true, 1846 | "license": "MIT", 1847 | "engines": { 1848 | "node": ">=0.10.0" 1849 | } 1850 | }, 1851 | "node_modules/nth-check": { 1852 | "version": "2.1.1", 1853 | "dev": true, 1854 | "license": "BSD-2-Clause", 1855 | "dependencies": { 1856 | "boolbase": "^1.0.0" 1857 | }, 1858 | "funding": { 1859 | "url": "https://github.com/fb55/nth-check?sponsor=1" 1860 | } 1861 | }, 1862 | "node_modules/object-assign": { 1863 | "version": "4.1.1", 1864 | "dev": true, 1865 | "license": "MIT", 1866 | "engines": { 1867 | "node": ">=0.10.0" 1868 | } 1869 | }, 1870 | "node_modules/object-inspect": { 1871 | "version": "1.13.0", 1872 | "dev": true, 1873 | "license": "MIT", 1874 | "funding": { 1875 | "url": "https://github.com/sponsors/ljharb" 1876 | } 1877 | }, 1878 | "node_modules/on-finished": { 1879 | "version": "2.4.1", 1880 | "dev": true, 1881 | "license": "MIT", 1882 | "dependencies": { 1883 | "ee-first": "1.1.1" 1884 | }, 1885 | "engines": { 1886 | "node": ">= 0.8" 1887 | } 1888 | }, 1889 | "node_modules/parseurl": { 1890 | "version": "1.3.3", 1891 | "dev": true, 1892 | "license": "MIT", 1893 | "engines": { 1894 | "node": ">= 0.8" 1895 | } 1896 | }, 1897 | "node_modules/path-key": { 1898 | "version": "3.1.1", 1899 | "dev": true, 1900 | "license": "MIT", 1901 | "engines": { 1902 | "node": ">=8" 1903 | } 1904 | }, 1905 | "node_modules/path-scurry": { 1906 | "version": "1.10.1", 1907 | "dev": true, 1908 | "license": "BlueOak-1.0.0", 1909 | "dependencies": { 1910 | "lru-cache": "^9.1.1 || ^10.0.0", 1911 | "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" 1912 | }, 1913 | "engines": { 1914 | "node": ">=16 || 14 >=14.17" 1915 | }, 1916 | "funding": { 1917 | "url": "https://github.com/sponsors/isaacs" 1918 | } 1919 | }, 1920 | "node_modules/path-scurry/node_modules/lru-cache": { 1921 | "version": "10.0.1", 1922 | "dev": true, 1923 | "license": "ISC", 1924 | "engines": { 1925 | "node": "14 || >=16.14" 1926 | } 1927 | }, 1928 | "node_modules/path-to-regexp": { 1929 | "version": "0.1.7", 1930 | "dev": true, 1931 | "license": "MIT" 1932 | }, 1933 | "node_modules/picomatch": { 1934 | "version": "2.3.1", 1935 | "dev": true, 1936 | "license": "MIT", 1937 | "engines": { 1938 | "node": ">=8.6" 1939 | }, 1940 | "funding": { 1941 | "url": "https://github.com/sponsors/jonschlinkert" 1942 | } 1943 | }, 1944 | "node_modules/prompts": { 1945 | "version": "2.4.2", 1946 | "dev": true, 1947 | "license": "MIT", 1948 | "dependencies": { 1949 | "kleur": "^3.0.3", 1950 | "sisteransi": "^1.0.5" 1951 | }, 1952 | "engines": { 1953 | "node": ">= 6" 1954 | } 1955 | }, 1956 | "node_modules/prompts/node_modules/kleur": { 1957 | "version": "3.0.3", 1958 | "dev": true, 1959 | "license": "MIT", 1960 | "engines": { 1961 | "node": ">=6" 1962 | } 1963 | }, 1964 | "node_modules/proxy-addr": { 1965 | "version": "2.0.7", 1966 | "dev": true, 1967 | "license": "MIT", 1968 | "dependencies": { 1969 | "forwarded": "0.2.0", 1970 | "ipaddr.js": "1.9.1" 1971 | }, 1972 | "engines": { 1973 | "node": ">= 0.10" 1974 | } 1975 | }, 1976 | "node_modules/punycode": { 1977 | "version": "2.3.0", 1978 | "dev": true, 1979 | "license": "MIT", 1980 | "engines": { 1981 | "node": ">=6" 1982 | } 1983 | }, 1984 | "node_modules/qs": { 1985 | "version": "6.11.2", 1986 | "dev": true, 1987 | "license": "BSD-3-Clause", 1988 | "dependencies": { 1989 | "side-channel": "^1.0.4" 1990 | }, 1991 | "engines": { 1992 | "node": ">=0.6" 1993 | }, 1994 | "funding": { 1995 | "url": "https://github.com/sponsors/ljharb" 1996 | } 1997 | }, 1998 | "node_modules/range-parser": { 1999 | "version": "1.2.1", 2000 | "dev": true, 2001 | "license": "MIT", 2002 | "engines": { 2003 | "node": ">= 0.6" 2004 | } 2005 | }, 2006 | "node_modules/readdirp": { 2007 | "version": "3.6.0", 2008 | "dev": true, 2009 | "license": "MIT", 2010 | "dependencies": { 2011 | "picomatch": "^2.2.1" 2012 | }, 2013 | "engines": { 2014 | "node": ">=8.10.0" 2015 | } 2016 | }, 2017 | "node_modules/regenerator-runtime": { 2018 | "version": "0.14.0", 2019 | "dev": true, 2020 | "license": "MIT" 2021 | }, 2022 | "node_modules/require-directory": { 2023 | "version": "2.1.1", 2024 | "dev": true, 2025 | "license": "MIT", 2026 | "engines": { 2027 | "node": ">=0.10.0" 2028 | } 2029 | }, 2030 | "node_modules/require-from-string": { 2031 | "version": "2.0.2", 2032 | "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", 2033 | "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", 2034 | "dev": true, 2035 | "engines": { 2036 | "node": ">=0.10.0" 2037 | } 2038 | }, 2039 | "node_modules/rxjs": { 2040 | "version": "7.8.1", 2041 | "dev": true, 2042 | "license": "Apache-2.0", 2043 | "dependencies": { 2044 | "tslib": "^2.1.0" 2045 | } 2046 | }, 2047 | "node_modules/safe-buffer": { 2048 | "version": "5.2.1", 2049 | "dev": true, 2050 | "funding": [ 2051 | { 2052 | "type": "github", 2053 | "url": "https://github.com/sponsors/feross" 2054 | }, 2055 | { 2056 | "type": "patreon", 2057 | "url": "https://www.patreon.com/feross" 2058 | }, 2059 | { 2060 | "type": "consulting", 2061 | "url": "https://feross.org/support" 2062 | } 2063 | ], 2064 | "license": "MIT" 2065 | }, 2066 | "node_modules/selfsigned": { 2067 | "version": "2.1.1", 2068 | "dev": true, 2069 | "license": "MIT", 2070 | "dependencies": { 2071 | "node-forge": "^1" 2072 | }, 2073 | "engines": { 2074 | "node": ">=10" 2075 | } 2076 | }, 2077 | "node_modules/semver": { 2078 | "version": "7.5.4", 2079 | "dev": true, 2080 | "license": "ISC", 2081 | "dependencies": { 2082 | "lru-cache": "^6.0.0" 2083 | }, 2084 | "bin": { 2085 | "semver": "bin/semver.js" 2086 | }, 2087 | "engines": { 2088 | "node": ">=10" 2089 | } 2090 | }, 2091 | "node_modules/send": { 2092 | "version": "0.17.2", 2093 | "dev": true, 2094 | "license": "MIT", 2095 | "dependencies": { 2096 | "debug": "2.6.9", 2097 | "depd": "~1.1.2", 2098 | "destroy": "~1.0.4", 2099 | "encodeurl": "~1.0.2", 2100 | "escape-html": "~1.0.3", 2101 | "etag": "~1.8.1", 2102 | "fresh": "0.5.2", 2103 | "http-errors": "1.8.1", 2104 | "mime": "1.6.0", 2105 | "ms": "2.1.3", 2106 | "on-finished": "~2.3.0", 2107 | "range-parser": "~1.2.1", 2108 | "statuses": "~1.5.0" 2109 | }, 2110 | "engines": { 2111 | "node": ">= 0.8.0" 2112 | } 2113 | }, 2114 | "node_modules/send/node_modules/debug": { 2115 | "version": "2.6.9", 2116 | "dev": true, 2117 | "license": "MIT", 2118 | "dependencies": { 2119 | "ms": "2.0.0" 2120 | } 2121 | }, 2122 | "node_modules/send/node_modules/debug/node_modules/ms": { 2123 | "version": "2.0.0", 2124 | "dev": true, 2125 | "license": "MIT" 2126 | }, 2127 | "node_modules/send/node_modules/ms": { 2128 | "version": "2.1.3", 2129 | "dev": true, 2130 | "license": "MIT" 2131 | }, 2132 | "node_modules/send/node_modules/on-finished": { 2133 | "version": "2.3.0", 2134 | "dev": true, 2135 | "license": "MIT", 2136 | "dependencies": { 2137 | "ee-first": "1.1.1" 2138 | }, 2139 | "engines": { 2140 | "node": ">= 0.8" 2141 | } 2142 | }, 2143 | "node_modules/send/node_modules/statuses": { 2144 | "version": "1.5.0", 2145 | "dev": true, 2146 | "license": "MIT", 2147 | "engines": { 2148 | "node": ">= 0.6" 2149 | } 2150 | }, 2151 | "node_modules/serve-static": { 2152 | "version": "1.15.0", 2153 | "dev": true, 2154 | "license": "MIT", 2155 | "dependencies": { 2156 | "encodeurl": "~1.0.2", 2157 | "escape-html": "~1.0.3", 2158 | "parseurl": "~1.3.3", 2159 | "send": "0.18.0" 2160 | }, 2161 | "engines": { 2162 | "node": ">= 0.8.0" 2163 | } 2164 | }, 2165 | "node_modules/serve-static/node_modules/send": { 2166 | "version": "0.18.0", 2167 | "dev": true, 2168 | "license": "MIT", 2169 | "dependencies": { 2170 | "debug": "2.6.9", 2171 | "depd": "2.0.0", 2172 | "destroy": "1.2.0", 2173 | "encodeurl": "~1.0.2", 2174 | "escape-html": "~1.0.3", 2175 | "etag": "~1.8.1", 2176 | "fresh": "0.5.2", 2177 | "http-errors": "2.0.0", 2178 | "mime": "1.6.0", 2179 | "ms": "2.1.3", 2180 | "on-finished": "2.4.1", 2181 | "range-parser": "~1.2.1", 2182 | "statuses": "2.0.1" 2183 | }, 2184 | "engines": { 2185 | "node": ">= 0.8.0" 2186 | } 2187 | }, 2188 | "node_modules/serve-static/node_modules/send/node_modules/debug": { 2189 | "version": "2.6.9", 2190 | "dev": true, 2191 | "license": "MIT", 2192 | "dependencies": { 2193 | "ms": "2.0.0" 2194 | } 2195 | }, 2196 | "node_modules/serve-static/node_modules/send/node_modules/debug/node_modules/ms": { 2197 | "version": "2.0.0", 2198 | "dev": true, 2199 | "license": "MIT" 2200 | }, 2201 | "node_modules/serve-static/node_modules/send/node_modules/depd": { 2202 | "version": "2.0.0", 2203 | "dev": true, 2204 | "license": "MIT", 2205 | "engines": { 2206 | "node": ">= 0.8" 2207 | } 2208 | }, 2209 | "node_modules/serve-static/node_modules/send/node_modules/destroy": { 2210 | "version": "1.2.0", 2211 | "dev": true, 2212 | "license": "MIT", 2213 | "engines": { 2214 | "node": ">= 0.8", 2215 | "npm": "1.2.8000 || >= 1.4.16" 2216 | } 2217 | }, 2218 | "node_modules/serve-static/node_modules/send/node_modules/http-errors": { 2219 | "version": "2.0.0", 2220 | "dev": true, 2221 | "license": "MIT", 2222 | "dependencies": { 2223 | "depd": "2.0.0", 2224 | "inherits": "2.0.4", 2225 | "setprototypeof": "1.2.0", 2226 | "statuses": "2.0.1", 2227 | "toidentifier": "1.0.1" 2228 | }, 2229 | "engines": { 2230 | "node": ">= 0.8" 2231 | } 2232 | }, 2233 | "node_modules/serve-static/node_modules/send/node_modules/ms": { 2234 | "version": "2.1.3", 2235 | "dev": true, 2236 | "license": "MIT" 2237 | }, 2238 | "node_modules/setprototypeof": { 2239 | "version": "1.2.0", 2240 | "dev": true, 2241 | "license": "ISC" 2242 | }, 2243 | "node_modules/shebang-command": { 2244 | "version": "2.0.0", 2245 | "dev": true, 2246 | "license": "MIT", 2247 | "dependencies": { 2248 | "shebang-regex": "^3.0.0" 2249 | }, 2250 | "engines": { 2251 | "node": ">=8" 2252 | } 2253 | }, 2254 | "node_modules/shebang-regex": { 2255 | "version": "3.0.0", 2256 | "dev": true, 2257 | "license": "MIT", 2258 | "engines": { 2259 | "node": ">=8" 2260 | } 2261 | }, 2262 | "node_modules/shell-quote": { 2263 | "version": "1.8.1", 2264 | "dev": true, 2265 | "license": "MIT", 2266 | "funding": { 2267 | "url": "https://github.com/sponsors/ljharb" 2268 | } 2269 | }, 2270 | "node_modules/side-channel": { 2271 | "version": "1.0.4", 2272 | "dev": true, 2273 | "license": "MIT", 2274 | "dependencies": { 2275 | "call-bind": "^1.0.0", 2276 | "get-intrinsic": "^1.0.2", 2277 | "object-inspect": "^1.9.0" 2278 | }, 2279 | "funding": { 2280 | "url": "https://github.com/sponsors/ljharb" 2281 | } 2282 | }, 2283 | "node_modules/signal-exit": { 2284 | "version": "4.1.0", 2285 | "dev": true, 2286 | "license": "ISC", 2287 | "engines": { 2288 | "node": ">=14" 2289 | }, 2290 | "funding": { 2291 | "url": "https://github.com/sponsors/isaacs" 2292 | } 2293 | }, 2294 | "node_modules/sisteransi": { 2295 | "version": "1.0.5", 2296 | "dev": true, 2297 | "license": "MIT" 2298 | }, 2299 | "node_modules/spawn-command": { 2300 | "version": "0.0.2", 2301 | "dev": true 2302 | }, 2303 | "node_modules/statuses": { 2304 | "version": "2.0.1", 2305 | "dev": true, 2306 | "license": "MIT", 2307 | "engines": { 2308 | "node": ">= 0.8" 2309 | } 2310 | }, 2311 | "node_modules/string-width": { 2312 | "version": "4.2.3", 2313 | "dev": true, 2314 | "license": "MIT", 2315 | "dependencies": { 2316 | "emoji-regex": "^8.0.0", 2317 | "is-fullwidth-code-point": "^3.0.0", 2318 | "strip-ansi": "^6.0.1" 2319 | }, 2320 | "engines": { 2321 | "node": ">=8" 2322 | } 2323 | }, 2324 | "node_modules/strip-ansi": { 2325 | "version": "6.0.1", 2326 | "dev": true, 2327 | "license": "MIT", 2328 | "dependencies": { 2329 | "ansi-regex": "^5.0.1" 2330 | }, 2331 | "engines": { 2332 | "node": ">=8" 2333 | } 2334 | }, 2335 | "node_modules/supports-color": { 2336 | "version": "8.1.1", 2337 | "dev": true, 2338 | "license": "MIT", 2339 | "dependencies": { 2340 | "has-flag": "^4.0.0" 2341 | }, 2342 | "engines": { 2343 | "node": ">=10" 2344 | }, 2345 | "funding": { 2346 | "url": "https://github.com/chalk/supports-color?sponsor=1" 2347 | } 2348 | }, 2349 | "node_modules/to-regex-range": { 2350 | "version": "5.0.1", 2351 | "dev": true, 2352 | "license": "MIT", 2353 | "dependencies": { 2354 | "is-number": "^7.0.0" 2355 | }, 2356 | "engines": { 2357 | "node": ">=8.0" 2358 | } 2359 | }, 2360 | "node_modules/toidentifier": { 2361 | "version": "1.0.1", 2362 | "dev": true, 2363 | "license": "MIT", 2364 | "engines": { 2365 | "node": ">=0.6" 2366 | } 2367 | }, 2368 | "node_modules/tree-kill": { 2369 | "version": "1.2.2", 2370 | "dev": true, 2371 | "license": "MIT", 2372 | "bin": { 2373 | "tree-kill": "cli.js" 2374 | } 2375 | }, 2376 | "node_modules/tslib": { 2377 | "version": "2.6.2", 2378 | "dev": true, 2379 | "license": "0BSD" 2380 | }, 2381 | "node_modules/type-is": { 2382 | "version": "1.6.18", 2383 | "dev": true, 2384 | "license": "MIT", 2385 | "dependencies": { 2386 | "media-typer": "0.3.0", 2387 | "mime-types": "~2.1.24" 2388 | }, 2389 | "engines": { 2390 | "node": ">= 0.6" 2391 | } 2392 | }, 2393 | "node_modules/unpipe": { 2394 | "version": "1.0.0", 2395 | "dev": true, 2396 | "license": "MIT", 2397 | "engines": { 2398 | "node": ">= 0.8" 2399 | } 2400 | }, 2401 | "node_modules/uri-js": { 2402 | "version": "4.4.1", 2403 | "dev": true, 2404 | "license": "BSD-2-Clause", 2405 | "dependencies": { 2406 | "punycode": "^2.1.0" 2407 | } 2408 | }, 2409 | "node_modules/utils-merge": { 2410 | "version": "1.0.1", 2411 | "dev": true, 2412 | "license": "MIT", 2413 | "engines": { 2414 | "node": ">= 0.4.0" 2415 | } 2416 | }, 2417 | "node_modules/vary": { 2418 | "version": "1.1.2", 2419 | "dev": true, 2420 | "license": "MIT", 2421 | "engines": { 2422 | "node": ">= 0.8" 2423 | } 2424 | }, 2425 | "node_modules/which": { 2426 | "version": "2.0.2", 2427 | "dev": true, 2428 | "license": "ISC", 2429 | "dependencies": { 2430 | "isexe": "^2.0.0" 2431 | }, 2432 | "bin": { 2433 | "node-which": "bin/node-which" 2434 | }, 2435 | "engines": { 2436 | "node": ">= 8" 2437 | } 2438 | }, 2439 | "node_modules/wrap-ansi": { 2440 | "version": "7.0.0", 2441 | "dev": true, 2442 | "license": "MIT", 2443 | "dependencies": { 2444 | "ansi-styles": "^4.0.0", 2445 | "string-width": "^4.1.0", 2446 | "strip-ansi": "^6.0.0" 2447 | }, 2448 | "engines": { 2449 | "node": ">=10" 2450 | }, 2451 | "funding": { 2452 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 2453 | } 2454 | }, 2455 | "node_modules/ws": { 2456 | "version": "8.14.2", 2457 | "dev": true, 2458 | "license": "MIT", 2459 | "engines": { 2460 | "node": ">=10.0.0" 2461 | }, 2462 | "peerDependencies": { 2463 | "bufferutil": "^4.0.1", 2464 | "utf-8-validate": ">=5.0.2" 2465 | }, 2466 | "peerDependenciesMeta": { 2467 | "bufferutil": { 2468 | "optional": true 2469 | }, 2470 | "utf-8-validate": { 2471 | "optional": true 2472 | } 2473 | } 2474 | }, 2475 | "node_modules/y18n": { 2476 | "version": "5.0.8", 2477 | "dev": true, 2478 | "license": "ISC", 2479 | "engines": { 2480 | "node": ">=10" 2481 | } 2482 | }, 2483 | "node_modules/yallist": { 2484 | "version": "4.0.0", 2485 | "dev": true, 2486 | "license": "ISC" 2487 | }, 2488 | "node_modules/yargs": { 2489 | "version": "17.7.2", 2490 | "dev": true, 2491 | "license": "MIT", 2492 | "dependencies": { 2493 | "cliui": "^8.0.1", 2494 | "escalade": "^3.1.1", 2495 | "get-caller-file": "^2.0.5", 2496 | "require-directory": "^2.1.1", 2497 | "string-width": "^4.2.3", 2498 | "y18n": "^5.0.5", 2499 | "yargs-parser": "^21.1.1" 2500 | }, 2501 | "engines": { 2502 | "node": ">=12" 2503 | } 2504 | }, 2505 | "node_modules/yargs-parser": { 2506 | "version": "21.1.1", 2507 | "dev": true, 2508 | "license": "ISC", 2509 | "engines": { 2510 | "node": ">=12" 2511 | } 2512 | } 2513 | } 2514 | } 2515 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "runcss", 3 | "publishConfig": { 4 | "access": "public", 5 | "registry": "https://registry.npmjs.org/" 6 | }, 7 | "version": "0.1.8", 8 | "description": "A utility-first CSS runtime for rapid UI development.", 9 | "main": "dist/runcss.min.mjs", 10 | "module": "dist/runcss.min.mjs", 11 | "types": "types.d.ts", 12 | "scripts": { 13 | "build": "node build.mjs", 14 | "dev": "concurrently \"five-server --open=examples\" \"npm run dev:css\" \"npm run dev:js\" \"npm run dev:module\"", 15 | "dev:css": "esbuild ./src/index.css --bundle --outfile=dist/runcss.css --watch", 16 | "dev:js": "esbuild ./src/iife.js --bundle --outfile=dist/runcss.js --watch", 17 | "dev:module": "esbuild ./src/index.js --format=esm --bundle --outfile=dist/runcss.mjs --watch", 18 | "prepublishOnly": "node build.mjs" 19 | }, 20 | "repository": { 21 | "type": "git", 22 | "url": "git+https://github.com/mudgen/runcss.git" 23 | }, 24 | "keywords": [ 25 | "css", 26 | "javascript", 27 | "ui" 28 | ], 29 | "author": "Luca Fabbian, Nick Mudge", 30 | "license": "MIT", 31 | "bugs": { 32 | "url": "https://github.com/mudgen/runcss/issues" 33 | }, 34 | "homepage": "https://github.com/mudgen/runcss#readme", 35 | "devDependencies": { 36 | "concurrently": "^8.2.1", 37 | "esbuild": "^0.19.4", 38 | "five-server": "^0.3.1" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/colors.preprocess.ts: -------------------------------------------------------------------------------- 1 | /** List of colors and their variants, taken from: 2 | * https://tailwindcss.com/docs/customizing-colors#using-the-default-colors */ 3 | import { clean } from './utils' 4 | 5 | export const opacityKeysTemplate = 6 | [ '0', '5', '10', '20', '25', '30', '40', '50', '60', '70', '75', '80', '90', '95', '100'].join('!') 7 | export const opacityValuesTemplate = 8 | ['00', '0D', '1A', '33', '40', '4D', '66', '80', '99', 'B3', 'BF', 'CC', 'E6', 'F2', 'FF'].join('!') 9 | 10 | 11 | export const colorsTemplate = clean(` 12 | slate 13 | #f8fafc 14 | #f1f5f9 15 | #e2e8f0 16 | #cbd5e1 17 | #94a3b8 18 | #64748b 19 | #475569 20 | #334155 21 | #1e293b 22 | #0f172a 23 | #020617 24 | gray 25 | #f9fafb 26 | #f3f4f6 27 | #e5e7eb 28 | #d1d5db 29 | #9ca3af 30 | #6b7280 31 | #4b5563 32 | #374151 33 | #1f2937 34 | #111827 35 | #030712 36 | zinc 37 | #fafafa 38 | #f4f4f5 39 | #e4e4e7 40 | #d4d4d8 41 | #a1a1aa 42 | #71717a 43 | #52525b 44 | #3f3f46 45 | #27272a 46 | #18181b 47 | #09090b 48 | neutral 49 | #fafafa 50 | #f5f5f5 51 | #e5e5e5 52 | #d4d4d4 53 | #a3a3a3 54 | #737373 55 | #525252 56 | #404040 57 | #262626 58 | #171717 59 | #0a0a0a 60 | stone 61 | #fafaf9 62 | #f5f5f4 63 | #e7e5e4 64 | #d6d3d1 65 | #a8a29e 66 | #78716c 67 | #57534e 68 | #44403c 69 | #292524 70 | #1c1917 71 | #0c0a09 72 | red 73 | #fef2f2 74 | #fee2e2 75 | #fecaca 76 | #fca5a5 77 | #f87171 78 | #ef4444 79 | #dc2626 80 | #b91c1c 81 | #991b1b 82 | #7f1d1d 83 | #450a0a 84 | orange 85 | #fff7ed 86 | #ffedd5 87 | #fed7aa 88 | #fdba74 89 | #fb923c 90 | #f97316 91 | #ea580c 92 | #c2410c 93 | #9a3412 94 | #7c2d12 95 | #431407 96 | amber 97 | #fffbeb 98 | #fef3c7 99 | #fde68a 100 | #fcd34d 101 | #fbbf24 102 | #f59e0b 103 | #d97706 104 | #b45309 105 | #92400e 106 | #78350f 107 | #451a03 108 | yellow 109 | #fefce8 110 | #fef9c3 111 | #fef08a 112 | #fde047 113 | #facc15 114 | #eab308 115 | #ca8a04 116 | #a16207 117 | #854d0e 118 | #713f12 119 | #422006 120 | lime 121 | #f7fee7 122 | #ecfccb 123 | #d9f99d 124 | #bef264 125 | #a3e635 126 | #84cc16 127 | #65a30d 128 | #4d7c0f 129 | #3f6212 130 | #365314 131 | #1a2e05 132 | green 133 | #f0fdf4 134 | #dcfce7 135 | #bbf7d0 136 | #86efac 137 | #4ade80 138 | #22c55e 139 | #16a34a 140 | #15803d 141 | #166534 142 | #14532d 143 | #052e16 144 | Emerald 145 | #ecfdf5 146 | #d1fae5 147 | #a7f3d0 148 | #6ee7b7 149 | #34d399 150 | #10b981 151 | #059669 152 | #047857 153 | #065f46 154 | #064e3b 155 | #022c22 156 | teal 157 | #f0fdfa 158 | #ccfbf1 159 | #99f6e4 160 | #5eead4 161 | #2dd4bf 162 | #14b8a6 163 | #0d9488 164 | #0f766e 165 | #115e59 166 | #134e4a 167 | #042f2e 168 | cyan 169 | #ecfeff 170 | #cffafe 171 | #a5f3fc 172 | #67e8f9 173 | #22d3ee 174 | #06b6d4 175 | #0891b2 176 | #0e7490 177 | #155e75 178 | #164e63 179 | #083344 180 | sky 181 | #f0f9ff 182 | #e0f2fe 183 | #bae6fd 184 | #7dd3fc 185 | #38bdf8 186 | #0ea5e9 187 | #0284c7 188 | #0369a1 189 | #075985 190 | #0c4a6e 191 | #082f49 192 | blue 193 | #eff6ff 194 | #dbeafe 195 | #bfdbfe 196 | #93c5fd 197 | #60a5fa 198 | #3b82f6 199 | #2563eb 200 | #1d4ed8 201 | #1e40af 202 | #1e3a8a 203 | #172554 204 | indigo 205 | #eef2ff 206 | #e0e7ff 207 | #c7d2fe 208 | #a5b4fc 209 | #818cf8 210 | #6366f1 211 | #4f46e5 212 | #4338ca 213 | #3730a3 214 | #312e81 215 | #1e1b4b 216 | violet 217 | #f5f3ff 218 | #ede9fe 219 | #ddd6fe 220 | #c4b5fd 221 | #a78bfa 222 | #8b5cf6 223 | #7c3aed 224 | #6d28d9 225 | #5b21b6 226 | #4c1d95 227 | #2e1065 228 | purple 229 | #faf5ff 230 | #f3e8ff 231 | #e9d5ff 232 | #d8b4fe 233 | #c084fc 234 | #a855f7 235 | #9333ea 236 | #7e22ce 237 | #6b21a8 238 | #581c87 239 | #3b0764 240 | fuchsia 241 | #fdf4ff 242 | #fae8ff 243 | #f5d0fe 244 | #f0abfc 245 | #e879f9 246 | #d946ef 247 | #c026d3 248 | #a21caf 249 | #86198f 250 | #701a75 251 | #4a044e 252 | pink 253 | #fdf2f8 254 | #fce7f3 255 | #fbcfe8 256 | #f9a8d4 257 | #f472b6 258 | #ec4899 259 | #db2777 260 | #be185d 261 | #9d174d 262 | #831843 263 | #500724 264 | rose 265 | #fff1f2 266 | #ffe4e6 267 | #fecdd3 268 | #fda4af 269 | #fb7185 270 | #f43f5e 271 | #e11d48 272 | #be123c 273 | #9f1239 274 | #881337 275 | #4c0519` 276 | ) -------------------------------------------------------------------------------- /src/iife.ts: -------------------------------------------------------------------------------- 1 | import RunCSS from "./index.js" 2 | 3 | const runcss = RunCSS() 4 | const {processClasses, startWatching} = runcss 5 | 6 | for(const element of document.querySelectorAll('*[class]')) { 7 | processClasses(element.getAttribute("class")) 8 | } 9 | 10 | 11 | if(document.currentScript && document.currentScript.hasAttribute('watch')){ 12 | startWatching() 13 | } 14 | 15 | const hiddenNodes = document.querySelectorAll('*[runcss-cloak]') 16 | for(let node of hiddenNodes){ 17 | node.removeAttribute('runcss-cloak') 18 | } 19 | 20 | if(window){ 21 | // @ts-ignore 22 | window.runcss = runcss 23 | } 24 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | /*! Tailwind Preflight */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background-color:transparent;background-image:none;padding:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}fieldset{margin:0;padding:0}ol,ul{list-style:none;margin:0;padding:0}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";line-height:1.5}*,::after,::before{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e2e8f0}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#a0aec0}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:#a0aec0}input::placeholder,textarea::placeholder{color:#a0aec0}[role=button],button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{padding:0;line-height:inherit;color:inherit}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto} 2 | *, :after, :before { 3 | --tw-border-spacing-x: 0; 4 | --tw-border-spacing-y: 0; 5 | --tw-translate-x: 0; 6 | --tw-translate-y: 0; 7 | --tw-rotate: 0; 8 | --tw-skew-x: 0; 9 | --tw-skew-y: 0; 10 | --tw-scale-x: 1; 11 | --tw-scale-y: 1; 12 | --tw-pan-x: ; 13 | --tw-pan-y: ; 14 | --tw-pinch-zoom: ; 15 | --tw-scroll-snap-strictness: proximity; 16 | --tw-ordinal: ; 17 | --tw-slashed-zero: ; 18 | --tw-numeric-figure: ; 19 | --tw-numeric-spacing: ; 20 | --tw-numeric-fraction: ; 21 | --tw-ring-inset: ; 22 | --tw-ring-offset-width: 0px; 23 | --tw-ring-offset-color: #fff; 24 | --tw-ring-color: rgba(63,131,248,.5); 25 | --tw-ring-offset-shadow: 0 0 #0000; 26 | --tw-ring-shadow: 0 0 #0000; 27 | --tw-shadow: 0 0 #0000; 28 | --tw-shadow-colored: 0 0 #0000; 29 | --tw-blur: ; 30 | --tw-brightness: ; 31 | --tw-contrast: ; 32 | --tw-grayscale: ; 33 | --tw-hue-rotate: ; 34 | --tw-invert: ; 35 | --tw-saturate: ; 36 | --tw-sepia: ; 37 | --tw-drop-shadow: ; 38 | --tw-backdrop-blur: ; 39 | --tw-backdrop-brightness: ; 40 | --tw-backdrop-contrast: ; 41 | --tw-backdrop-grayscale: ; 42 | --tw-backdrop-hue-rotate: ; 43 | --tw-backdrop-invert: ; 44 | --tw-backdrop-opacity: ; 45 | --tw-backdrop-saturate: ; 46 | --tw-backdrop-sepia: ; 47 | } 48 | 49 | @keyframes spin { 50 | from { 51 | transform: rotate(0deg); 52 | } 53 | to { 54 | transform: rotate(360deg); 55 | } 56 | } 57 | 58 | 59 | *[runcss-cloak]{ 60 | visibility: hidden; 61 | } -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | RunCSS 4 | 5 | 6 | 7 | 8 | Terminology: 9 | in the following example: 10 | 11 | !sm:text-blue -> @media query (min-width: 640px){ color: blue !important; } 12 | 13 | 14 | - !sm:text-blue is the class (often spelled as clazz to avoid using the "class" js keyword) 15 | - ! is the modifier 16 | - sm is the state 17 | - text-blue is the declaration 18 | - text is the property 19 | - blue is the value 20 | 21 | - @media query (min-width: 640px){ color: blue !important; } is the rule 22 | - @media query (min-width: 640px) is the resolvedState 23 | - color: blue !important; is the resolvedDeclaration 24 | - blue is the resolvedValue 25 | 26 | */ 27 | import { parseRuleTemplate, ruleTemplate, shortcuts } from "./parser.js" 28 | import { defaultsTemplate} from './templates.preprocess.js' 29 | import { states } from "./states.js" 30 | 31 | 32 | let initialized = false 33 | const plugins : Array<(arg0:any) => any> = [] 34 | export const extendRunCSS = (plugin: (arg0: any) => any) => { 35 | if(initialized) throw "Error: can't install RunCSS plugins after initialization" 36 | 37 | plugins.push(plugin) 38 | } 39 | 40 | export default (options : Record = {}) => { 41 | if(initialized) throw "Error: can't initialize RunCSS twice" 42 | initialized = true 43 | 44 | // parse plugins and options 45 | let parsedOptions = { 46 | defaultsTemplate, 47 | ruleTemplate, 48 | shortcuts, 49 | states, 50 | 51 | ...options, 52 | } 53 | 54 | for(let plugin of plugins){ 55 | parsedOptions = { 56 | ...parsedOptions, 57 | ...plugin(parsedOptions), 58 | } 59 | } 60 | 61 | 62 | const [exact, arbitrary] = parseRuleTemplate(parsedOptions.defaultsTemplate, parsedOptions.ruleTemplate, parsedOptions.shortcuts) 63 | 64 | /** Main stylesheets where we append parsed classes */ 65 | const sheets = Array.from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).map( () => document.head.appendChild(document.createElement('style')).sheet) 66 | 67 | 68 | /** List of classes already inserted */ 69 | const inserted = new Set() 70 | 71 | 72 | 73 | /** Insert the class in the sheet, with the resolved declaration. 74 | * It resolves states such as media queries and pseudo classes. 75 | * This should be the last function called. 76 | * @param clazz 77 | * @param */ 78 | const insert = (clazz :string, resolvedDeclaration?: [string, [number, string?]]) : void => { 79 | if(!resolvedDeclaration) return 80 | inserted.add(clazz) 81 | 82 | const [resolvedValue, [priority, parent = '']] = resolvedDeclaration 83 | let increasePriority = false 84 | 85 | 86 | // divide states by categories (media queries, pseudo classes, ...) 87 | const categorizedStates : Record> = {} 88 | for(const state of Object.keys(parsedOptions.states)) categorizedStates[state] = [] 89 | let peers = '', groups = '' 90 | 91 | const states = clazz.split(':') 92 | for(let i = 0; i < states.length - 1; i++) { 93 | if(states[i].startsWith('peer-')){ 94 | let peerName = 'peer' 95 | let peerModifier = states[i].substring('peer-'.length) 96 | const slash = peerModifier.indexOf('/') 97 | if(slash !== -1) { 98 | peerName = peerModifier.substring(0, slash) 99 | peerModifier = peerModifier.substring(slash + 1) 100 | } 101 | peers+=`.${peerName}:${peerModifier}~` 102 | } 103 | if(states[i].startsWith('group-')){ 104 | let peerName = 'group' 105 | let peerModifier = states[i].substring('group-'.length) 106 | const slash = peerModifier.indexOf('/') 107 | if(slash !== -1) { 108 | peerName = peerModifier.substring(0, slash) 109 | peerModifier = peerModifier.substring(slash + 1) 110 | } 111 | groups+=`.${peerName}:${peerModifier} ` 112 | } 113 | 114 | for(let [key, dictionary] of Object.entries(parsedOptions.states)){ 115 | if(states[i] in dictionary){ 116 | categorizedStates[key].push(dictionary[states[i]]); 117 | } 118 | } 119 | } 120 | 121 | let rule = `${groups}${peers}.${clazz.replace(/[\[\]'.:()&@~*^$%,!#\/]/g, '\\$&') 122 | + categorizedStates.pseudoClasses.map(el => ':' + el).join('') 123 | + categorizedStates.pseudoElements.map(el => '::' + el).join('') 124 | + categorizedStates.modifiers.join('') + ' ' + parent 125 | } {${resolvedValue}}` 126 | 127 | if(categorizedStates.mediaQueries.length > 0) { 128 | increasePriority = true 129 | rule = `@media ${categorizedStates.mediaQueries.join(' and ')}{${rule}}` 130 | } 131 | 132 | const sheet = sheets[priority + (increasePriority ? 3:0)] 133 | sheet.insertRule(rule, sheet.cssRules.length); 134 | } 135 | 136 | 137 | 138 | 139 | const applyImportantModifier = (important : boolean, resolvedDeclaration : string) => important ? 140 | resolvedDeclaration.replaceAll(';', ' !important;') : resolvedDeclaration 141 | 142 | /** Resolve tailwind classes into css declarations 143 | * @param clazz a class, such as !sm:text-blue 144 | * @returns an array with 145 | * - the declaration(s) text-color: blue !important; 146 | * - the atTop priority of those declaration(s) */ 147 | const resolveDeclaration = (clazz : string) : [string, [number, string?]] => { 148 | if(clazz.length === 0) return 149 | 150 | // check modifiers 151 | let important = false; 152 | let minus = false; 153 | if(clazz.startsWith('!')){ 154 | clazz = clazz.substring(1) 155 | important = true; 156 | } 157 | 158 | if(clazz.startsWith('-')){ 159 | clazz = clazz.substring(1) 160 | minus = true; 161 | } 162 | 163 | // extract declaration 164 | let bracketIndex = clazz.indexOf('-[') 165 | if(bracketIndex !== -1){ 166 | const stateIndex = clazz.lastIndexOf(':', bracketIndex) 167 | const declaration = stateIndex === -1 ? clazz : clazz.substring(clazz.lastIndexOf(':') + 1) 168 | bracketIndex = declaration.indexOf('-[') 169 | const endBracketIndex = declaration.lastIndexOf(']') 170 | const property = declaration.substring(0, bracketIndex + 1) 171 | const value = declaration.substring(bracketIndex + 2, endBracketIndex).replaceAll('_', ' ') 172 | if(!(property in arbitrary)) return 173 | const [resolvedValue, args] = arbitrary[property] 174 | return [ 175 | applyImportantModifier(important, resolvedValue.replaceAll('$',value)), 176 | args 177 | ] 178 | 179 | } 180 | 181 | const stateIndex = clazz.lastIndexOf(':') 182 | const declaration = clazz.substring(stateIndex + 1) 183 | 184 | 185 | if(declaration in exact){ 186 | const [resolvedValue, args] = exact[declaration] 187 | return [applyImportantModifier(important,resolvedValue), args] 188 | } 189 | 190 | return 191 | } 192 | 193 | 194 | 195 | /** 196 | * 197 | * @param classes space-separated list of classes to process 198 | */ 199 | const processClasses = (classes : string | null) => { 200 | if(!classes) return 201 | classes.split(' ').forEach(clazz => { 202 | clazz = clazz!.trim() 203 | if(!clazz || inserted.has(clazz)) return 204 | insert(clazz, resolveDeclaration(clazz)) 205 | }) 206 | } 207 | 208 | 209 | // Add classes on node insertion 210 | let observers = [] 211 | 212 | /** Start watching for changes, and process classes as needed 213 | * @param targetNode Root node to watch - default document.body 214 | */ 215 | const startWatching = (targetNode? : Element ) => { 216 | 217 | const config = { 218 | attributes: true, 219 | //attributeFilter: ['class'], 220 | childList: true, 221 | subtree: true 222 | }; 223 | 224 | const callback = (mutationList : any) => { 225 | for (const mutation of mutationList) { 226 | if(mutation.addedNodes){ 227 | for(let node of mutation.addedNodes){ 228 | if(typeof node.hasAttribute === 'function'){ 229 | if(node.hasAttribute('class')) processClasses(node.getAttribute('class')) 230 | for(const element of document.querySelectorAll('*[class]')) { 231 | processClasses(element.getAttribute("class")) 232 | } 233 | } 234 | } 235 | } 236 | 237 | if (mutation.type === "attributes" && 238 | typeof mutation.target.hasAttribute === 'function' && 239 | mutation.target.hasAttribute('class')){ 240 | processClasses(mutation.target.getAttribute('class')) 241 | } 242 | } 243 | }; 244 | 245 | const observer = new MutationObserver(callback); 246 | 247 | observer.observe(targetNode ?? document.body, config); 248 | observers.push(observer) 249 | } 250 | 251 | 252 | /** Stop watching for changes */ 253 | const stopWatching = () => { 254 | observers.forEach(observer => observer.disconnect()); 255 | observers = [] 256 | } 257 | 258 | 259 | const exportCSS = () : string => { 260 | let result = '' 261 | for(let sheet of sheets){ 262 | for(let rule of [...sheet.cssRules]){ 263 | result += rule.cssText + '\n\n' 264 | } 265 | } 266 | return result; 267 | } 268 | 269 | 270 | 271 | return { processClasses, startWatching, stopWatching, exportCSS } 272 | 273 | } 274 | 275 | 276 | 277 | export {defaultsTemplate, ruleTemplate, shortcuts, states} 278 | -------------------------------------------------------------------------------- /src/parser.ts: -------------------------------------------------------------------------------- 1 | import { filterTemplate, ruleTemplate, shortcuts } from "./templates.preprocess"; 2 | import { colorsTemplate, opacityKeysTemplate, opacityValuesTemplate } from "./colors.preprocess"; 3 | 4 | // parse opacity variants 5 | const opacityKeys = opacityKeysTemplate.split('!') 6 | const opacityValues = opacityValuesTemplate.split('!') 7 | 8 | // parse colors 9 | const colorVariants = `50!100!200!300!400!500!600!700!800!900!950`.split('!') 10 | let colors = 'transparent!inherit' 11 | for( let [colorName, value] of Object.entries({'white': '#ffffff', 'black': '#000000'})){ 12 | colors+= '!' + colorName + '^' + value 13 | for(let k = 0; k < opacityKeys.length; k++){ 14 | const opacityKey = opacityKeys[k] 15 | const opacityValue = opacityValues[k] 16 | colors+= '!' + colorName + '/' + opacityKey 17 | + '^' + value + opacityValue 18 | } 19 | 20 | } 21 | const colorsLines = colorsTemplate.split('\n') 22 | for(let i = 0; i < colorsLines.length; i++) { 23 | const colorName = colorsLines[i] 24 | for(let variant of colorVariants) { 25 | i+= 1 26 | colors+= '!' + colorName + '-' + variant + '^' + colorsLines[i] 27 | for(let k = 0; k < opacityKeys.length; k++){ 28 | const opacityKey = opacityKeys[k] 29 | const opacityValue = opacityValues[k] 30 | colors+= '!' + colorName + '-' + variant + '/' + opacityKey 31 | + '^' + colorsLines[i] + opacityValue 32 | } 33 | } 34 | } 35 | shortcuts['@C'] = colors 36 | 37 | 38 | // parse @4 numbers 39 | const numbers = '0!0.5!1!1.5!2!2.5!3!3.5!4!5!6!7!8!9!10!11!12!14!16!20!24!28!32!36!40!44!48!52!56!60!64!72!80!96'.split('!') 40 | .map(n => `${n}^${parseFloat(n)*4}px`).join('!') 41 | const percentages ='1/2!1/3!2/3!1/4!2/4!3/4!1/5!2/5!3/5!4/5!1/6!2/6!3/6!4/6!5/6!1/12!2/12!3/12!4/12!5/12!6/12!7/12!8/12!9/12!10/12!11/12'.split('!') 42 | .map(fraction => { 43 | const [n, d] = fraction.split('/') 44 | return `${fraction}^${Number(n)/Number(d)*100}%` 45 | 46 | }).join('!') 47 | 48 | shortcuts['@4'] = 'auto!full^100%!px^1px!' + numbers + '!' + percentages 49 | 50 | // setup filters 51 | const backdropFilterTemplate = filterTemplate.split('\n') 52 | .map(l => 'backdrop-' + l).join('\n') 53 | .replaceAll('--tw-', '--tw-backdrop-') 54 | .replaceAll('@f', '@g') 55 | 56 | 57 | 58 | const completeRuleTemplate = ruleTemplate + '\n' + filterTemplate + '\n' + backdropFilterTemplate 59 | export {completeRuleTemplate as ruleTemplate, shortcuts} 60 | 61 | 62 | 63 | export const parseRuleTemplate = (defaultsTemplate: string, ruleTemplate : string, shortcuts : Record) => { 64 | let resolvedRuleTemplate = ruleTemplate 65 | for(let [key, value] of Object.entries(shortcuts)){ 66 | resolvedRuleTemplate = resolvedRuleTemplate.replaceAll(key, value); 67 | } 68 | 69 | const exact : Record = {} 70 | const arbitrary : Record = {} 71 | 72 | for(let line of defaultsTemplate.split('\n')){ 73 | let [key, value] = line.split('!') 74 | 75 | let priority = 0 76 | let parent = '' 77 | if(key.startsWith('+++')){ 78 | priority = 3 79 | key = key.substring(3) 80 | }else if(key.startsWith('++')){ 81 | priority = 2 82 | key = key.substring(2) 83 | }else if(key.startsWith('+')){ 84 | priority = 2 85 | key = key.substring(1) 86 | } 87 | if(key.startsWith('>')){ 88 | parent = '> * + *' 89 | key = key.substring(1) 90 | } 91 | 92 | exact[key] = [value + ';', [priority, parent]] 93 | } 94 | 95 | for(let line of resolvedRuleTemplate.split('\n')){ 96 | const els = line.split('!') 97 | let key = els[0] 98 | let priority = 0 99 | let parent = '' 100 | if(key.startsWith('+++')){ 101 | priority = 3 102 | key = key.substring(3) 103 | }else if(key.startsWith('++')){ 104 | priority = 2 105 | key = key.substring(2) 106 | }else if(key.startsWith('+')){ 107 | priority = 2 108 | key = key.substring(1) 109 | } 110 | if(key.startsWith('>')){ 111 | parent = '> * + *' 112 | key = key.substring(1) 113 | } 114 | 115 | const property = key === '' ? '' : key + '-' 116 | let resolvedValue = els[1] === '' ? key : els[1] 117 | if(!resolvedValue.includes('$')) resolvedValue += ':$' 118 | resolvedValue+=';' 119 | const admitArbitrary = els[2] === '$' 120 | if(admitArbitrary){ 121 | arbitrary[property] = [resolvedValue, [priority, parent]] 122 | } 123 | for(let i = admitArbitrary ? 3 : 2; i < els.length; i++){ 124 | const text = els[i] 125 | const caretIndex = text.indexOf('^') 126 | if(caretIndex === -1){ 127 | exact[property + text] = [resolvedValue.replaceAll('$', text), [priority, parent]] 128 | }else if(caretIndex === 0){ 129 | exact[property.substring(0, property.length - 1)] = [resolvedValue.replaceAll('$', text.substring(1)), [priority, parent]] 130 | }else{ 131 | const key = text.substring(0, caretIndex) 132 | const value = text.substring(caretIndex + 1) 133 | exact[property + key] = [resolvedValue.replaceAll('$', value), [priority, parent]] 134 | } 135 | } 136 | } 137 | 138 | return [exact, arbitrary] 139 | 140 | } -------------------------------------------------------------------------------- /src/states.ts: -------------------------------------------------------------------------------- 1 | import { dictionarify } from "./utils" 2 | 3 | export const pseudoClasses = dictionarify(` 4 | hover 5 | focus 6 | focus-within 7 | focus-visible 8 | active 9 | visited 10 | target 11 | first!first-child 12 | last!last-child 13 | only!only-child 14 | odd!nth-child(odd) 15 | even!nth-child(even) 16 | first-of-type 17 | last-of-type 18 | only-of-type 19 | empty 20 | disabled 21 | enabled 22 | checked 23 | indeterminate 24 | default 25 | required 26 | valid 27 | invalid 28 | in-range 29 | out-of-range 30 | placeholder-shown 31 | autofill 32 | read-only 33 | `) 34 | 35 | export const pseudoElements = dictionarify(` 36 | before 37 | after 38 | placeholder 39 | file!file-selector-button 40 | marker 41 | selection 42 | first-line 43 | first-letter 44 | backdrop 45 | `) 46 | 47 | export const mediaQueries = dictionarify(` 48 | sm!(min-width: 640px) 49 | md!(min-width: 768px) 50 | lg!(min-width: 1024px) 51 | xl!(min-width: 1280px) 52 | 2xl!(min-width: 1536px) 53 | max-sm!not all and (min-width: 640px) 54 | max-md!not all and (min-width: 768px) 55 | max-lg!not all and (min-width: 1024px) 56 | max-xl!not all and (min-width: 1280px) 57 | max-2xl!not all and (min-width: 1536px) 58 | dark!(prefers-color-scheme: dark) 59 | portrait!(orientation: portrait) 60 | landscape!(orientation: landscape) 61 | motion-safe!(prefers-reduced-motion: no-preference) 62 | motion-reduce!(prefers-reduced-motion: reduce) 63 | contrast-more!(prefers-contrast: more) 64 | contrast-less!(prefers-contrast: less) 65 | print!print 66 | `) 67 | 68 | export const modifiers = dictionarify(` 69 | aria-checked![aria-checked="true"] 70 | aria-disabled![aria-disabled="true"] 71 | aria-expanded![aria-expanded="true"] 72 | aria-hidden![aria-hidden="true"] 73 | aria-pressed![aria-pressed="true"] 74 | aria-readonly![aria-readonly="true"] 75 | aria-required![aria-required="true"] 76 | aria-selected![aria-selected="true"] 77 | open![open] 78 | `) 79 | 80 | export const parentModifiers = dictionarify(` 81 | rtl![dir="rtl"] 82 | ltr![dir="ltr"] 83 | `) 84 | 85 | 86 | export const states = { 87 | pseudoClasses, 88 | pseudoElements, 89 | mediaQueries, 90 | modifiers, 91 | parentModifiers, 92 | } 93 | 94 | -------------------------------------------------------------------------------- /src/templates.preprocess.ts: -------------------------------------------------------------------------------- 1 | import { clean } from './utils' 2 | 3 | /* 4 | 5 | This file define all tailwind rules using a short, compat syntax. 6 | Special chars such as !, +, $ and so on act as marks or separator and 7 | provide a handful way to define common behaviours. 8 | 9 | At the end, this file will be preprocessed and turned into a giant 10 | multine string, which will be parsed at runtime. This is how we are able 11 | to compress all of tailwind in such a little space. 12 | 13 | 14 | You may add a rule in two ways. 15 | Appending it directly to "defaultsTemplate". Use ! to separate the class name 16 | from the class content, and put each rule in a new line. For example: 17 | 18 | defaultsTemplate+= ` 19 | break-normal!overflow-wrap: normal;word-break: normal 20 | break-words!overflow-wrap: break-word 21 | break-all!word-break: break-all 22 | break-keep!word-break: keep-all 23 | ` 24 | 25 | Using the "addRule" shorthand to define multiple classes at once. 26 | In its basic form, "addRule" takes the base tailwind class name, 27 | the css property and some key-value pairs separated by ^. 28 | For example, let's say we want to create two classes, 29 | container-sm max-width: 640px; 30 | container-md max-width: 768px; 31 | We may do it with the following rule: 32 | 33 | addRule('container', 'max-width: $px', 34 | 'sm^640', 35 | 'md^768', 36 | ) 37 | 38 | We may use the $ in the second arg to specify where to insert 39 | the value. If no $ is set, we will assume the value is at the end. 40 | If the first arg would be the same as the second arg, we could 41 | pass an empty string. In the same way, we could omit the ^. 42 | For examples, let's say we want to create these two classes: 43 | break-before-auto break-before: auto; 44 | break-before-all break-before: all; 45 | We could leverage that they have the same name, and avoid repeat both 46 | 'break-before' and 'auto'/'all'. 47 | 48 | addRule('break-before', '', 49 | 'auto', 50 | 'all', 51 | ) 52 | 53 | 54 | In tailwind, some properties allow for custom values, such as 55 | bg-[customcolor] background-color: customcolor; 56 | To allow this, pass $ as third argument. For example: 57 | 58 | addRule('flex', '', 59 | '$', 60 | '1^1 1 0%', 61 | 'auto^1 1 auto', 62 | 'initial^0 1 auto', 63 | 'none' 64 | ) 65 | 66 | Other rules include common parameters, such as colors, thicknesses and so on. 67 | To avoid reapeating those pattern, we defined some shortcuts, such as @C for colors. 68 | Check them below. 69 | 70 | 71 | Finally, you may prepend a rule with 72 | 73 | >rule this rule will be applied to the descendants to the element, instead of the element itself 74 | +rule this rule will have priority over non-priority rules (=would override them) 75 | ++rule, +++rule even more priority 76 | 77 | 78 | */ 79 | 80 | 81 | 82 | let defaultsTemplate = '', ruleTemplate = '', filterTemplate = '' 83 | 84 | export const shortcuts : Record = { 85 | // colors @C are handled runtime 86 | // same for @4 87 | //border radius 88 | '@S': '', 89 | '@R': '$!none^0px!sm^2px!^4px!md^6px!lg^8px!xl^12px!2xl^16px!3xl^24px!full^9999px', 90 | '@B': '0^0px!^1px!2^2px!4^4px!8^8px', 91 | '@b': ';border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)', 92 | '@t': ';transform: translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))', 93 | '@f': ';filter: blur(var(--tw-blur)) brightness(var(--tw-brightness)) contrast(var(--tw-contrast)) grayscale(var(--tw-grayscale)) hue-rotate(var(--tw-hue-rotate)) invert(var(--tw-invert)) saturate(var(--tw-saturate)) sepia(var(--tw-sepia)) drop-shadow(var(--tw-drop-shadow))', 94 | '@g': ';backdrop-filter: blur(var(--tw-backdrop-blur)) brightness(var(--tw-backdrop-brightness)) contrast(var(--tw-backdrop-contrast)) grayscale(var(--tw-backdrop-grayscale)) hue-rotate(var(--tw-backdrop-hue-rotate)) invert(var(--tw-backdrop-invert)) opacity(var(--tw-backdrop-opacity)) saturate(var(--tw-backdrop-saturate)) sepia(var(--tw-backdrop-sepia))' 95 | } 96 | 97 | 98 | const addRule = (...args : string[]) => ruleTemplate+= args.join('!') + '\n' 99 | 100 | const addFilter = (...args : string[]) => filterTemplate+= args.join('!') + '\n' 101 | 102 | // https://tailwindcss.com/docs/aspect-ratio 103 | addRule('aspect', 'aspect-ratio: $', 104 | '$', 105 | 'auto', 106 | 'square^1/1', 107 | 'video^16/9', 108 | ) 109 | 110 | 111 | // https://tailwindcss.com/docs/container 112 | defaultsTemplate+= `container!width: 100%` + '\n' 113 | 114 | addRule('container', 'max-width: $px', 115 | 'sm^640', 116 | 'md^768', 117 | 'lg^1024', 118 | 'xl^1280', 119 | '2xl^1536', 120 | ) 121 | 122 | 123 | // https://tailwindcss.com/docs/columns 124 | 125 | addRule('colums', 'columns', 126 | '$', 127 | '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', 128 | 'auto', 129 | '3xs^16rem', 130 | '2xs^18rem', 131 | 'xs ^20rem', 132 | 'sm ^24rem', 133 | 'md ^28rem', 134 | 'lg ^32rem', 135 | 'xl ^36rem', 136 | '2xl^42rem', 137 | '3xl^48rem', 138 | '4xl^56rem', 139 | '5xl^64rem', 140 | '6xl^72rem', 141 | '7xl^80rem', 142 | ) 143 | 144 | 145 | // https://tailwindcss.com/docs/break-after 146 | addRule('break-after', '', 147 | 'auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column' 148 | ) 149 | 150 | 151 | // https://tailwindcss.com/docs/break-before 152 | addRule('break-before', '', 153 | 'auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column' 154 | ) 155 | 156 | 157 | // https://tailwindcss.com/docs/break-inside 158 | addRule('break-inside', '', 159 | 'auto', 'avoid', 'all', 'avoid-page', 'avoid-column' 160 | ) 161 | 162 | // https://tailwindcss.com/docs/box-decoration-break 163 | addRule('box-decoration', 'box-decoration-break', 164 | 'clone', 'slice' 165 | ) 166 | 167 | 168 | // https://tailwindcss.com/docs/box-sizing 169 | addRule('box', 'box-sizing: $-box', 170 | 'border', 'content' 171 | ) 172 | 173 | // https://tailwindcss.com/docs/display 174 | addRule('', 'display', 175 | 'block', 176 | 'inline-block', 177 | 'inline', 178 | 'flex', 179 | 'inline-flex', 180 | 'table', 181 | 'inline-table', 182 | 'table-caption', 183 | 'table-cell', 184 | 'table-column', 185 | 'table-column-group', 186 | 'table-footer-group', 187 | 'table-header-group', 188 | 'table-row-group', 189 | 'table-row', 190 | 'flow-root', 191 | 'grid', 192 | 'inline-grid', 193 | 'contents', 194 | 'list-item', 195 | 'hidden^none', 196 | ) 197 | 198 | 199 | // https://tailwindcss.com/docs/float 200 | addRule('float', '', 201 | 'right', 'left', 'none' 202 | ) 203 | 204 | 205 | // https://tailwindcss.com/docs/clear 206 | addRule('clear', '', 207 | 'right', 'left', 'both', 'none' 208 | ) 209 | 210 | // https://tailwindcss.com/docs/isolation 211 | addRule('', 'isolation', 212 | 'isolate', 213 | 'isolation-auto^auto' 214 | ) 215 | 216 | // https://tailwindcss.com/docs/object-fit 217 | addRule('object', 'object-fit', 218 | 'contain', 219 | 'cover', 220 | 'fill', 221 | 'none', 222 | 'scale-down', 223 | ) 224 | 225 | 226 | // https://tailwindcss.com/docs/object-position 227 | addRule('object', 'object-position', 228 | '$', 229 | 'bottom', 230 | 'center', 231 | 'left', 232 | 'left-bottom^left bottom', 233 | 'left-top^left top', 234 | 'right', 235 | 'right-bottom^right bottom', 236 | 'right-top^right top', 237 | 'top' 238 | ) 239 | 240 | // https://tailwindcss.com/docs/overflow 241 | addRule('overflow','', 242 | 'auto', 243 | 'hidden', 244 | 'clip', 245 | 'visible', 246 | 'scroll', 247 | ) 248 | 249 | addRule('overflow-x','', 250 | 'auto', 251 | 'hidden', 252 | 'clip', 253 | 'visible', 254 | 'scroll', 255 | ) 256 | 257 | addRule('overflow-y','', 258 | 'auto', 259 | 'hidden', 260 | 'clip', 261 | 'visible', 262 | 'scroll', 263 | ) 264 | 265 | 266 | // https://tailwindcss.com/docs/overscroll-behavior 267 | addRule('overscroll','overscroll-behavior', 268 | 'auto', 269 | 'contain', 270 | 'none', 271 | ) 272 | 273 | addRule('overscroll-y','overscroll-behavior-y', 274 | 'auto', 275 | 'contain', 276 | 'none', 277 | ) 278 | 279 | addRule('overscroll-x','overscroll-behavior-x', 280 | 'auto', 281 | 'contain', 282 | 'none', 283 | ) 284 | 285 | 286 | // https://tailwindcss.com/docs/position 287 | addRule('', 'position', 288 | 'static', 289 | 'fixed', 290 | 'absolute', 291 | 'relative', 292 | 'sticky', 293 | ) 294 | 295 | // https://tailwindcss.com/docs/top-right-bottom-left 296 | addRule('inset', '', '@4') 297 | addRule('inset-x', 'left:$;right:$', '@4') 298 | addRule('inset-y', 'top:$;bottom:$', '@4') 299 | 300 | addRule('start', 'inset-inline-start', '@4') 301 | addRule('end', 'inset-inline-end', '@4') 302 | 303 | addRule('top', '', '@4') 304 | addRule('right', '', '@4') 305 | addRule('bottom', '', '@4') 306 | addRule('left', '', '@4') 307 | 308 | 309 | // https://tailwindcss.com/docs/visibility 310 | addRule('', 'visibility', 311 | 'visible', 312 | 'invisible^hidden', 313 | 'collapse', 314 | ) 315 | 316 | // https://tailwindcss.com/docs/z-index 317 | addRule('z', 'z-index', 318 | '0', 319 | '10', 320 | '20', 321 | '30', 322 | '40', 323 | '50', 324 | 'auto', 325 | ) 326 | 327 | // https://tailwindcss.com/docs/flex-basis 328 | addRule('basis', 'flex-basis', '@4') 329 | 330 | // https://tailwindcss.com/docs/flex-direction 331 | addRule('flex', 'flex-direction', 332 | 'row', 333 | 'row-reverse', 334 | 'col^column', 335 | 'col-reverse^column-reverse', 336 | ) 337 | 338 | 339 | // https://tailwindcss.com/docs/flex-wrap 340 | addRule('flex-wrap', '', 341 | 'wrap', 342 | 'wrap-reverse', 343 | 'nowrap', 344 | ) 345 | 346 | 347 | // https://tailwindcss.com/docs/flex 348 | addRule('flex', '', 349 | '$', 350 | '1^1 1 0%', 351 | 'auto^1 1 auto', 352 | 'initial^0 1 auto', 353 | 'none' 354 | ) 355 | 356 | 357 | // https://tailwindcss.com/docs/flex-grow 358 | addRule('grow', 'flex-grow', 359 | '$', 360 | '^1', 361 | '0', 362 | ) 363 | 364 | 365 | // https://tailwindcss.com/docs/flex-shrink 366 | addRule('shrink', 'flex-shrink', 367 | '$', 368 | '^1', 369 | '0', 370 | ) 371 | 372 | // https://tailwindcss.com/docs/order 373 | addRule('order','', 374 | '$', 375 | '1', 376 | '2', 377 | '3', 378 | '4', 379 | '5', 380 | '6', 381 | '7', 382 | '8', 383 | '9', 384 | '10', 385 | '11', 386 | '12', 387 | 'first^-9999', 388 | 'last^9999', 389 | 'none^0', 390 | 391 | ) 392 | 393 | // https://tailwindcss.com/docs/grid-template-columns 394 | addRule('grid-cols','grid-template-columns: repeat($, minmax(0, 1fr))', 395 | '1', 396 | '2', 397 | '3', 398 | '4', 399 | '5', 400 | '6', 401 | '7', 402 | '8', 403 | '9', 404 | '10', 405 | '11', 406 | '12', 407 | ) 408 | 409 | addRule('grid-cols', 'grid-template-columns', 410 | '$', 411 | 'none' 412 | ) 413 | 414 | 415 | // https://tailwindcss.com/docs/grid-column 416 | // https://tailwindcss.com/docs/grid-row 417 | for(let [col, column] of Array.from([ 418 | ['col', 'column'], 419 | ['row', 'row'], 420 | ])){ 421 | defaultsTemplate+=`${col}-auto!grid-${column}: auto\n` 422 | 423 | addRule(`${col}-span`, `grid-${column}: span $ / span $`, 424 | '1', 425 | '2', 426 | '3', 427 | '4', 428 | '5', 429 | '6', 430 | '7', 431 | '8', 432 | '9', 433 | '10', 434 | '11', 435 | '12', 436 | ) 437 | 438 | addRule(`${col}-span`, `grid-${column}`, 439 | '$', 440 | `full^grid-${column}: 1 / -1` 441 | ) 442 | 443 | addRule(`${col}-start`, `grid-${column}-start`, 444 | '$', 445 | '1', 446 | '2', 447 | '3', 448 | '4', 449 | '5', 450 | '6', 451 | '7', 452 | '8', 453 | '9', 454 | '10', 455 | '11', 456 | '12', 457 | '13', 458 | 'auto' 459 | ) 460 | 461 | addRule(`${col}-end`, `grid-${column}-end`, 462 | '$', 463 | '1', 464 | '2', 465 | '3', 466 | '4', 467 | '5', 468 | '6', 469 | '7', 470 | '8', 471 | '9', 472 | '10', 473 | '11', 474 | '12', 475 | '13', 476 | 'auto' 477 | ) 478 | 479 | } 480 | 481 | 482 | // https://tailwindcss.com/docs/grid-template-rows 483 | addRule('grid-rows', 'grid-template-rows: repeat($, minmax(0, 1fr))', 484 | '1', 485 | '2', 486 | '3', 487 | '4', 488 | '5', 489 | '6', 490 | ) 491 | 492 | addRule('grid-rows', 'grid-template-rows', 493 | '$', 494 | 'none' 495 | ) 496 | 497 | 498 | // https://tailwindcss.com/docs/grid-auto-flow 499 | addRule('grid-flow', 'grid-auto-flow', 500 | 'row', 501 | 'col^column', 502 | 'dense', 503 | 'row-dense^row dense', 504 | 'col-dense^column dense', 505 | ) 506 | 507 | 508 | // https://tailwindcss.com/docs/grid-auto-columns 509 | addRule('auto-cols', 'grid-auto-columns', 510 | 'auto', 511 | 'min^min-content', 512 | 'max^max-content', 513 | 'fr^minmax(0,1fr)', 514 | ) 515 | 516 | 517 | // https://tailwindcss.com/docs/grid-auto-rows 518 | addRule('auto-rows', 'grid-auto-rows', 519 | 'auto', 520 | 'min^min-content', 521 | 'max^max-content', 522 | 'fr^minmax(0,1fr)', 523 | ) 524 | 525 | // https://tailwindcss.com/docs/gap 526 | addRule('gap','', 527 | '$', 528 | '@4' 529 | ) 530 | 531 | addRule('gap-x','column-gap', 532 | '$', 533 | '@4' 534 | ) 535 | 536 | addRule('gap-y','row-gap', 537 | '$', 538 | '@4' 539 | ) 540 | 541 | 542 | // https://tailwindcss.com/docs/justify-content 543 | addRule('justify', 'justify-content', 544 | 'normal', 545 | 'start^flex-start', 546 | 'end^flex-end', 547 | 'center', 548 | 'between^space-between', 549 | 'around^space-around', 550 | 'evenly^space-evenly', 551 | 'stretch', 552 | ) 553 | 554 | 555 | // https://tailwindcss.com/docs/justify-items 556 | addRule('justify-items', '', 557 | 'start', 558 | 'end', 559 | 'center', 560 | 'stretch' 561 | ) 562 | 563 | 564 | // https://tailwindcss.com/docs/justify-self 565 | addRule('justify-items', '', 566 | 'auto', 567 | 'start', 568 | 'end', 569 | 'center', 570 | 'stretch' 571 | ) 572 | 573 | 574 | // https://tailwindcss.com/docs/align-content 575 | addRule('content', 'align-content', 576 | 'normal', 577 | 'center', 578 | 'start^flex-start', 579 | 'end^flex-end', 580 | 'between^space-between', 581 | 'around^space-around', 582 | 'evenly^space-evenly', 583 | 'baseline', 584 | 'stretch', 585 | ) 586 | 587 | 588 | // https://tailwindcss.com/docs/align-items 589 | addRule('items', 'align-items', 590 | 'start^flex-start', 591 | 'end^flex-end', 592 | 'center', 593 | 'baseline', 594 | 'stretch', 595 | ) 596 | 597 | 598 | // https://tailwindcss.com/docs/align-self 599 | addRule('self', 'align-self', 600 | 'auto', 601 | 'start^flex-start', 602 | 'end^flex-end', 603 | 'center', 604 | 'baseline', 605 | 'stretch', 606 | ) 607 | 608 | 609 | // https://tailwindcss.com/docs/place-content 610 | addRule('place-content', '', 611 | 'center', 612 | 'start^flex-start', 613 | 'end^flex-end', 614 | 'between^space-between', 615 | 'around^space-around', 616 | 'evenly^space-evenly', 617 | 'baseline', 618 | 'stretch', 619 | ) 620 | 621 | 622 | // https://tailwindcss.com/docs/place-items 623 | addRule('place-items', '', 624 | 'start', 625 | 'end', 626 | 'center', 627 | 'baseline', 628 | 'stretch', 629 | ) 630 | 631 | 632 | // https://tailwindcss.com/docs/place-self 633 | addRule('place-self', '', 634 | 'auto', 635 | 'start', 636 | 'end', 637 | 'center', 638 | 'stretch', 639 | ) 640 | 641 | 642 | 643 | // SPACING 644 | 645 | 646 | // https://tailwindcss.com/docs/padding 647 | addRule('p', 'padding', 648 | '$', 649 | '@4', 650 | ) 651 | 652 | addRule('px', 'padding-left:$;padding-right:$', 653 | '$', 654 | '@4', 655 | ) 656 | 657 | addRule('py', 'padding-top:$;padding-bottom:$', 658 | '$', 659 | '@4', 660 | ) 661 | 662 | addRule('ps', 'padding-inline-start', 663 | '$', 664 | '@4', 665 | ) 666 | 667 | addRule('pe', 'padding-inline-end', 668 | '$', 669 | '@4', 670 | ) 671 | 672 | addRule('pt', 'padding-top', 673 | '$', 674 | '@4', 675 | ) 676 | 677 | addRule('pr', 'padding-right', 678 | '$', 679 | '@4', 680 | ) 681 | 682 | addRule('pb', 'padding-bottom', 683 | '$', 684 | '@4', 685 | ) 686 | 687 | addRule('pl', 'padding-left', 688 | '$', 689 | '@4', 690 | ) 691 | 692 | 693 | 694 | // https://tailwindcss.com/docs/margin 695 | addRule('m', 'margin', 696 | '$', 697 | '@4', 698 | ) 699 | 700 | addRule('mx', 'margin-left:$;margin-right:$', 701 | '$', 702 | '@4', 703 | ) 704 | 705 | addRule('my', 'margin-top:$;margin-bottom:$', 706 | '$', 707 | '@4', 708 | ) 709 | 710 | addRule('ms', 'margin-inline-start', 711 | '$', 712 | '@4', 713 | ) 714 | 715 | addRule('me', 'margin-inline-end', 716 | '$', 717 | '@4', 718 | ) 719 | 720 | addRule('mt', 'margin-top', 721 | '$', 722 | '@4', 723 | ) 724 | 725 | addRule('mr', 'margin-right', 726 | '$', 727 | '@4', 728 | ) 729 | 730 | addRule('mb', 'margin-bottom', 731 | '$', 732 | '@4', 733 | ) 734 | 735 | addRule('ml', 'margin-left', 736 | '$', 737 | '@4', 738 | ) 739 | 740 | 741 | // https://tailwindcss.com/docs/space 742 | addRule('>space-x', 'margin-left', 743 | '$', 744 | '@4' 745 | ) 746 | 747 | addRule('>space-x-reverse', ' --tw-space-x-reverse', 748 | '^1' 749 | ) 750 | 751 | addRule('>space-y', 'margin-top', 752 | '$', 753 | '@4' 754 | ) 755 | 756 | addRule('>space-y-reverse', ' --tw-space-y-reverse', 757 | '^1' 758 | ) 759 | 760 | 761 | 762 | // SIZING 763 | 764 | // https://tailwindcss.com/docs/width 765 | addRule('w', 'width', 766 | '$', 767 | '@4', 768 | 'screen^100vw' 769 | ) 770 | 771 | addRule('w', 'width: $-content', 772 | 'min', 773 | 'max', 774 | 'fit', 775 | ) 776 | 777 | // https://tailwindcss.com/docs/min-width 778 | addRule('min-w', 'min-width', 779 | '$', 780 | '0^0px', 781 | 'full^100%', 782 | 'min^min-content', 783 | 'max^max-content', 784 | 'fit^fit-content', 785 | ) 786 | 787 | 788 | // https://tailwindcss.com/docs/max-width 789 | addRule('max-w', 'max-width', 790 | '$', 791 | '0^0rem', 792 | 'none^none', 793 | 'xs^20rem', 794 | 'sm^24rem', 795 | 'md^28rem', 796 | 'lg^32rem', 797 | 'xl^36rem', 798 | '2xl^42rem', 799 | '3xl^48rem', 800 | '4xl^56rem', 801 | '5xl^64rem', 802 | '6xl^72rem', 803 | '7xl^80rem', 804 | 'full^100%', 805 | 'min^min-content', 806 | 'max^max-content', 807 | 'fit^fit-content', 808 | 'prose^65ch', 809 | 'screen-sm^640px', 810 | 'screen-md^768px', 811 | 'screen-lg^1024px', 812 | 'screen-xl^1280px', 813 | 'screen-2xl^1536px', 814 | ) 815 | 816 | 817 | // https://tailwindcss.com/docs/height 818 | addRule('h', 'height', 819 | '$', 820 | '@4', 821 | ) 822 | 823 | // https://tailwindcss.com/docs/min-height 824 | addRule('min-h', 'min-height', 825 | '$', 826 | '0^0px', 827 | 'full^100%', 828 | 'screen^100vh', 829 | 'min^min-content', 830 | 'max^max-content', 831 | 'fit^fit-content', 832 | ) 833 | 834 | //https://tailwindcss.com/docs/max-height 835 | addRule('max-h', 'max-height', 836 | '$', 837 | '@4', 838 | 'screen^100vh', 839 | 'min^min-content', 840 | 'max^max-content', 841 | 'fit^fit-content', 842 | ) 843 | 844 | 845 | 846 | // TYPOGRAPHY 847 | 848 | // https://tailwindcss.com/docs/font-family 849 | addRule('font', 'font-family', 850 | 'sans^ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"', 851 | 'serif^ui-serif, Georgia, Cambria, "Times New Roman", Times, serif', 852 | 'mono^ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace', 853 | ) 854 | 855 | // https://tailwindcss.com/docs/font-size 856 | addRule('text', 'font-size', 857 | '$', 858 | 'xs^0.75rem; line-height: 1rem', 859 | 'sm^0.875rem; line-height: 1.25rem', 860 | 'base^1rem; line-height: 1.5rem', 861 | 'lg^1.125rem; line-height: 1.75rem', 862 | 'xl^1.25rem; line-height: 1.75rem', 863 | '2xl^1.5rem; line-height: 2rem', 864 | '3xl^1.875rem; line-height: 2.25rem', 865 | '4xl^2.25rem; line-height: 2.5rem', 866 | '5xl^3rem; line-height: 1', 867 | '6xl^3.75rem; line-height: 1', 868 | '7xl^4.5rem; line-height: 1', 869 | '8xl^6rem; line-height: 1', 870 | '9xl^8rem; line-height: 1', 871 | ) 872 | 873 | 874 | // https://tailwindcss.com/docs/font-smoothing 875 | defaultsTemplate+=` 876 | antialiased!-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale 877 | subpixel-antialiased!-webkit-font-smoothing: auto;-moz-osx-font-smoothing: auto 878 | ` 879 | 880 | // https://tailwindcss.com/docs/font-style 881 | addRule('', 'font-style', 882 | 'italic', 883 | 'non-italic^normal' 884 | ) 885 | 886 | // https://tailwindcss.com/docs/font-weight 887 | 888 | addRule('font', 'font-weight', 889 | '$', 890 | 'thin^100', 891 | 'extralight^200', 892 | 'light^300', 893 | 'normal^400', 894 | 'medium^500', 895 | 'semibold^600', 896 | 'bold^700', 897 | 'extrabold^800', 898 | 'black^900', 899 | ) 900 | 901 | // https://tailwindcss.com/docs/font-variant-numeric 902 | addRule('', 'font-variant-numeric', 903 | 'normal-nums^normal', 904 | 'ordinal', 905 | 'slashed-zero', 906 | 'lining-nums', 907 | 'oldstyle-nums', 908 | 'proportional-nums', 909 | 'tabular-nums', 910 | 'diagonal-fractions', 911 | 'stacked-fractions', 912 | ) 913 | 914 | // https://tailwindcss.com/docs/letter-spacing 915 | addRule('tracking', 'letter-spacing', 916 | '$', 917 | 'tighter^-0.05em', 918 | 'tight^-0.025em', 919 | 'normal^0em', 920 | 'wide^0.025em', 921 | 'wider^0.05em', 922 | 'widest^0.1em', 923 | ) 924 | 925 | 926 | 927 | // https://tailwindcss.com/docs/line-clamp 928 | addRule('line-clamp', 'overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp', 929 | '$', 930 | '1', '2','3','4','5','6', 'none' 931 | ) 932 | 933 | 934 | // https://tailwindcss.com/docs/line-height 935 | addRule('leading', 'line-height', 936 | '$', 937 | '3^.75rem', 938 | '4^1rem', 939 | '5^1.25rem', 940 | '6^1.5rem', 941 | '7^1.75rem', 942 | '8^2rem', 943 | '9^2.25rem', 944 | '10^2.5rem', 945 | 'none^1', 946 | 'tight^1.25', 947 | 'snug^1.375', 948 | 'normal^1.5', 949 | 'relaxed^1.625', 950 | 'loose^2', 951 | ) 952 | 953 | // https://tailwindcss.com/docs/list-style-image 954 | addRule('list-image', 'list-style-image', 955 | '$', 956 | 'none' 957 | ) 958 | 959 | // https://tailwindcss.com/docs/list-style-position 960 | addRule('list', 'list-style-position', 961 | 'inside', 962 | 'outside', 963 | ) 964 | 965 | // https://tailwindcss.com/docs/list-style-type 966 | addRule('list', 'list-style-type', 967 | '$', 968 | 'none', 969 | 'disc', 970 | 'decimal' 971 | ) 972 | 973 | // https://tailwindcss.com/docs/text-align 974 | addRule('text', 'text-align', 975 | 'left', 976 | 'center', 977 | 'right', 978 | 'justify', 979 | 'start', 980 | 'end' 981 | ) 982 | 983 | // https://tailwindcss.com/docs/text-color 984 | addRule('text', 'color', 985 | '$', 986 | '@C' 987 | ) 988 | 989 | // https://tailwindcss.com/docs/text-decoration 990 | addRule('', 'text-decoration-line', 991 | 'underline', 992 | 'overline', 993 | 'line-through', 994 | 'no-underline^none' 995 | ) 996 | 997 | // https://tailwindcss.com/docs/text-decoration-color 998 | addRule('decoration', 'text-decoration-color', 999 | '$', 1000 | 'current^currentColor', 1001 | '@C' 1002 | ) 1003 | 1004 | // https://tailwindcss.com/docs/text-decoration-style 1005 | addRule('decoration', 'text-decoration-style', 1006 | 'solid', 1007 | 'double', 1008 | 'dotted', 1009 | 'dashed', 1010 | 'wavy' 1011 | ) 1012 | 1013 | // https://tailwindcss.com/docs/text-decoration-thickness 1014 | addRule('decoration', 'text-decoration-thickness', 1015 | '$', 1016 | 'auto', 1017 | 'from-font', 1018 | '0^0px', 1019 | '1^1px', 1020 | '2^2px', 1021 | '4^4px', 1022 | '8^8px' 1023 | ) 1024 | 1025 | // https://tailwindcss.com/docs/text-underline-offset 1026 | addRule('underline-offset', 'text-underline-offset', 1027 | '$', 1028 | 'auto', 1029 | '0^0px', 1030 | '1^1px', 1031 | '2^2px', 1032 | '4^4px', 1033 | '8^8px' 1034 | ) 1035 | 1036 | // https://tailwindcss.com/docs/text-transform 1037 | addRule('', 'text-transform', 1038 | 'uppercase', 1039 | 'lowercase', 1040 | 'capitalize', 1041 | 'normal-case^none' 1042 | ) 1043 | 1044 | 1045 | // https://tailwindcss.com/docs/text-overflow 1046 | defaultsTemplate+='truncate!overflow:hidden;text-overflow:ellipsis;white-space:nowrap\n' 1047 | 1048 | addRule('text', 'text-overflow', 1049 | 'ellipsis', 1050 | 'clip' 1051 | ) 1052 | 1053 | 1054 | // https://tailwindcss.com/docs/text-indent 1055 | addRule('indent', 'text-indent', 1056 | '$', 1057 | '@4', 1058 | ) 1059 | // https://tailwindcss.com/docs/vertical-align 1060 | addRule('align', 'vertical-align', 1061 | '$', 1062 | 'baseline', 1063 | 'top', 1064 | 'middle', 1065 | 'text-top', 1066 | 'text-bottom', 1067 | 'sub', 1068 | 'super', 1069 | ) 1070 | 1071 | // https://tailwindcss.com/docs/whitespace 1072 | addRule('whitespace', 'white-space', 1073 | 'normal', 1074 | 'nowrap', 1075 | 'pre', 1076 | 'pre-line', 1077 | 'pre-wrap', 1078 | 'break-spaces', 1079 | ) 1080 | 1081 | // https://tailwindcss.com/docs/word-break 1082 | defaultsTemplate+= ` 1083 | break-normal!overflow-wrap: normal;word-break: normal 1084 | break-words!overflow-wrap: break-word 1085 | break-all!word-break: break-all 1086 | break-keep!word-break: keep-all 1087 | ` 1088 | 1089 | // https://tailwindcss.com/docs/hyphens 1090 | addRule('hyphens', '', 1091 | 'none', 1092 | 'manual', 1093 | 'auto', 1094 | ) 1095 | 1096 | // https://tailwindcss.com/docs/content 1097 | addRule('content', '', 1098 | '$', 1099 | 'none' 1100 | ) 1101 | 1102 | 1103 | // BACKGROUNDS 1104 | 1105 | // https://tailwindcss.com/docs/background-attachment 1106 | addRule('bg', 'background-attachment', 1107 | 'fixed', 1108 | 'local', 1109 | 'scroll' 1110 | ) 1111 | 1112 | // https://tailwindcss.com/docs/background-clip 1113 | addRule('bg-clip', 'background-clip', 1114 | 'border^border-box', 1115 | 'padding^padding-box', 1116 | 'content^content-box', 1117 | 'text' 1118 | ) 1119 | 1120 | // https://tailwindcss.com/docs/background-color 1121 | // NOTE: 1122 | addRule('bg', 'background-color', 1123 | 'current^currentColor', 1124 | '@C' 1125 | ) 1126 | 1127 | 1128 | // https://tailwindcss.com/docs/background-origin 1129 | addRule('bg-origin', 'background-origin:$-box', 1130 | 'border', 1131 | 'padding', 1132 | 'content' 1133 | ) 1134 | 1135 | // https://tailwindcss.com/docs/background-position 1136 | addRule('bg', 'background-position', 1137 | '$', 1138 | 'bottom', 1139 | 'center', 1140 | 'left', 1141 | 'left-bottom^left bottom', 1142 | 'left-top^left top', 1143 | 'right', 1144 | 'right-bottom^right bottom', 1145 | 'right-top^right top', 1146 | 'top' 1147 | ) 1148 | 1149 | // https://tailwindcss.com/docs/background-repeat 1150 | addRule('bg', 'background-repeat', 1151 | 'repeat', 1152 | 'no-repeat', 1153 | 'repeat-x', 1154 | 'repeat-y', 1155 | 'repeat-round', 1156 | 'repeat-space', 1157 | ) 1158 | 1159 | // https://tailwindcss.com/docs/background-size 1160 | addRule('bg', 'background-size', 1161 | '$', 1162 | 'auto', 1163 | 'cover', 1164 | 'contain' 1165 | ) 1166 | 1167 | 1168 | // https://tailwindcss.com/docs/background-image 1169 | addRule('bg', 'background', 1170 | '$' 1171 | ) 1172 | // TODO 1173 | // https://tailwindcss.com/docs/gradient-color-stops 1174 | // TODO 1175 | 1176 | 1177 | 1178 | // BORDERS 1179 | 1180 | // https://tailwindcss.com/docs/border-radius 1181 | addRule('rounded', 'border-radius', '@R') 1182 | addRule('rounded-s', 'border-start-start-radius:$;border-end-start-radius:$', '@R') 1183 | addRule('rounded-e', 'border-start-end-radius:$;border-end-end-radius:$', '@R') 1184 | 1185 | addRule('rounded-t', 'border-top-left-radius:$;border-top-right-radius:$', '@R') 1186 | addRule('rounded-b', 'border-bottom-left-radius:$;border-bottom-right-radius:$', '@R') 1187 | addRule('rounded-r', 'border-top-right-radius:$;border-bottom-right-radius:$', '@R') 1188 | addRule('rounded-l', 'border-top-left-radius:$;border-bottom-left-radius:$', '@R') 1189 | 1190 | addRule('rounded-ss', 'border-start-start-radius', '@R') 1191 | addRule('rounded-se', 'border-start-end-radius', '@R') 1192 | addRule('rounded-ee', 'border-end-end-radius', '@R') 1193 | addRule('rounded-es', 'border-end-start-radius', '@R') 1194 | 1195 | addRule('rounded-tl', 'border-top-left-radius', '@R') 1196 | addRule('rounded-tr', 'border-top-right-radius', '@R') 1197 | addRule('rounded-bl', 'border-bottom-left-radius', '@R') 1198 | addRule('rounded-br', 'border-bottom-right-radius', '@R') 1199 | 1200 | 1201 | 1202 | // https://tailwindcss.com/docs/border-width 1203 | addRule('border', 'border-width', '@B') 1204 | 1205 | addRule('border-x', 'border-left-width:$;border-right-width:$', '$', '@B') 1206 | addRule('border-y', 'border-top-width:$;border-bottom-width:$', '$', '@B') 1207 | 1208 | addRule('border-s', 'border-inline-start-width', '$','@B') 1209 | addRule('border-e', 'border-inline-end-width', '$','@B') 1210 | 1211 | addRule('border-t', 'border-top-width', '@B') 1212 | addRule('border-r', 'border-right-width', '@B') 1213 | addRule('border-b', 'border-bottom-width', '@B') 1214 | addRule('border-l', 'border-left-width', '@B') 1215 | 1216 | 1217 | 1218 | 1219 | // https://tailwindcss.com/docs/border-color 1220 | addRule('border', 'border-color', 1221 | '$', 1222 | '@C' 1223 | ) 1224 | 1225 | // https://tailwindcss.com/docs/border-style 1226 | addRule('border', 'border-style', 1227 | 'solid', 1228 | 'dashed', 1229 | 'dotted', 1230 | 'double', 1231 | 'hidden', 1232 | 'none' 1233 | ) 1234 | 1235 | 1236 | // https://tailwindcss.com/docs/divide-width 1237 | addRule('>divide-x','--tw-divide-x-reverse: 0;' 1238 | + 'border-right-width:calc($ * calc(1 - var(--tw-divide-x-reverse)));' 1239 | + 'border-left-width:calc($ * var(--tw-divide-x-reverse))', 1240 | '@B' 1241 | ) 1242 | 1243 | addRule('+divide-x-reverse', '--tw-divide-x-reverse', 1244 | '^1' 1245 | ) 1246 | 1247 | addRule('>divide-y','--tw-divide-y-reverse: 0;' 1248 | + 'border-top-width:calc($ * calc(1 - var(--tw-divide-y-reverse)));' 1249 | + 'border-bottom-width:calc($ * var(--tw-divide-y-reverse))', 1250 | '@B' 1251 | ) 1252 | 1253 | addRule('+divide-y-reverse', '--tw-divide-y-reverse', 1254 | '^1' 1255 | ) 1256 | 1257 | // https://tailwindcss.com/docs/divide-color 1258 | addRule('>divide', 'border-color', 1259 | '$', 1260 | '@C', 1261 | ) 1262 | 1263 | // https://tailwindcss.com/docs/divide-style 1264 | addRule('>divide', 'border-style', 1265 | 'solid', 1266 | 'dashed', 1267 | 'dotted', 1268 | 'double', 1269 | 'none' 1270 | ) 1271 | // https://tailwindcss.com/docs/outline-width 1272 | addRule('outline', 'outline-width', 1273 | '$', 1274 | '0^0px', 1275 | '1^1px', 1276 | '2^2px', 1277 | '4^4px', 1278 | '8^8px' 1279 | ) 1280 | 1281 | // https://tailwindcss.com/docs/outline-color 1282 | addRule('outline', 'outline-color', 1283 | '$', 1284 | '@C' 1285 | ) 1286 | 1287 | 1288 | // https://tailwindcss.com/docs/outline-style 1289 | defaultsTemplate+= ` 1290 | outline-none!outline:2px solid transparent;outline-offset:2px 1291 | ` 1292 | 1293 | addRule('outline', 'outline-style', 1294 | '^solid', 1295 | 'dashed', 1296 | 'dotted', 1297 | 'double' 1298 | ) 1299 | 1300 | 1301 | // https://tailwindcss.com/docs/outline-offset 1302 | addRule('outline-offset', '', 1303 | '$', 1304 | '0^0px', 1305 | '1^1px', 1306 | '2^2px', 1307 | '4^4px', 1308 | '8^8px' 1309 | ) 1310 | 1311 | // https://tailwindcss.com/docs/ring-width 1312 | defaultsTemplate+=` 1313 | ring-inset!--tw-ring-inset: inset 1314 | ` 1315 | addRule('ring', 'box-shadow: var(--tw-ring-inset) 0 0 0 calc($ + var(--tw-ring-offset-width)) var(--tw-ring-color)', 1316 | '$', 1317 | '^3px', 1318 | '0^0px', 1319 | '1^1px', 1320 | '2^2px', 1321 | '4^4px', 1322 | '8^8px' 1323 | ) 1324 | 1325 | // https://tailwindcss.com/docs/ring-color 1326 | addRule('ring', '--tw-ring-color', 1327 | '$', 1328 | '@C' 1329 | ) 1330 | 1331 | // https://tailwindcss.com/docs/ring-offset-width 1332 | addRule('ring-offset', '--tw-ring-offset-width:$;box-shadow: 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color), var(--tw-ring-shadow)', 1333 | '$', 1334 | '0^0px', 1335 | '1^1px', 1336 | '2^2px', 1337 | '4^4px', 1338 | '8^8px' 1339 | ) 1340 | 1341 | // https://tailwindcss.com/docs/ring-offset-color 1342 | addRule('ring-offset', '--tw-ring-offset-color:$;box-shadow: 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color), var(--tw-ring-shadow)', 1343 | '$', 1344 | '@C' 1345 | ) 1346 | 1347 | // EFFECTS 1348 | 1349 | // https://tailwindcss.com/docs/box-shadow 1350 | addRule('shadow', '--tw-shadow:$;box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)', 1351 | 'sm^0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color)', 1352 | 'md^0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color)', 1353 | '^0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color)', 1354 | 'lg^0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color)', 1355 | 'xl^0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a;--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color)', 1356 | '2xl^0 25px 50px -12px rgb(0 0 0 / 0.25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color)', 1357 | 'inner^--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color)', 1358 | 'none^0 0 #0000;--tw-shadow-colored: 0 0 #0000', 1359 | ) 1360 | 1361 | // https://tailwindcss.com/docs/box-shadow-color 1362 | addRule('+shadow', '--tw-shadow-color:$;--tw-shadow: var(--tw-shadow-colored)', 1363 | '$', 1364 | '@C' 1365 | ) 1366 | 1367 | // https://tailwindcss.com/docs/opacity 1368 | addRule('opacity', '', 1369 | '$', 1370 | '0^0', 1371 | '5^0.05', 1372 | '10^0.1', 1373 | '20^0.2', 1374 | '25^0.25', 1375 | '30^0.3', 1376 | '40^0.4', 1377 | '50^0.5', 1378 | '60^0.6', 1379 | '70^0.7', 1380 | '75^0.75', 1381 | '80^0.8', 1382 | '90^0.9', 1383 | '95^0.95', 1384 | '100^1', 1385 | ) 1386 | 1387 | // https://tailwindcss.com/docs/mix-blend-mode 1388 | addRule('mix-blend', 'mix-blend-mode', 1389 | 'normal', 1390 | 'multiply', 1391 | 'screen', 1392 | 'overlay', 1393 | 'darken', 1394 | 'lighten', 1395 | 'color-dodge', 1396 | 'color-burn', 1397 | 'hard-light', 1398 | 'soft-light', 1399 | 'difference', 1400 | 'exclusion', 1401 | 'hue', 1402 | 'saturation', 1403 | 'color', 1404 | 'luminosity', 1405 | 'plus-lighter', 1406 | ) 1407 | 1408 | 1409 | // https://tailwindcss.com/docs/background-blend-mode 1410 | addRule('bg-blend', 'background-blend-mode', 1411 | 'normal', 1412 | 'multiply', 1413 | 'screen', 1414 | 'overlay', 1415 | 'darken', 1416 | 'lighten', 1417 | 'color-dodge', 1418 | 'color-burn', 1419 | 'hard-light', 1420 | 'soft-light', 1421 | 'difference', 1422 | 'exclusion', 1423 | 'hue', 1424 | 'saturation', 1425 | 'color', 1426 | 'luminosity', 1427 | ) 1428 | 1429 | 1430 | // FILTERS 1431 | 1432 | // https://tailwindcss.com/docs/blur 1433 | addFilter('blur', '--tw-blur:$' + '@f', 1434 | '$', 1435 | 'none', 1436 | 'sm^4px', 1437 | '^8px', 1438 | 'md^12px', 1439 | 'lg^16px', 1440 | 'xl^24px', 1441 | '2xl^40px', 1442 | '3xl^64px', 1443 | ) 1444 | 1445 | // https://tailwindcss.com/docs/brightness 1446 | addFilter('brightness', '--tw-brightness:$' + '@f', 1447 | '$', 1448 | '0', 1449 | '50^.5', 1450 | '75^.75', 1451 | '90^.9', 1452 | '95^.95', 1453 | '100^1', 1454 | '105^1.05', 1455 | '110^1.1', 1456 | '125^1.25', 1457 | '150^1.5', 1458 | '200^2', 1459 | ) 1460 | 1461 | // https://tailwindcss.com/docs/contrast 1462 | addFilter('contrast', '--tw-contrast:$' + '@f', 1463 | '$', 1464 | '0', 1465 | '50^.5', 1466 | '75^.75', 1467 | '100^1', 1468 | '125^1.25', 1469 | '150^1.5', 1470 | '200^2', 1471 | ) 1472 | 1473 | // TODO drop shadow 1474 | 1475 | // https://tailwindcss.com/docs/grayscale 1476 | addFilter('grayscale', '--tw-grayscale:$' + '@f', 1477 | '$', 1478 | '0', 1479 | '^100%', 1480 | ) 1481 | 1482 | // https://tailwindcss.com/docs/hue-rotate 1483 | addFilter('hue-rotate', '--tw-hue-rotate:$' + '@f', 1484 | '$', 1485 | '0^0deg', 1486 | '15^15deg', 1487 | '30^30deg', 1488 | '60^60deg', 1489 | '90^90deg', 1490 | '180^180deg', 1491 | ) 1492 | 1493 | // https://tailwindcss.com/docs/invert 1494 | addFilter('invert', '--tw-invert:$' + '@f', 1495 | '$', 1496 | '0', 1497 | '^100%', 1498 | ) 1499 | 1500 | // https://tailwindcss.com/docs/saturate 1501 | addFilter('saturate', '--tw-saturate:$' + '@f', 1502 | '$', 1503 | '0', 1504 | '50^.5', 1505 | '100^1', 1506 | '150^1.5', 1507 | '200^2', 1508 | ) 1509 | 1510 | // https://tailwindcss.com/docs/sepia 1511 | addFilter('sepia', '--tw-sepia:$' + '@f', 1512 | '$', 1513 | '0', 1514 | '^100%', 1515 | ) 1516 | 1517 | 1518 | 1519 | 1520 | 1521 | 1522 | // TABLE 1523 | 1524 | // https://tailwindcss.com/docs/border-collapse 1525 | addRule('border', 'border-collapse', 1526 | 'collapse', 1527 | 'separate', 1528 | ) 1529 | 1530 | // https://tailwindcss.com/docs/border-spacing 1531 | addRule('border-spacing', '--tw-border-spacing-x:$;--tw-border-spacing-y:$' + '@b', 1532 | '@4' 1533 | ) 1534 | 1535 | addRule('+border-spacing-x', '--tw-border-spacing-x:$' + '@b', 1536 | '@4' 1537 | ) 1538 | 1539 | addRule('+border-spacing-y', '--tw-border-spacing-y:$' + '@b', 1540 | '@4' 1541 | ) 1542 | 1543 | 1544 | // https://tailwindcss.com/docs/table-layout 1545 | addRule('table', 'table-layout', 1546 | 'auto', 1547 | 'fixed' 1548 | ) 1549 | 1550 | // https://tailwindcss.com/docs/caption-side 1551 | addRule('caption', 'caption-side', 1552 | 'top', 1553 | 'bottom' 1554 | ) 1555 | 1556 | // https://tailwindcss.com/docs/transition-property 1557 | addRule('transition','transition-property: $;' 1558 | + 'transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);transition-duration: 150ms;', 1559 | '$', 1560 | 'none', 1561 | 'all', 1562 | '^color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter', 1563 | 'colors^color, background-color, border-color, text-decoration-color, fill, stroke', 1564 | 'opacity', 1565 | 'shadow^box-shadow', 1566 | 'transform', 1567 | 1568 | ) 1569 | // https://tailwindcss.com/docs/transition-duration 1570 | addRule('+duration', 'transition-duration', 1571 | '$', 1572 | '0^0s', 1573 | '75^75ms', 1574 | '100^100ms', 1575 | '150^150ms', 1576 | '200^200ms', 1577 | '300^300ms', 1578 | '500^500ms', 1579 | '700^700ms', 1580 | '1000^1000ms', 1581 | ) 1582 | 1583 | // https://tailwindcss.com/docs/transition-timing-function 1584 | addRule('+ease', 'transition-timing-function', 1585 | 'linear', 1586 | 'in^cubic-bezier(0.4, 0, 1, 1)', 1587 | 'out^cubic-bezier(0, 0, 0.2, 1)', 1588 | 'in-out^cubic-bezier(0.4, 0, 0.2, 1)', 1589 | ) 1590 | 1591 | // https://tailwindcss.com/docs/transition-delay 1592 | addRule('delay', 'transition-delay', 1593 | '$', 1594 | '0^0s', 1595 | '75^75ms', 1596 | '100^100ms', 1597 | '150^150ms', 1598 | '200^200ms', 1599 | '300^300ms', 1600 | '500^500ms', 1601 | '700^700ms', 1602 | '1000^1000ms', 1603 | ) 1604 | 1605 | // https://tailwindcss.com/docs/animation 1606 | // NOTE: the spin keyframes have been added to index.css file 1607 | addRule('animate', 'animation', 1608 | '$', 1609 | 'none', 1610 | 'spin^spin 1s linear infinite', 1611 | 'ping^ping 1s cubic-bezier(0, 0, 0.2, 1) infinite' 1612 | ) 1613 | 1614 | // https://tailwindcss.com/docs/scale 1615 | addRule('scale', '--tw-scale-x:$;--tw-scale-y:$' + '@t', 1616 | '$', 1617 | '0', 1618 | '50^.5', 1619 | '75^.75', 1620 | '90^.9', 1621 | '95^.95', 1622 | '100^1', 1623 | '105^1.05', 1624 | '110^1.1', 1625 | '125^1.25', 1626 | '150^1.5', 1627 | ) 1628 | 1629 | addRule('+scale-x', '--tw-scale-x:$' + '@t', 1630 | '$', 1631 | '0', 1632 | '50^.5', 1633 | '75^.75', 1634 | '90^.9', 1635 | '95^.95', 1636 | '100^1', 1637 | '105^1.05', 1638 | '110^1.1', 1639 | '125^1.25', 1640 | '150^1.5', 1641 | ) 1642 | 1643 | addRule('+scale-y', '--tw-scale-y:$' + '@t', 1644 | '$', 1645 | '0', 1646 | '50^.5', 1647 | '75^.75', 1648 | '90^.9', 1649 | '95^.95', 1650 | '100^1', 1651 | '105^1.05', 1652 | '110^1.1', 1653 | '125^1.25', 1654 | '150^1.5', 1655 | ) 1656 | 1657 | // https://tailwindcss.com/docs/rotate 1658 | addRule('rotate', '--tw-rotate:$' + '@t', 1659 | '$', 1660 | '0^0deg', 1661 | '1^1deg', 1662 | '2^2deg', 1663 | '3^3deg', 1664 | '6^6deg', 1665 | '12^12deg', 1666 | '45^45deg', 1667 | '90^90deg', 1668 | '180^180deg', 1669 | 1670 | ) 1671 | 1672 | // https://tailwindcss.com/docs/translate 1673 | addRule('translate-x', '--tw-translate-x:$' + '@t', 1674 | '@4', 1675 | ) 1676 | 1677 | addRule('translate-y', '--tw-translate-y:$' + '@t', 1678 | '@4', 1679 | ) 1680 | 1681 | // https://tailwindcss.com/docs/skew 1682 | addRule('skew-x', '--tw-skew-x:$' + '@t', 1683 | '$', 1684 | '0^0deg', 1685 | '1^1deg', 1686 | '2^2deg', 1687 | '3^3deg', 1688 | '6^6deg', 1689 | '12^12deg', 1690 | ) 1691 | 1692 | addRule('skew-y', '--tw-skew-y:$' + '@t', 1693 | '$', 1694 | '0^0deg', 1695 | '1^1deg', 1696 | '2^2deg', 1697 | '3^3deg', 1698 | '6^6deg', 1699 | '12^12deg', 1700 | ) 1701 | 1702 | 1703 | // https://tailwindcss.com/docs/transform-origin 1704 | addRule('origin', 'transform-origin', 1705 | '$', 1706 | 'center', 1707 | 'top', 1708 | 'top-right^top right', 1709 | 'right', 1710 | 'bottom-right^bottom right', 1711 | 'bottom', 1712 | 'bottom-left^bottom left', 1713 | 'left', 1714 | 'top-left^top left', 1715 | ) 1716 | 1717 | 1718 | // INTERACTIVITY 1719 | 1720 | // https://tailwindcss.com/docs/accent-color 1721 | addRule('accent', 'accent-color', 1722 | '$', 1723 | '@C' 1724 | ) 1725 | 1726 | 1727 | // https://tailwindcss.com/docs/appearance 1728 | addRule('appearence', '', 1729 | 'none' 1730 | ) 1731 | 1732 | // https://tailwindcss.com/docs/cursor 1733 | addRule('cursor', '', 1734 | '$', 1735 | 'auto', 1736 | 'default', 1737 | 'pointer', 1738 | 'wait', 1739 | 'text', 1740 | 'move', 1741 | 'help', 1742 | 'not-allowed', 1743 | 'none', 1744 | 'context-menu', 1745 | 'progress', 1746 | 'cell', 1747 | 'crosshair', 1748 | 'vertical-text', 1749 | 'alias', 1750 | 'copy', 1751 | 'no-drop', 1752 | 'grab', 1753 | 'grabbing', 1754 | 'all-scroll', 1755 | 'col-resize', 1756 | 'row-resize', 1757 | 'n-resize', 1758 | 'e-resize', 1759 | 's-resize', 1760 | 'w-resize', 1761 | 'ne-resize', 1762 | 'nw-resize', 1763 | 'se-resize', 1764 | 'sw-resize', 1765 | 'ew-resize', 1766 | 'ns-resize', 1767 | 'nesw-resize', 1768 | 'nwse-resize', 1769 | 'zoom-in', 1770 | 'zoom-out', 1771 | ) 1772 | 1773 | // https://tailwindcss.com/docs/caret-color 1774 | addRule('caret', 'caret-color', 1775 | '$', 1776 | '@C' 1777 | ) 1778 | 1779 | // https://tailwindcss.com/docs/pointer-events 1780 | addRule('pointer-events', '', 1781 | 'none', 1782 | 'auto', 1783 | ) 1784 | 1785 | // https://tailwindcss.com/docs/resize 1786 | addRule('resize', '', 1787 | 'none', 1788 | 'y^vertical', 1789 | 'x^horizontal', 1790 | '^both' 1791 | ) 1792 | 1793 | // https://tailwindcss.com/docs/scroll-behavior 1794 | addRule('scroll', 'scroll-behavior', 1795 | 'auto', 1796 | 'smooth' 1797 | ) 1798 | 1799 | // https://tailwindcss.com/docs/scroll-margin 1800 | // https://tailwindcss.com/docs/scroll-padding 1801 | // TODO 1802 | 1803 | // https://tailwindcss.com/docs/scroll-snap-align 1804 | addRule('snap', 'scroll-snap-align', 1805 | 'start', 1806 | 'end', 1807 | 'center', 1808 | 'align-none^none' // otherwise will overlap with snap type 1809 | 1810 | ) 1811 | 1812 | // https://tailwindcss.com/docs/scroll-snap-stop 1813 | addRule('snap', 'scroll-snap-stop', 1814 | 'normal', 1815 | 'always', 1816 | ) 1817 | 1818 | // https://tailwindcss.com/docs/scroll-snap-type 1819 | defaultsTemplate+=` 1820 | snap-none!scroll-snap-type: none 1821 | snap-x!scroll-snap-type: x var(--tw-scroll-snap-strictness) 1822 | snap-y!scroll-snap-type: y var(--tw-scroll-snap-strictness) 1823 | snap-both!scroll-snap-type: both var(--tw-scroll-snap-strictness) 1824 | snap-mandatory!--tw-scroll-snap-strictness: mandatory 1825 | snap-proximity!--tw-scroll-snap-strictness: proximity 1826 | ` 1827 | 1828 | // https://tailwindcss.com/docs/touch-action 1829 | addRule('touch', 'touch-action', 1830 | 'auto', 1831 | 'none', 1832 | 'pan-x', 1833 | 'pan-left', 1834 | 'pan-right', 1835 | 'pan-y', 1836 | 'pan-up', 1837 | 'pan-down', 1838 | 'pinch-zoom', 1839 | 'manipulation', 1840 | ) 1841 | 1842 | // https://tailwindcss.com/docs/user-select 1843 | addRule('select', 'user-select', 1844 | 'none', 1845 | 'text', 1846 | 'all', 1847 | 'auto', 1848 | ) 1849 | 1850 | // https://tailwindcss.com/docs/will-change 1851 | addRule('will-change', '', 1852 | 'auto', 1853 | 'scroll^scroll-position', 1854 | 'contents', 1855 | 'transform', 1856 | ) 1857 | 1858 | 1859 | // SVG 1860 | 1861 | // https://tailwindcss.com/docs/fill 1862 | addRule('fill', '', 1863 | '$', 1864 | 'none', 1865 | '@C' 1866 | ) 1867 | 1868 | // https://tailwindcss.com/docs/stroke 1869 | addRule('stroke', '', 1870 | '$', 1871 | 'none', 1872 | '@C' 1873 | ) 1874 | 1875 | 1876 | // https://tailwindcss.com/docs/stroke-width 1877 | addRule('stroke', 'stroke-width', 1878 | '$', 1879 | '0', 1880 | '1', 1881 | '2', 1882 | ) 1883 | 1884 | // ACCESSIBILITY 1885 | 1886 | // https://tailwindcss.com/docs/screen-readers 1887 | defaultsTemplate+=` 1888 | sr-only!position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0 1889 | not-sr-only!position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal 1890 | ` 1891 | 1892 | 1893 | 1894 | 1895 | 1896 | 1897 | 1898 | 1899 | const defaultsTemplateParsed = clean(defaultsTemplate) 1900 | const ruleParsed = clean(ruleTemplate) 1901 | const filterParsed = clean(filterTemplate) 1902 | export {ruleParsed as ruleTemplate, filterParsed as filterTemplate, defaultsTemplateParsed as defaultsTemplate} 1903 | 1904 | 1905 | 1906 | 1907 | 1908 | 1909 | 1910 | -------------------------------------------------------------------------------- /src/utils.ts: -------------------------------------------------------------------------------- 1 | 2 | export const splitOnFirst = (char, string) => { 3 | const index = string.indexOf(char) 4 | if(index === -1) return [string, ''] 5 | return [string.substring(0, index), string.substring(index + char.length)] 6 | } 7 | 8 | export const dictionarify = (template: string) => { 9 | const dictionary : Record = {} 10 | const lines = template.split('\n') 11 | for(let line of lines) { 12 | line = line.trim() 13 | if(line.length === 0) continue 14 | const values = line.split('!'); 15 | dictionary[values[0]] = values[1] || values[0] 16 | } 17 | return dictionary 18 | } 19 | 20 | export const purgedLines = (template: string) => 21 | template.trim().split('\n').map(l => l.trim()).filter( l => l !== '') 22 | 23 | export const clean = (template: string) => 24 | template.trim().split('\n').map(l => l.trim()).filter( l => l !== '').join('\n') -------------------------------------------------------------------------------- /tailwind.config.cjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mudgen/runcss/7a57af28f44821273a576cc23302d6f5c09e1e79/tailwind.config.cjs -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["es5", "es6", "es2021", "dom", "dom.iterable" ], 4 | "target": "es2021", 5 | "module": "es2022", 6 | }, 7 | "include": ["src/index.ts"] 8 | } -------------------------------------------------------------------------------- /types.d.ts: -------------------------------------------------------------------------------- 1 | /** RunCSS - Generate tailwind classes on the fly 2 | * 3 | * RunCSS is the runtime equivalent of TailwindCSS, featuring the same CSS utility class names, but with no build step required. It achieves this by generating CSS on the fly with JavaScript. 4 | * RunCSS comes with batteries included. By default all additional variants such as hover, active, visited, group-hover, sm, lg etc work with all class names. All packaged in a single 25kb (8kb after compression) JS file! 5 | */ 6 | declare module "runcss" { 7 | 8 | /** Use extendRunCSS to extend RunCSS templates. 9 | * 10 | * IMPORTANT: do not call after initializing RunCSS() */ 11 | export const extendRunCSS: (plugin: (arg0: any) => any) => void; 12 | 13 | export const defaultsTemplate : string; 14 | export const ruleTemplate: string; 15 | export const shortcuts: Record; 16 | 17 | 18 | export const states : Record>; 19 | 20 | /** RunCSS main constructor. Call once. */ 21 | const _default: (options?: Record) => { 22 | 23 | /** Add classes to the main stylesheet. 24 | * @example processClasses('bg-gray-500 text-xl') */ 25 | processClasses: (classes: string) => void; 26 | 27 | /** Watch for new elements using the MutationObserver API, and automatically add their classes. */ 28 | startWatching: (targetNode?: Element) => void; 29 | 30 | /** Stop all the mutationObservers created with startWatching. */ 31 | stopWatching: () => void; 32 | 33 | /** Return the current generated CSS stylesheet as string. */ 34 | exportCSS: () => string; 35 | }; 36 | export default _default; 37 | } --------------------------------------------------------------------------------