@birdycom/omniacss-migrate 0.0.0-stage → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +129 -3
- package/bin/omniacss-migrate.mjs +9 -0
- package/package.json +61 -6
- package/scripts/build-color-map.mjs +31 -0
- package/scripts/extract-palette.mjs +13 -0
- package/scripts/tailwind-palette.json +291 -0
- package/src/bootstrap/compat.mjs +72 -0
- package/src/bootstrap/convert.mjs +102 -0
- package/src/bootstrap/migrate.mjs +259 -0
- package/src/bootstrap/rules.mjs +212 -0
- package/src/cli.mjs +139 -0
- package/src/codemod.mjs +82 -0
- package/src/core.mjs +67 -0
- package/src/data/colors.json +290 -0
- package/src/extract.mjs +91 -0
- package/src/index.mjs +12 -0
- package/src/native.mjs +72 -0
- package/src/postcss.mjs +308 -0
- package/src/preflight.mjs +52 -0
- package/src/project.mjs +194 -0
- package/src/resolve.mjs +220 -0
- package/src/scan.mjs +106 -0
- package/src/setup.mjs +205 -0
- package/src/utilities.mjs +713 -0
- package/src/values.mjs +184 -0
- package/src/variants.mjs +189 -0
- package/src/vite.mjs +81 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Serge Cools (Birdycom)
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,3 +1,129 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# @birdycom/omniacss-migrate
|
|
2
|
+
|
|
3
|
+
Switch a **Laravel, Vue or React** project from Tailwind CSS to OmniaCSS **and keep your class names**.
|
|
4
|
+
`flex items-center gap-4 p-4 md:p-8 bg-white dark:bg-gray-900 hover:bg-red-500/50 w-[37px]` keeps working: the classes are resolved on demand and emitted as CSS that only uses OmniaCSS tokens (Omnia palette in OKLCH, `rem` scales, Omnia shadows and breakpoints).
|
|
5
|
+
|
|
6
|
+
Coming from **Bootstrap 3, 4 or 5**? See [From Bootstrap](#from-bootstrap).
|
|
7
|
+
|
|
8
|
+
> This is the only package that names Tailwind and Bootstrap, because it is a migration tool.
|
|
9
|
+
|
|
10
|
+
## Laravel in 3 steps
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# 1. see what changes (dry run, nothing is written) and how much of your markup is covered
|
|
14
|
+
npx @birdycom/omniacss-migrate scan .
|
|
15
|
+
npx @birdycom/omniacss-migrate setup .
|
|
16
|
+
|
|
17
|
+
# 2. apply the switch: removes the Tailwind packages from package.json, swaps the Vite/PostCSS plugin, carries your theme into CSS
|
|
18
|
+
npx @birdycom/omniacss-migrate setup . --write
|
|
19
|
+
npm uninstall tailwindcss @tailwindcss/vite @tailwindcss/postcss && npm install -D @birdycom/omniacss-migrate
|
|
20
|
+
|
|
21
|
+
# 3. build as usual
|
|
22
|
+
npm run dev
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Your Blade, Vue and React files stay exactly as they are. By hand it is two edits:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
// vite.config.js
|
|
29
|
+
import omniaMigrate from "@birdycom/omniacss-migrate/vite"; // was: import tailwindcss from "@tailwindcss/vite"
|
|
30
|
+
export default defineConfig({ plugins: [laravel({ input: ["resources/css/app.css", "resources/js/app.js"] }), omniaMigrate()] });
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```css
|
|
34
|
+
/* resources/css/app.css: unchanged. Both forms are understood: */
|
|
35
|
+
@import "tailwindcss";
|
|
36
|
+
/* or */
|
|
37
|
+
@tailwind base; @tailwind components; @tailwind utilities;
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Not using Vite? Use the PostCSS plugin instead:
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
// postcss.config.js
|
|
44
|
+
import omniaMigrate from "@birdycom/omniacss-migrate/postcss";
|
|
45
|
+
export default { plugins: [omniaMigrate({ content: ["resources/views/**/*.blade.php", "resources/js/**/*.{vue,tsx,jsx,js}"] })] };
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## What the plugin does
|
|
49
|
+
|
|
50
|
+
- Replaces `@import "tailwindcss"` / `@tailwind base|components|utilities` with Omnia core (tokens + the Omnia classes you use), a small base reset and the compat CSS for the classes it finds in your content.
|
|
51
|
+
- Expands `@apply` (with variants, `!important`, and your own classes), `theme(colors.red.500)`, `--spacing(4)`, `@theme`, `@custom-variant`, `@variant`, `@source`, `@source inline("…")`; ignores `@plugin` and `@config`.
|
|
52
|
+
- Reads `tailwind.config.{js,cjs,mjs}` (`darkMode`, `theme.colors`/`extend.colors`, `fontFamily`, `borderRadius`, `spacing`, `boxShadow`, `screens`, `container`, `prefix`, `important`) and your `@theme` blocks.
|
|
53
|
+
- Output is wrapped in cascade layers `omnia, theme, base, components, utilities`.
|
|
54
|
+
|
|
55
|
+
Class coverage: layout, flex/grid, spacing, sizing, typography, colors (text, bg, border, ring, outline, fill, stroke, divide, accent, caret, decoration, gradients `from-`/`via-`/`to-`), borders, radius, shadow, ring, opacity, filters and backdrop filters, transitions, animations, transforms, display, position, z-index, overflow, cursor, scroll snap, `tailwindcss-animate` classes, arbitrary values (`w-[37px]`, `bg-(--brand)`, `[mask-type:luminance]`), opacity modifiers (`bg-red-500/50`), negatives (`-mt-2`), `!important`, and variants `hover: focus: active: disabled: first: odd: before: after: placeholder: file: marker: selection:`, `sm: md: lg: xl: 2xl: max-md: min-[…]:`, `@md:` container queries, `dark:`, `group-*`, `peer-*`, `data-[…]:`, `aria-*:`, `has-[…]:`, `not-*`, `in-*`, `supports-[…]:`, `*:`, arbitrary variants `[&>svg]:`, `motion-safe:`, `print:`, `rtl:`.
|
|
56
|
+
|
|
57
|
+
### Colors
|
|
58
|
+
|
|
59
|
+
Tailwind palette names map to the **nearest Omnia palette token** (`src/data/colors.json`, generated by `scripts/build-color-map.mjs` with `nearestOmnia()`): `bg-red-500` becomes `var(--color-red-50)`. Arbitrary colors (`bg-[#0041a7]`) are mapped to the nearest token too (`arbitraryColors: "keep"` keeps the literal). Opacity modifiers use `color-mix(in oklab, <token> 50%, transparent)`.
|
|
60
|
+
Colors from `tailwind.config` are mapped to Omnia tokens as well (`--keep-brand-colors` / `keepBrandColors` keeps them); values that are `var(...)`/`hsl(var(...))` (shadcn style) stay as you wrote them.
|
|
61
|
+
|
|
62
|
+
### Scales
|
|
63
|
+
|
|
64
|
+
Spacing, sizing, font sizes, radius, blur and containers use the familiar numbers (`p-4` = `1rem`). Shadows reuse Omnia's own shadow values. Breakpoints follow OmniaCSS (`sm` 36rem, `md` 50rem, `lg` 64rem; `xl` 80rem and `2xl` 96rem exist for compatibility). Use `breakpoints: "tailwind"` for 40/48/64/80/96rem.
|
|
65
|
+
|
|
66
|
+
Names that exist in both systems (`p-4`, `flex`, `shadow-md` …) never collide: classes the compat layer resolves are removed from the Omnia core output.
|
|
67
|
+
|
|
68
|
+
## CLI
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
omniacss-migrate scan <dir> coverage: % of class occurrences supported + the unsupported list
|
|
72
|
+
omniacss-migrate setup <project> [--write] plan (dry run) or apply: package.json, vite/postcss config, CSS @theme + dark mode
|
|
73
|
+
omniacss-migrate codemod <dir> [--write] rewrite to native OmniaCSS class names where the CSS is identical
|
|
74
|
+
omniacss-migrate build [-c glob] [-o file] write the CSS once (no Vite or PostCSS)
|
|
75
|
+
omniacss-migrate css "md:hover:bg-red-500/50" print the CSS for one class
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`omniacss migrate scan .` does the same through the main CLI (`npm i -D @birdycom/omniacss-migrate`).
|
|
79
|
+
|
|
80
|
+
`setup` and `codemod` are dry runs unless you pass `--write`. Commit first: the files are changed in place.
|
|
81
|
+
|
|
82
|
+
## Codemod (optional)
|
|
83
|
+
|
|
84
|
+
`codemod` rewrites `class`/`className`/`cn()`/`cva()` strings to **native** OmniaCSS names when an Omnia class has exactly the same declarations (for example `items-center` becomes `align-items-center`, `p-4` becomes `p-1`). Everything else is left alone and listed. After `--write` the file `omniacss-migrate.manifest.json` tells the compat layer which names are now native, so `p-1` (Omnia, `1rem`) is never confused with the old `p-1` (`0.25rem`). Run it over the whole project, not a single folder.
|
|
85
|
+
|
|
86
|
+
## From Bootstrap
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npx @birdycom/omniacss-migrate bootstrap scan . # report only
|
|
90
|
+
npx @birdycom/omniacss-migrate bootstrap codemod . --write # apply (commit first)
|
|
91
|
+
npx omniacss build -o css/omnia.css # OmniaCSS for exactly the classes you use
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Works on HTML, PHP, Blade, Twig, ERB, Vue and JSX templates; template code inside a class attribute (`<?php … ?>`, `{{ … }}`) is left untouched.
|
|
95
|
+
|
|
96
|
+
- **Utilities** become the OmniaCSS class with the same declarations, looked up in the installed OmniaCSS build: `mt-3` (1rem) becomes `mt-1`, `d-md-none` becomes `md:d-none`, `justify-content-between` becomes `justify-between`. Theme colors (`text-primary`, `bg-dark`, `border-danger`) map to the nearest Omnia token.
|
|
97
|
+
- **Components** become OmniaUI classes: `btn btn-primary` → `oc-btn`, `alert alert-danger` → `oc-alert oc-alert--danger`, `form-control` → `oc-input` (`oc-select` on a `<select>`), `card-body`/`panel-body` → `oc-card-content`, `table table-striped` → `oc-table oc-table--striped`.
|
|
98
|
+
- **Grid** classes (`container`, `row`, `col-*`, `offset-*`, `g-*`, `row-cols-*`) stay, served by a generated `bootstrap-compat.css` with only the classes in use, at OmniaCSS breakpoints. Utilities without an OmniaCSS twin (`border` 1px, `z-1`, `mt-n1`) keep their exact CSS in the same file.
|
|
99
|
+
- **JavaScript components** (modal, dropdown, collapse, carousel, navbar, tabs, offcanvas, toast) and icon fonts are reported with the native replacement (`<dialog>` + `commandfor`, popover, `<details>`, scroll snap).
|
|
100
|
+
- The Bootstrap `<link>` is replaced by `omnia.css`, the OmniaUI CSS and `bootstrap-compat.css` in the same asset folder.
|
|
101
|
+
- The report lists classes your JavaScript toggles (`classList.add('btn-primary')`) and Bootstrap 3 classes in a newer site, split into "still styled by your CSS" and "safe to delete".
|
|
102
|
+
- `--write` records the classes it produced in `omniacss-migrate.bootstrap.json`, so running it again never reads the new `mt-1` (OmniaCSS, 1rem) as Bootstrap's `mt-1` (0.25rem).
|
|
103
|
+
|
|
104
|
+
Options: `--bs 3|4|5` (default: detected from `package.json`, the `<link>`, a local `bootstrap.css` or the markup), `--breakpoints exact` (keep Bootstrap's pixel breakpoints as `min-[48rem]:`), `--compat <file>`, `--omnia-href`, `--omniaui-href`, `--compat-href`.
|
|
105
|
+
|
|
106
|
+
## Options (PostCSS / Vite)
|
|
107
|
+
|
|
108
|
+
| Option | Default | Meaning |
|
|
109
|
+
| --- | --- | --- |
|
|
110
|
+
| `content` | detected (Laravel, Astro, Nuxt, Vite) | globs with class names; `@source` is honoured too |
|
|
111
|
+
| `core` | `true` | `true` Omnia core on demand, `"tokens"` only the color tokens and base, `false` you load Omnia yourself |
|
|
112
|
+
| `preflight` | `true` | include the base reset |
|
|
113
|
+
| `layers` | `true` | cascade layers |
|
|
114
|
+
| `tailwind` | detected | `3` or `4` naming (`shadow-sm`, `rounded-sm`, `ring`, `blur-sm` differ) |
|
|
115
|
+
| `darkMode` | detected | `"class"` (`.dark`) or `"media"` |
|
|
116
|
+
| `breakpoints` | `"omnia"` | or `"tailwind"` |
|
|
117
|
+
| `arbitraryColors` | `"nearest"` | or `"keep"` |
|
|
118
|
+
| `safelist` | `[]` | extra classes |
|
|
119
|
+
|
|
120
|
+
## Known gaps
|
|
121
|
+
|
|
122
|
+
- Plugin classes other than `tailwindcss-animate` (typography `prose`, forms, Iconify `icon-[…]`, container-queries plugin utilities) are not generated.
|
|
123
|
+
- `theme.extend.keyframes`/`animation` from `tailwind.config` are not carried over.
|
|
124
|
+
- `bg-opacity-*`/`text-opacity-*` (Tailwind 2 style) and `mask-*` utilities are not generated.
|
|
125
|
+
- Classes assembled from fragments at runtime (`"bg-" + color + "-500"`) cannot be found by any scanner: add them to `safelist`.
|
|
126
|
+
- Breakpoints, shadows and nearest-palette colors differ slightly from Tailwind by design: check the result visually.
|
|
127
|
+
- The first build parses the full Omnia CSS (a few seconds); later builds are cached. `core: "tokens"` is instant.
|
|
128
|
+
|
|
129
|
+
Node.js 22+. MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@birdycom/omniacss-migrate",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@birdycom/omniacss-migrate",
|
|
3
|
+
"version": "0.11.1",
|
|
4
|
+
"description": "Switch a Laravel / Vue / React project from Tailwind CSS to OmniaCSS and keep your class names (PostCSS + Vite plugin, scan, setup, codemod), or convert a Bootstrap 3/4/5 site to OmniaCSS + OmniaUI.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Serge Cools (Birdycom)",
|
|
8
|
+
"homepage": "https://omniacss.eu",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/Birdycom/OmniaCSS.git",
|
|
12
|
+
"directory": "packages/migrate"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/Birdycom/OmniaCSS/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"css",
|
|
19
|
+
"migration",
|
|
20
|
+
"tailwind",
|
|
21
|
+
"bootstrap",
|
|
22
|
+
"laravel",
|
|
23
|
+
"vite",
|
|
24
|
+
"postcss",
|
|
25
|
+
"codemod",
|
|
26
|
+
"omniacss"
|
|
27
|
+
],
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=22"
|
|
30
|
+
},
|
|
31
|
+
"bin": {
|
|
32
|
+
"omniacss-migrate": "./bin/omniacss-migrate.mjs"
|
|
33
|
+
},
|
|
34
|
+
"exports": {
|
|
35
|
+
".": "./src/index.mjs",
|
|
36
|
+
"./postcss": "./src/postcss.mjs",
|
|
37
|
+
"./vite": "./src/vite.mjs",
|
|
38
|
+
"./cli": "./src/cli.mjs",
|
|
39
|
+
"./colors.json": "./src/data/colors.json",
|
|
40
|
+
"./package.json": "./package.json"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"bin",
|
|
44
|
+
"src",
|
|
45
|
+
"scripts",
|
|
46
|
+
"README.md",
|
|
47
|
+
"LICENSE"
|
|
48
|
+
],
|
|
49
|
+
"scripts": {
|
|
50
|
+
"test": "node --test \"test/*.test.mjs\"",
|
|
51
|
+
"build:colors": "node scripts/build-color-map.mjs"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@birdycom/omniacss": "^0.11.1",
|
|
55
|
+
"postcss": "^8.5.3"
|
|
56
|
+
},
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"access": "public"
|
|
59
|
+
},
|
|
60
|
+
"sideEffects": false
|
|
61
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// File: packages/migrate/scripts/build-color-map.mjs
|
|
2
|
+
// Build-time: maps every Tailwind default palette color to the nearest Omnia token (OKLab distance)
|
|
3
|
+
// and writes src/data/colors.json. Run: node packages/migrate/scripts/build-color-map.mjs
|
|
4
|
+
// Author: Serge Cools | Framework: OmniaCSS
|
|
5
|
+
|
|
6
|
+
import fs from "node:fs";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
import { nearestOmnia } from "../../../scripts/lib/omnia-color.mjs";
|
|
10
|
+
|
|
11
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const root = path.resolve(here, "../../..");
|
|
13
|
+
const { colors } = JSON.parse(fs.readFileSync(path.join(here, "tailwind-palette.json"), "utf8"));
|
|
14
|
+
|
|
15
|
+
/** oklch(L% C H) -> #rrggbb (gamut clipped). */
|
|
16
|
+
function oklchToHex(str) {
|
|
17
|
+
const [, L, C, H] = str.match(/oklch\(([\d.]+)% ([\d.]+) ([\d.]+)\)/).map(Number);
|
|
18
|
+
const l = L / 100, a = C * Math.cos((H * Math.PI) / 180), b = C * Math.sin((H * Math.PI) / 180);
|
|
19
|
+
const l_ = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3;
|
|
20
|
+
const m_ = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3;
|
|
21
|
+
const s_ = (l - 0.0894841775 * a - 1.291485548 * b) ** 3;
|
|
22
|
+
const lin = [4.0767416621 * l_ - 3.3077115913 * m_ + 0.2309699292 * s_, -1.2684380046 * l_ + 2.6097574011 * m_ - 0.3413193965 * s_, -0.0041960863 * l_ - 0.7034186147 * m_ + 1.707614701 * s_];
|
|
23
|
+
const enc = (v) => { v = Math.min(1, Math.max(0, v)); return Math.round((v <= 0.0031308 ? 12.92 * v : 1.055 * v ** (1 / 2.4) - 0.055) * 255); };
|
|
24
|
+
return "#" + lin.map((v) => enc(v).toString(16).padStart(2, "0")).join("");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const map = { black: "--color-black-100", white: "--color-white-100" };
|
|
28
|
+
for (const [name, value] of Object.entries(colors)) map[name] = nearestOmnia(oklchToHex(value), root).token;
|
|
29
|
+
const sorted = Object.fromEntries(Object.entries(map).sort(([a], [b]) => a.localeCompare(b, "en", { numeric: true })));
|
|
30
|
+
fs.writeFileSync(path.join(here, "../src/data/colors.json"), JSON.stringify(sorted, null, 1) + "\n");
|
|
31
|
+
console.log(`colors.json: ${Object.keys(sorted).length} entries`);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// File: packages/migrate/scripts/extract-palette.mjs
|
|
2
|
+
// One-off helper: re-extract the default palette (oklch) from an installed tailwindcss theme.css into tailwind-palette.json.
|
|
3
|
+
// Usage: node scripts/extract-palette.mjs <path/to/node_modules/tailwindcss/theme.css>
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const css = fs.readFileSync(process.argv[2], "utf8");
|
|
10
|
+
const colors = {};
|
|
11
|
+
for (const m of css.matchAll(/--color-([a-z]+-\d+):\s*oklch\(([\d.]+)%\s+([\d.]+)\s+(none|[\d.]+)\)/g)) colors[m[1]] = `oklch(${m[2]}% ${m[3]} ${m[4] === "none" ? 0 : m[4]})`;
|
|
12
|
+
fs.writeFileSync(path.join(here, "tailwind-palette.json"), JSON.stringify({ _note: "Tailwind default palette (oklch), input for build-color-map.mjs", colors }, null, 1));
|
|
13
|
+
console.log(Object.keys(colors).length, "colors");
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_note": "Tailwind default palette (oklch), input for build-color-map.mjs",
|
|
3
|
+
"colors": {
|
|
4
|
+
"red-50": "oklch(97.1% 0.013 17.38)",
|
|
5
|
+
"red-100": "oklch(93.6% 0.032 17.717)",
|
|
6
|
+
"red-200": "oklch(88.5% 0.062 18.334)",
|
|
7
|
+
"red-300": "oklch(80.8% 0.114 19.571)",
|
|
8
|
+
"red-400": "oklch(70.4% 0.191 22.216)",
|
|
9
|
+
"red-500": "oklch(63.7% 0.237 25.331)",
|
|
10
|
+
"red-600": "oklch(57.7% 0.245 27.325)",
|
|
11
|
+
"red-700": "oklch(50.5% 0.213 27.518)",
|
|
12
|
+
"red-800": "oklch(44.4% 0.177 26.899)",
|
|
13
|
+
"red-900": "oklch(39.6% 0.141 25.723)",
|
|
14
|
+
"red-950": "oklch(25.8% 0.092 26.042)",
|
|
15
|
+
"orange-50": "oklch(98% 0.016 73.684)",
|
|
16
|
+
"orange-100": "oklch(95.4% 0.038 75.164)",
|
|
17
|
+
"orange-200": "oklch(90.1% 0.076 70.697)",
|
|
18
|
+
"orange-300": "oklch(83.7% 0.128 66.29)",
|
|
19
|
+
"orange-400": "oklch(75% 0.183 55.934)",
|
|
20
|
+
"orange-500": "oklch(70.5% 0.213 47.604)",
|
|
21
|
+
"orange-600": "oklch(64.6% 0.222 41.116)",
|
|
22
|
+
"orange-700": "oklch(55.3% 0.195 38.402)",
|
|
23
|
+
"orange-800": "oklch(47% 0.157 37.304)",
|
|
24
|
+
"orange-900": "oklch(40.8% 0.123 38.172)",
|
|
25
|
+
"orange-950": "oklch(26.6% 0.079 36.259)",
|
|
26
|
+
"amber-50": "oklch(98.7% 0.022 95.277)",
|
|
27
|
+
"amber-100": "oklch(96.2% 0.059 95.617)",
|
|
28
|
+
"amber-200": "oklch(92.4% 0.12 95.746)",
|
|
29
|
+
"amber-300": "oklch(87.9% 0.169 91.605)",
|
|
30
|
+
"amber-400": "oklch(82.8% 0.189 84.429)",
|
|
31
|
+
"amber-500": "oklch(76.9% 0.188 70.08)",
|
|
32
|
+
"amber-600": "oklch(66.6% 0.179 58.318)",
|
|
33
|
+
"amber-700": "oklch(55.5% 0.163 48.998)",
|
|
34
|
+
"amber-800": "oklch(47.3% 0.137 46.201)",
|
|
35
|
+
"amber-900": "oklch(41.4% 0.112 45.904)",
|
|
36
|
+
"amber-950": "oklch(27.9% 0.077 45.635)",
|
|
37
|
+
"yellow-50": "oklch(98.7% 0.026 102.212)",
|
|
38
|
+
"yellow-100": "oklch(97.3% 0.071 103.193)",
|
|
39
|
+
"yellow-200": "oklch(94.5% 0.129 101.54)",
|
|
40
|
+
"yellow-300": "oklch(90.5% 0.182 98.111)",
|
|
41
|
+
"yellow-400": "oklch(85.2% 0.199 91.936)",
|
|
42
|
+
"yellow-500": "oklch(79.5% 0.184 86.047)",
|
|
43
|
+
"yellow-600": "oklch(68.1% 0.162 75.834)",
|
|
44
|
+
"yellow-700": "oklch(55.4% 0.135 66.442)",
|
|
45
|
+
"yellow-800": "oklch(47.6% 0.114 61.907)",
|
|
46
|
+
"yellow-900": "oklch(42.1% 0.095 57.708)",
|
|
47
|
+
"yellow-950": "oklch(28.6% 0.066 53.813)",
|
|
48
|
+
"lime-50": "oklch(98.6% 0.031 120.757)",
|
|
49
|
+
"lime-100": "oklch(96.7% 0.067 122.328)",
|
|
50
|
+
"lime-200": "oklch(93.8% 0.127 124.321)",
|
|
51
|
+
"lime-300": "oklch(89.7% 0.196 126.665)",
|
|
52
|
+
"lime-400": "oklch(84.1% 0.238 128.85)",
|
|
53
|
+
"lime-500": "oklch(76.8% 0.233 130.85)",
|
|
54
|
+
"lime-600": "oklch(64.8% 0.2 131.684)",
|
|
55
|
+
"lime-700": "oklch(53.2% 0.157 131.589)",
|
|
56
|
+
"lime-800": "oklch(45.3% 0.124 130.933)",
|
|
57
|
+
"lime-900": "oklch(40.5% 0.101 131.063)",
|
|
58
|
+
"lime-950": "oklch(27.4% 0.072 132.109)",
|
|
59
|
+
"green-50": "oklch(98.2% 0.018 155.826)",
|
|
60
|
+
"green-100": "oklch(96.2% 0.044 156.743)",
|
|
61
|
+
"green-200": "oklch(92.5% 0.084 155.995)",
|
|
62
|
+
"green-300": "oklch(87.1% 0.15 154.449)",
|
|
63
|
+
"green-400": "oklch(79.2% 0.209 151.711)",
|
|
64
|
+
"green-500": "oklch(72.3% 0.219 149.579)",
|
|
65
|
+
"green-600": "oklch(62.7% 0.194 149.214)",
|
|
66
|
+
"green-700": "oklch(52.7% 0.154 150.069)",
|
|
67
|
+
"green-800": "oklch(44.8% 0.119 151.328)",
|
|
68
|
+
"green-900": "oklch(39.3% 0.095 152.535)",
|
|
69
|
+
"green-950": "oklch(26.6% 0.065 152.934)",
|
|
70
|
+
"emerald-50": "oklch(97.9% 0.021 166.113)",
|
|
71
|
+
"emerald-100": "oklch(95% 0.052 163.051)",
|
|
72
|
+
"emerald-200": "oklch(90.5% 0.093 164.15)",
|
|
73
|
+
"emerald-300": "oklch(84.5% 0.143 164.978)",
|
|
74
|
+
"emerald-400": "oklch(76.5% 0.177 163.223)",
|
|
75
|
+
"emerald-500": "oklch(69.6% 0.17 162.48)",
|
|
76
|
+
"emerald-600": "oklch(59.6% 0.145 163.225)",
|
|
77
|
+
"emerald-700": "oklch(50.8% 0.118 165.612)",
|
|
78
|
+
"emerald-800": "oklch(43.2% 0.095 166.913)",
|
|
79
|
+
"emerald-900": "oklch(37.8% 0.077 168.94)",
|
|
80
|
+
"emerald-950": "oklch(26.2% 0.051 172.552)",
|
|
81
|
+
"teal-50": "oklch(98.4% 0.014 180.72)",
|
|
82
|
+
"teal-100": "oklch(95.3% 0.051 180.801)",
|
|
83
|
+
"teal-200": "oklch(91% 0.096 180.426)",
|
|
84
|
+
"teal-300": "oklch(85.5% 0.138 181.071)",
|
|
85
|
+
"teal-400": "oklch(77.7% 0.152 181.912)",
|
|
86
|
+
"teal-500": "oklch(70.4% 0.14 182.503)",
|
|
87
|
+
"teal-600": "oklch(60% 0.118 184.704)",
|
|
88
|
+
"teal-700": "oklch(51.1% 0.096 186.391)",
|
|
89
|
+
"teal-800": "oklch(43.7% 0.078 188.216)",
|
|
90
|
+
"teal-900": "oklch(38.6% 0.063 188.416)",
|
|
91
|
+
"teal-950": "oklch(27.7% 0.046 192.524)",
|
|
92
|
+
"cyan-50": "oklch(98.4% 0.019 200.873)",
|
|
93
|
+
"cyan-100": "oklch(95.6% 0.045 203.388)",
|
|
94
|
+
"cyan-200": "oklch(91.7% 0.08 205.041)",
|
|
95
|
+
"cyan-300": "oklch(86.5% 0.127 207.078)",
|
|
96
|
+
"cyan-400": "oklch(78.9% 0.154 211.53)",
|
|
97
|
+
"cyan-500": "oklch(71.5% 0.143 215.221)",
|
|
98
|
+
"cyan-600": "oklch(60.9% 0.126 221.723)",
|
|
99
|
+
"cyan-700": "oklch(52% 0.105 223.128)",
|
|
100
|
+
"cyan-800": "oklch(45% 0.085 224.283)",
|
|
101
|
+
"cyan-900": "oklch(39.8% 0.07 227.392)",
|
|
102
|
+
"cyan-950": "oklch(30.2% 0.056 229.695)",
|
|
103
|
+
"sky-50": "oklch(97.7% 0.013 236.62)",
|
|
104
|
+
"sky-100": "oklch(95.1% 0.026 236.824)",
|
|
105
|
+
"sky-200": "oklch(90.1% 0.058 230.902)",
|
|
106
|
+
"sky-300": "oklch(82.8% 0.111 230.318)",
|
|
107
|
+
"sky-400": "oklch(74.6% 0.16 232.661)",
|
|
108
|
+
"sky-500": "oklch(68.5% 0.169 237.323)",
|
|
109
|
+
"sky-600": "oklch(58.8% 0.158 241.966)",
|
|
110
|
+
"sky-700": "oklch(50% 0.134 242.749)",
|
|
111
|
+
"sky-800": "oklch(44.3% 0.11 240.79)",
|
|
112
|
+
"sky-900": "oklch(39.1% 0.09 240.876)",
|
|
113
|
+
"sky-950": "oklch(29.3% 0.066 243.157)",
|
|
114
|
+
"blue-50": "oklch(97% 0.014 254.604)",
|
|
115
|
+
"blue-100": "oklch(93.2% 0.032 255.585)",
|
|
116
|
+
"blue-200": "oklch(88.2% 0.059 254.128)",
|
|
117
|
+
"blue-300": "oklch(80.9% 0.105 251.813)",
|
|
118
|
+
"blue-400": "oklch(70.7% 0.165 254.624)",
|
|
119
|
+
"blue-500": "oklch(62.3% 0.214 259.815)",
|
|
120
|
+
"blue-600": "oklch(54.6% 0.245 262.881)",
|
|
121
|
+
"blue-700": "oklch(48.8% 0.243 264.376)",
|
|
122
|
+
"blue-800": "oklch(42.4% 0.199 265.638)",
|
|
123
|
+
"blue-900": "oklch(37.9% 0.146 265.522)",
|
|
124
|
+
"blue-950": "oklch(28.2% 0.091 267.935)",
|
|
125
|
+
"indigo-50": "oklch(96.2% 0.018 272.314)",
|
|
126
|
+
"indigo-100": "oklch(93% 0.034 272.788)",
|
|
127
|
+
"indigo-200": "oklch(87% 0.065 274.039)",
|
|
128
|
+
"indigo-300": "oklch(78.5% 0.115 274.713)",
|
|
129
|
+
"indigo-400": "oklch(67.3% 0.182 276.935)",
|
|
130
|
+
"indigo-500": "oklch(58.5% 0.233 277.117)",
|
|
131
|
+
"indigo-600": "oklch(51.1% 0.262 276.966)",
|
|
132
|
+
"indigo-700": "oklch(45.7% 0.24 277.023)",
|
|
133
|
+
"indigo-800": "oklch(39.8% 0.195 277.366)",
|
|
134
|
+
"indigo-900": "oklch(35.9% 0.144 278.697)",
|
|
135
|
+
"indigo-950": "oklch(25.7% 0.09 281.288)",
|
|
136
|
+
"violet-50": "oklch(96.9% 0.016 293.756)",
|
|
137
|
+
"violet-100": "oklch(94.3% 0.029 294.588)",
|
|
138
|
+
"violet-200": "oklch(89.4% 0.057 293.283)",
|
|
139
|
+
"violet-300": "oklch(81.1% 0.111 293.571)",
|
|
140
|
+
"violet-400": "oklch(70.2% 0.183 293.541)",
|
|
141
|
+
"violet-500": "oklch(60.6% 0.25 292.717)",
|
|
142
|
+
"violet-600": "oklch(54.1% 0.281 293.009)",
|
|
143
|
+
"violet-700": "oklch(49.1% 0.27 292.581)",
|
|
144
|
+
"violet-800": "oklch(43.2% 0.232 292.759)",
|
|
145
|
+
"violet-900": "oklch(38% 0.189 293.745)",
|
|
146
|
+
"violet-950": "oklch(28.3% 0.141 291.089)",
|
|
147
|
+
"purple-50": "oklch(97.7% 0.014 308.299)",
|
|
148
|
+
"purple-100": "oklch(94.6% 0.033 307.174)",
|
|
149
|
+
"purple-200": "oklch(90.2% 0.063 306.703)",
|
|
150
|
+
"purple-300": "oklch(82.7% 0.119 306.383)",
|
|
151
|
+
"purple-400": "oklch(71.4% 0.203 305.504)",
|
|
152
|
+
"purple-500": "oklch(62.7% 0.265 303.9)",
|
|
153
|
+
"purple-600": "oklch(55.8% 0.288 302.321)",
|
|
154
|
+
"purple-700": "oklch(49.6% 0.265 301.924)",
|
|
155
|
+
"purple-800": "oklch(43.8% 0.218 303.724)",
|
|
156
|
+
"purple-900": "oklch(38.1% 0.176 304.987)",
|
|
157
|
+
"purple-950": "oklch(29.1% 0.149 302.717)",
|
|
158
|
+
"fuchsia-50": "oklch(97.7% 0.017 320.058)",
|
|
159
|
+
"fuchsia-100": "oklch(95.2% 0.037 318.852)",
|
|
160
|
+
"fuchsia-200": "oklch(90.3% 0.076 319.62)",
|
|
161
|
+
"fuchsia-300": "oklch(83.3% 0.145 321.434)",
|
|
162
|
+
"fuchsia-400": "oklch(74% 0.238 322.16)",
|
|
163
|
+
"fuchsia-500": "oklch(66.7% 0.295 322.15)",
|
|
164
|
+
"fuchsia-600": "oklch(59.1% 0.293 322.896)",
|
|
165
|
+
"fuchsia-700": "oklch(51.8% 0.253 323.949)",
|
|
166
|
+
"fuchsia-800": "oklch(45.2% 0.211 324.591)",
|
|
167
|
+
"fuchsia-900": "oklch(40.1% 0.17 325.612)",
|
|
168
|
+
"fuchsia-950": "oklch(29.3% 0.136 325.661)",
|
|
169
|
+
"pink-50": "oklch(97.1% 0.014 343.198)",
|
|
170
|
+
"pink-100": "oklch(94.8% 0.028 342.258)",
|
|
171
|
+
"pink-200": "oklch(89.9% 0.061 343.231)",
|
|
172
|
+
"pink-300": "oklch(82.3% 0.12 346.018)",
|
|
173
|
+
"pink-400": "oklch(71.8% 0.202 349.761)",
|
|
174
|
+
"pink-500": "oklch(65.6% 0.241 354.308)",
|
|
175
|
+
"pink-600": "oklch(59.2% 0.249 0.584)",
|
|
176
|
+
"pink-700": "oklch(52.5% 0.223 3.958)",
|
|
177
|
+
"pink-800": "oklch(45.9% 0.187 3.815)",
|
|
178
|
+
"pink-900": "oklch(40.8% 0.153 2.432)",
|
|
179
|
+
"pink-950": "oklch(28.4% 0.109 3.907)",
|
|
180
|
+
"rose-50": "oklch(96.9% 0.015 12.422)",
|
|
181
|
+
"rose-100": "oklch(94.1% 0.03 12.58)",
|
|
182
|
+
"rose-200": "oklch(89.2% 0.058 10.001)",
|
|
183
|
+
"rose-300": "oklch(81% 0.117 11.638)",
|
|
184
|
+
"rose-400": "oklch(71.2% 0.194 13.428)",
|
|
185
|
+
"rose-500": "oklch(64.5% 0.246 16.439)",
|
|
186
|
+
"rose-600": "oklch(58.6% 0.253 17.585)",
|
|
187
|
+
"rose-700": "oklch(51.4% 0.222 16.935)",
|
|
188
|
+
"rose-800": "oklch(45.5% 0.188 13.697)",
|
|
189
|
+
"rose-900": "oklch(41% 0.159 10.272)",
|
|
190
|
+
"rose-950": "oklch(27.1% 0.105 12.094)",
|
|
191
|
+
"slate-50": "oklch(98.4% 0.003 247.858)",
|
|
192
|
+
"slate-100": "oklch(96.8% 0.007 247.896)",
|
|
193
|
+
"slate-200": "oklch(92.9% 0.013 255.508)",
|
|
194
|
+
"slate-300": "oklch(86.9% 0.022 252.894)",
|
|
195
|
+
"slate-400": "oklch(70.4% 0.04 256.788)",
|
|
196
|
+
"slate-500": "oklch(55.4% 0.046 257.417)",
|
|
197
|
+
"slate-600": "oklch(44.6% 0.043 257.281)",
|
|
198
|
+
"slate-700": "oklch(37.2% 0.044 257.287)",
|
|
199
|
+
"slate-800": "oklch(27.9% 0.041 260.031)",
|
|
200
|
+
"slate-900": "oklch(20.8% 0.042 265.755)",
|
|
201
|
+
"slate-950": "oklch(12.9% 0.042 264.695)",
|
|
202
|
+
"gray-50": "oklch(98.5% 0.002 247.839)",
|
|
203
|
+
"gray-100": "oklch(96.7% 0.003 264.542)",
|
|
204
|
+
"gray-200": "oklch(92.8% 0.006 264.531)",
|
|
205
|
+
"gray-300": "oklch(87.2% 0.01 258.338)",
|
|
206
|
+
"gray-400": "oklch(70.7% 0.022 261.325)",
|
|
207
|
+
"gray-500": "oklch(55.1% 0.027 264.364)",
|
|
208
|
+
"gray-600": "oklch(44.6% 0.03 256.802)",
|
|
209
|
+
"gray-700": "oklch(37.3% 0.034 259.733)",
|
|
210
|
+
"gray-800": "oklch(27.8% 0.033 256.848)",
|
|
211
|
+
"gray-900": "oklch(21% 0.034 264.665)",
|
|
212
|
+
"gray-950": "oklch(13% 0.028 261.692)",
|
|
213
|
+
"zinc-50": "oklch(98.5% 0 0)",
|
|
214
|
+
"zinc-100": "oklch(96.7% 0.001 286.375)",
|
|
215
|
+
"zinc-200": "oklch(92% 0.004 286.32)",
|
|
216
|
+
"zinc-300": "oklch(87.1% 0.006 286.286)",
|
|
217
|
+
"zinc-400": "oklch(70.5% 0.015 286.067)",
|
|
218
|
+
"zinc-500": "oklch(55.2% 0.016 285.938)",
|
|
219
|
+
"zinc-600": "oklch(44.2% 0.017 285.786)",
|
|
220
|
+
"zinc-700": "oklch(37% 0.013 285.805)",
|
|
221
|
+
"zinc-800": "oklch(27.4% 0.006 286.033)",
|
|
222
|
+
"zinc-900": "oklch(21% 0.006 285.885)",
|
|
223
|
+
"zinc-950": "oklch(14.1% 0.005 285.823)",
|
|
224
|
+
"neutral-50": "oklch(98.5% 0 0)",
|
|
225
|
+
"neutral-100": "oklch(97% 0 0)",
|
|
226
|
+
"neutral-200": "oklch(92.2% 0 0)",
|
|
227
|
+
"neutral-300": "oklch(87% 0 0)",
|
|
228
|
+
"neutral-400": "oklch(70.8% 0 0)",
|
|
229
|
+
"neutral-500": "oklch(55.6% 0 0)",
|
|
230
|
+
"neutral-600": "oklch(43.9% 0 0)",
|
|
231
|
+
"neutral-700": "oklch(37.1% 0 0)",
|
|
232
|
+
"neutral-800": "oklch(26.9% 0 0)",
|
|
233
|
+
"neutral-900": "oklch(20.5% 0 0)",
|
|
234
|
+
"neutral-950": "oklch(14.5% 0 0)",
|
|
235
|
+
"stone-50": "oklch(98.5% 0.001 106.423)",
|
|
236
|
+
"stone-100": "oklch(97% 0.001 106.424)",
|
|
237
|
+
"stone-200": "oklch(92.3% 0.003 48.717)",
|
|
238
|
+
"stone-300": "oklch(86.9% 0.005 56.366)",
|
|
239
|
+
"stone-400": "oklch(70.9% 0.01 56.259)",
|
|
240
|
+
"stone-500": "oklch(55.3% 0.013 58.071)",
|
|
241
|
+
"stone-600": "oklch(44.4% 0.011 73.639)",
|
|
242
|
+
"stone-700": "oklch(37.4% 0.01 67.558)",
|
|
243
|
+
"stone-800": "oklch(26.8% 0.007 34.298)",
|
|
244
|
+
"stone-900": "oklch(21.6% 0.006 56.043)",
|
|
245
|
+
"stone-950": "oklch(14.7% 0.004 49.25)",
|
|
246
|
+
"mauve-50": "oklch(98.5% 0 0)",
|
|
247
|
+
"mauve-100": "oklch(96% 0.003 325.6)",
|
|
248
|
+
"mauve-200": "oklch(92.2% 0.005 325.62)",
|
|
249
|
+
"mauve-300": "oklch(86.5% 0.012 325.68)",
|
|
250
|
+
"mauve-400": "oklch(71.1% 0.019 323.02)",
|
|
251
|
+
"mauve-500": "oklch(54.2% 0.034 322.5)",
|
|
252
|
+
"mauve-600": "oklch(43.5% 0.029 321.78)",
|
|
253
|
+
"mauve-700": "oklch(36.4% 0.029 323.89)",
|
|
254
|
+
"mauve-800": "oklch(26.3% 0.024 320.12)",
|
|
255
|
+
"mauve-900": "oklch(21.2% 0.019 322.12)",
|
|
256
|
+
"mauve-950": "oklch(14.5% 0.008 326)",
|
|
257
|
+
"olive-50": "oklch(98.8% 0.003 106.5)",
|
|
258
|
+
"olive-100": "oklch(96.6% 0.005 106.5)",
|
|
259
|
+
"olive-200": "oklch(93% 0.007 106.5)",
|
|
260
|
+
"olive-300": "oklch(88% 0.011 106.6)",
|
|
261
|
+
"olive-400": "oklch(73.7% 0.021 106.9)",
|
|
262
|
+
"olive-500": "oklch(58% 0.031 107.3)",
|
|
263
|
+
"olive-600": "oklch(46.6% 0.025 107.3)",
|
|
264
|
+
"olive-700": "oklch(39.4% 0.023 107.4)",
|
|
265
|
+
"olive-800": "oklch(28.6% 0.016 107.4)",
|
|
266
|
+
"olive-900": "oklch(22.8% 0.013 107.4)",
|
|
267
|
+
"olive-950": "oklch(15.3% 0.006 107.1)",
|
|
268
|
+
"mist-50": "oklch(98.7% 0.002 197.1)",
|
|
269
|
+
"mist-100": "oklch(96.3% 0.002 197.1)",
|
|
270
|
+
"mist-200": "oklch(92.5% 0.005 214.3)",
|
|
271
|
+
"mist-300": "oklch(87.2% 0.007 219.6)",
|
|
272
|
+
"mist-400": "oklch(72.3% 0.014 214.4)",
|
|
273
|
+
"mist-500": "oklch(56% 0.021 213.5)",
|
|
274
|
+
"mist-600": "oklch(45% 0.017 213.2)",
|
|
275
|
+
"mist-700": "oklch(37.8% 0.015 216)",
|
|
276
|
+
"mist-800": "oklch(27.5% 0.011 216.9)",
|
|
277
|
+
"mist-900": "oklch(21.8% 0.008 223.9)",
|
|
278
|
+
"mist-950": "oklch(14.8% 0.004 228.8)",
|
|
279
|
+
"taupe-50": "oklch(98.6% 0.002 67.8)",
|
|
280
|
+
"taupe-100": "oklch(96% 0.002 17.2)",
|
|
281
|
+
"taupe-200": "oklch(92.2% 0.005 34.3)",
|
|
282
|
+
"taupe-300": "oklch(86.8% 0.007 39.5)",
|
|
283
|
+
"taupe-400": "oklch(71.4% 0.014 41.2)",
|
|
284
|
+
"taupe-500": "oklch(54.7% 0.021 43.1)",
|
|
285
|
+
"taupe-600": "oklch(43.8% 0.017 39.3)",
|
|
286
|
+
"taupe-700": "oklch(36.7% 0.016 35.7)",
|
|
287
|
+
"taupe-800": "oklch(26.8% 0.011 36.5)",
|
|
288
|
+
"taupe-900": "oklch(21.4% 0.009 43.1)",
|
|
289
|
+
"taupe-950": "oklch(14.7% 0.004 49.3)"
|
|
290
|
+
}
|
|
291
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// File: packages/migrate/src/bootstrap/compat.mjs
|
|
2
|
+
// The small stylesheet that keeps the Bootstrap grid (container, row, col-*, offset-*, g-*, row-cols-*) and the few
|
|
3
|
+
// utilities without an OmniaCSS twin working, for exactly the classes a project uses. Colors are Omnia tokens.
|
|
4
|
+
// Map: media query per breakpoint -> grid rule per class -> utility rule per class -> sorted CSS
|
|
5
|
+
// Author: Serge Cools | Framework: OmniaCSS
|
|
6
|
+
|
|
7
|
+
import { BREAKPOINTS, CONTAINERS, OMNIA_BREAKPOINTS, utilityDecls } from "./rules.mjs";
|
|
8
|
+
import { bpVariant } from "./convert.mjs";
|
|
9
|
+
|
|
10
|
+
const SPACE = { 0: "0", 1: "0.25rem", 2: "0.5rem", 3: "1rem", 4: "1.5rem", 5: "3rem" };
|
|
11
|
+
const pct = (n, of) => `${+((n / of) * 100).toFixed(6)}%`;
|
|
12
|
+
|
|
13
|
+
/** min-width in rem for a Bootstrap breakpoint, following the chosen breakpoint mode. */
|
|
14
|
+
function minRem(bp, version, mode) {
|
|
15
|
+
const px = BREAKPOINTS[version][bp];
|
|
16
|
+
if (!px) return 0;
|
|
17
|
+
if (mode === "exact") return px / 16;
|
|
18
|
+
return OMNIA_BREAKPOINTS[bpVariant(bp, version, mode).slice(0, -1)] / 16;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param {Iterable<string>} gridClasses grid classes found in the project
|
|
23
|
+
* @param {Iterable<string>} utilityClasses utilities without an OmniaCSS twin
|
|
24
|
+
* @param {{ version: 3|4|5, breakpoints?: "omnia"|"exact" }} o
|
|
25
|
+
*/
|
|
26
|
+
export function compatCss(gridClasses, utilityClasses, { version: v, breakpoints: mode = "omnia" }) {
|
|
27
|
+
const rules = []; // { at: rem, css }
|
|
28
|
+
const add = (at, css) => rules.push({ at, css });
|
|
29
|
+
const gutter = v === 3 ? "30px" : "1.5rem";
|
|
30
|
+
const grid = new Set(gridClasses);
|
|
31
|
+
let m;
|
|
32
|
+
|
|
33
|
+
if ([...grid].some((c) => c.startsWith("container"))) {
|
|
34
|
+
const list = [...grid].filter((c) => c.startsWith("container"));
|
|
35
|
+
add(0, `${list.map((c) => "." + c).join(", ")} {\n width: 100%;\n margin-inline: auto;\n padding-inline: calc(${gutter} * 0.5);\n max-width: none;\n}`);
|
|
36
|
+
for (const [bp, max] of Object.entries(CONTAINERS[v])) {
|
|
37
|
+
const sel = list.filter((c) => c === "container" || (/^container-(sm|md|lg|xl|xxl)$/.test(c) && BREAKPOINTS[v][c.slice(10)] <= BREAKPOINTS[v][bp]));
|
|
38
|
+
if (sel.length) add(minRem(bp, v, mode), `${sel.map((c) => "." + c).join(", ")} { max-width: ${max}px; }`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (grid.has("row") || [...grid].some((c) => /^(col|offset|g|row-cols)/.test(c))) {
|
|
42
|
+
add(0, `.row {\n --oc-gutter-x: ${gutter};\n --oc-gutter-y: 0;\n display: flex;\n flex-wrap: wrap;\n margin-top: calc(-1 * var(--oc-gutter-y));\n margin-inline: calc(-0.5 * var(--oc-gutter-x));\n}\n.row > * {\n flex-shrink: 0;\n width: 100%;\n max-width: 100%;\n padding-inline: calc(var(--oc-gutter-x) * 0.5);\n margin-top: var(--oc-gutter-y);\n}`);
|
|
43
|
+
}
|
|
44
|
+
for (const c of grid) {
|
|
45
|
+
// col, col-md, col-auto, col-md-auto
|
|
46
|
+
if ((m = c.match(/^col(?:-(sm|md|lg|xl|xxl))?$/))) add(minRem(m[1], v, mode), `.${c} { flex: 1 0 0%; }`);
|
|
47
|
+
else if ((m = c.match(/^col(?:-(sm|md|lg|xl|xxl))?-auto$/))) add(minRem(m[1], v, mode), `.${c} { flex: 0 0 auto; width: auto; }`);
|
|
48
|
+
else if ((m = c.match(/^col(?:-(xs|sm|md|lg|xl|xxl))?-(\d{1,2})$/))) add(m[1] === "xs" ? 0 : minRem(m[1], v, mode), `.${c} { flex: 0 0 auto; width: ${pct(+m[2], 12)}; }`);
|
|
49
|
+
else if ((m = c.match(/^offset(?:-(sm|md|lg|xl|xxl))?-(\d{1,2})$/)) || (m = c.match(/^col-(xs|sm|md|lg)-offset-(\d{1,2})$/))) add(m[1] === "xs" ? 0 : minRem(m[1], v, mode), `.${c} { margin-left: ${+m[2] ? pct(+m[2], 12) : "0"}; }`);
|
|
50
|
+
else if ((m = c.match(/^col-(xs|sm|md|lg)-(push|pull)-(\d{1,2})$/))) add(m[1] === "xs" ? 0 : minRem(m[1], v, mode), `.${c} { position: relative; ${m[2] === "push" ? "left" : "right"}: ${pct(+m[3], 12)}; }`);
|
|
51
|
+
else if ((m = c.match(/^row-cols(?:-(sm|md|lg|xl|xxl))?-(\d|auto)$/))) add(minRem(m[1], v, mode), `.${c} > * { flex: 0 0 auto; width: ${m[2] === "auto" ? "auto" : pct(1, +m[2])}; }`);
|
|
52
|
+
else if ((m = c.match(/^g([xy]?)(?:-(sm|md|lg|xl|xxl))?-([0-5])$/))) {
|
|
53
|
+
const vars = m[1] === "x" ? ["x"] : m[1] === "y" ? ["y"] : ["x", "y"];
|
|
54
|
+
add(minRem(m[2], v, mode), `.${c} { ${vars.map((a) => `--oc-gutter-${a}: ${SPACE[m[3]]};`).join(" ")} }`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
for (const c of utilityClasses) {
|
|
58
|
+
let base = c, at = 0;
|
|
59
|
+
if ((m = c.match(/^([a-z]+(?:-[a-z]+)*?)-(sm|md|lg|xl|xxl)-(.+)$/)) && BREAKPOINTS[v][m[2]]) { base = `${m[1]}-${m[3]}`; at = minRem(m[2], v, mode); }
|
|
60
|
+
const groups = utilityDecls(base, v);
|
|
61
|
+
if (groups) add(at, `.${c} { ${groups.flat().map((x) => x.replace(":", ": ") + ";").join(" ")} }`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const byAt = new Map();
|
|
65
|
+
for (const r of rules) byAt.set(r.at, [...(byAt.get(r.at) || []), r.css]);
|
|
66
|
+
const out = [`/* Bootstrap ${v} compat for OmniaCSS — generated by omniacss-migrate (breakpoints: ${mode}).\n Only the grid and the utilities without an OmniaCSS equivalent that this project uses. */`];
|
|
67
|
+
for (const at of [...byAt.keys()].sort((a, b) => a - b)) {
|
|
68
|
+
const body = byAt.get(at).join("\n");
|
|
69
|
+
out.push(at ? `@media (min-width: ${at}rem) {\n${body.replace(/^/gm, " ")}\n}` : body);
|
|
70
|
+
}
|
|
71
|
+
return out.join("\n\n") + "\n";
|
|
72
|
+
}
|