@birdycom/omniacss-cli 0.11.1 → 0.11.2
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/README.md +8 -0
- package/bin/omniacss.mjs +7 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,6 +10,14 @@ npx omniacss migrate scan # Tailwind CSS -> OmniaCSS (needs @birdycom
|
|
|
10
10
|
|
|
11
11
|
Options: `-c/--content <glob>`, `-o/--output <file>`, `--no-components`, `--no-layer`. Node.js 22+. MIT
|
|
12
12
|
|
|
13
|
+
The build scans your files for literal class names. A class you put together in code, such as
|
|
14
|
+
`'oc-icon-tile--'.$size` in PHP or `` `text-${color}` `` in JavaScript, is not found and gets left out. Write the
|
|
15
|
+
full names somewhere, or list them under `keep` in `omnia.config.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{ "keep": ["oc-icon-tile--sm", "oc-icon-tile--lg", "oc-icon-tile--xl"] }
|
|
19
|
+
```
|
|
20
|
+
|
|
13
21
|
## Theme tokens for desktop apps
|
|
14
22
|
|
|
15
23
|
Native toolkits have no CSS engine. `omniacss tokens` writes the theme tokens resolved per mode (light/dark),
|
package/bin/omniacss.mjs
CHANGED
|
@@ -122,6 +122,12 @@ async function omniauiCss(config) {
|
|
|
122
122
|
return css;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
// Browsers for --minify. Without targets lightningcss folds animation-timeline into the animation shorthand,
|
|
126
|
+
// which Chrome rejects (the whole declaration drops, so scroll-driven animations stop). These versions are
|
|
127
|
+
// new enough that nothing (light-dark(), nesting, oklch) gets lowered.
|
|
128
|
+
const v = (major, minor = 0) => (major << 16) | (minor << 8);
|
|
129
|
+
const MINIFY_TARGETS = { chrome: v(123), edge: v(123), firefox: v(120), safari: v(17, 5), ios_saf: v(17, 5) };
|
|
130
|
+
|
|
125
131
|
async function cmdBuild(flags) {
|
|
126
132
|
const config = await loadConfig(flags);
|
|
127
133
|
const engine = await import(pathToFileURL(resolvePkg("@birdycom/omniacss/engine")).href);
|
|
@@ -134,7 +140,7 @@ async function cmdBuild(flags) {
|
|
|
134
140
|
let css = engine.generate(full, candidates, { layer: config.layer, keep: config.keep });
|
|
135
141
|
if (config.minify) {
|
|
136
142
|
const { transform } = await import("lightningcss");
|
|
137
|
-
css = transform({ filename: config.output, code: Buffer.from(css), minify: true }).code.toString();
|
|
143
|
+
css = transform({ filename: config.output, code: Buffer.from(css), minify: true, targets: MINIFY_TARGETS }).code.toString();
|
|
138
144
|
}
|
|
139
145
|
const out = path.resolve(cwd, config.output);
|
|
140
146
|
await fs.mkdir(path.dirname(out), { recursive: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@birdycom/omniacss-cli",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "OmniaCSS command line: init a project, build on-demand CSS, migrate from Tailwind CSS. Components and blocks: see the omniaui CLI in @birdycom/omniaui.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"LICENSE"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@birdycom/omniacss": "^0.11.
|
|
35
|
+
"@birdycom/omniacss": "^0.11.2",
|
|
36
36
|
"lightningcss": "^1.33.0"
|
|
37
37
|
},
|
|
38
38
|
"sideEffects": false,
|