chaincss 2.4.1 → 2.4.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/dist/browser.js +6 -4
- package/dist/cli/index.js +5 -1
- package/dist/compiler/index.js +11 -5
- package/dist/index.js +11 -5
- package/dist/plugins/vite-chain.d.ts +2 -0
- package/dist/plugins/vite.d.ts +0 -8
- package/dist/plugins/vite.js +30 -3024
- package/dist/runtime/index.js +11 -5
- package/package.json +1 -1
- package/src/compiler/shorthands.ts +6 -4
- package/src/core/style-compiler.ts +6 -1
- package/src/plugins/vite-chain.ts +0 -0
- package/src/plugins/vite.ts +27 -418
package/dist/browser.js
CHANGED
|
@@ -254,16 +254,18 @@ var macros = {
|
|
|
254
254
|
relative: (v, c) => handlePosition("relative", v, c),
|
|
255
255
|
// --- Shapes & Content ---
|
|
256
256
|
circle: (v, c) => {
|
|
257
|
-
|
|
258
|
-
c.
|
|
257
|
+
const val = typeof v === "number" ? `${v}px` : v;
|
|
258
|
+
c.width = val;
|
|
259
|
+
c.height = val;
|
|
259
260
|
c.borderRadius = "50%";
|
|
260
261
|
c.display = "flex";
|
|
261
262
|
c.alignItems = "center";
|
|
262
263
|
c.justifyContent = "center";
|
|
263
264
|
},
|
|
264
265
|
square: (v, c) => {
|
|
265
|
-
|
|
266
|
-
c.
|
|
266
|
+
const val = typeof v === "number" ? `${v}px` : v;
|
|
267
|
+
c.width = val;
|
|
268
|
+
c.height = val;
|
|
267
269
|
c.display = "flex";
|
|
268
270
|
c.alignItems = "center";
|
|
269
271
|
c.justifyContent = "center";
|
package/dist/cli/index.js
CHANGED
|
@@ -320,7 +320,11 @@ function compileDeclarations(properties, indent, options) {
|
|
|
320
320
|
continue;
|
|
321
321
|
}
|
|
322
322
|
const cssProp = camelToKebab(prop);
|
|
323
|
-
|
|
323
|
+
let finalValue = value;
|
|
324
|
+
if (typeof value === "number" && ["width", "height", "min-width", "max-width", "min-height", "max-height"].includes(cssProp)) {
|
|
325
|
+
finalValue = value + "px";
|
|
326
|
+
}
|
|
327
|
+
lines.push(`${indent}${cssProp}: ${finalValue};`);
|
|
324
328
|
}
|
|
325
329
|
return lines;
|
|
326
330
|
}
|
package/dist/compiler/index.js
CHANGED
|
@@ -278,16 +278,18 @@ var macros = {
|
|
|
278
278
|
relative: (v, c) => handlePosition("relative", v, c),
|
|
279
279
|
// --- Shapes & Content ---
|
|
280
280
|
circle: (v, c) => {
|
|
281
|
-
|
|
282
|
-
c.
|
|
281
|
+
const val = typeof v === "number" ? `${v}px` : v;
|
|
282
|
+
c.width = val;
|
|
283
|
+
c.height = val;
|
|
283
284
|
c.borderRadius = "50%";
|
|
284
285
|
c.display = "flex";
|
|
285
286
|
c.alignItems = "center";
|
|
286
287
|
c.justifyContent = "center";
|
|
287
288
|
},
|
|
288
289
|
square: (v, c) => {
|
|
289
|
-
|
|
290
|
-
c.
|
|
290
|
+
const val = typeof v === "number" ? `${v}px` : v;
|
|
291
|
+
c.width = val;
|
|
292
|
+
c.height = val;
|
|
291
293
|
c.display = "flex";
|
|
292
294
|
c.alignItems = "center";
|
|
293
295
|
c.justifyContent = "center";
|
|
@@ -1636,7 +1638,11 @@ function compileDeclarations(properties, indent, options) {
|
|
|
1636
1638
|
continue;
|
|
1637
1639
|
}
|
|
1638
1640
|
const cssProp = camelToKebab(prop);
|
|
1639
|
-
|
|
1641
|
+
let finalValue = value;
|
|
1642
|
+
if (typeof value === "number" && ["width", "height", "min-width", "max-width", "min-height", "max-height"].includes(cssProp)) {
|
|
1643
|
+
finalValue = value + "px";
|
|
1644
|
+
}
|
|
1645
|
+
lines.push(`${indent}${cssProp}: ${finalValue};`);
|
|
1640
1646
|
}
|
|
1641
1647
|
return lines;
|
|
1642
1648
|
}
|
package/dist/index.js
CHANGED
|
@@ -237,16 +237,18 @@ var macros = {
|
|
|
237
237
|
relative: (v, c) => handlePosition("relative", v, c),
|
|
238
238
|
// --- Shapes & Content ---
|
|
239
239
|
circle: (v, c) => {
|
|
240
|
-
|
|
241
|
-
c.
|
|
240
|
+
const val = typeof v === "number" ? `${v}px` : v;
|
|
241
|
+
c.width = val;
|
|
242
|
+
c.height = val;
|
|
242
243
|
c.borderRadius = "50%";
|
|
243
244
|
c.display = "flex";
|
|
244
245
|
c.alignItems = "center";
|
|
245
246
|
c.justifyContent = "center";
|
|
246
247
|
},
|
|
247
248
|
square: (v, c) => {
|
|
248
|
-
|
|
249
|
-
c.
|
|
249
|
+
const val = typeof v === "number" ? `${v}px` : v;
|
|
250
|
+
c.width = val;
|
|
251
|
+
c.height = val;
|
|
250
252
|
c.display = "flex";
|
|
251
253
|
c.alignItems = "center";
|
|
252
254
|
c.justifyContent = "center";
|
|
@@ -1569,7 +1571,11 @@ function compileDeclarations(properties, indent, options) {
|
|
|
1569
1571
|
continue;
|
|
1570
1572
|
}
|
|
1571
1573
|
const cssProp = camelToKebab(prop);
|
|
1572
|
-
|
|
1574
|
+
let finalValue = value;
|
|
1575
|
+
if (typeof value === "number" && ["width", "height", "min-width", "max-width", "min-height", "max-height"].includes(cssProp)) {
|
|
1576
|
+
finalValue = value + "px";
|
|
1577
|
+
}
|
|
1578
|
+
lines.push(`${indent}${cssProp}: ${finalValue};`);
|
|
1573
1579
|
}
|
|
1574
1580
|
return lines;
|
|
1575
1581
|
}
|
package/dist/plugins/vite.d.ts
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
2
|
export interface ChainCSSPluginOptions {
|
|
3
|
-
atomic?: boolean;
|
|
4
|
-
minify?: boolean;
|
|
5
3
|
verbose?: boolean;
|
|
6
|
-
hmr?: boolean;
|
|
7
|
-
injectGlobal?: boolean;
|
|
8
|
-
cssOutput?: string;
|
|
9
|
-
manifestOutput?: string;
|
|
10
|
-
include?: string[];
|
|
11
|
-
exclude?: string[];
|
|
12
4
|
}
|
|
13
5
|
export default function chaincssPlugin(options?: ChainCSSPluginOptions): Plugin;
|