@bamboocss/generator 1.62.1 → 1.63.0
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/index.cjs +15 -13
- package/dist/index.mjs +15 -13
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -279,12 +279,13 @@ function generateCvaFn(ctx) {
|
|
|
279
279
|
* The two could not be reconciled by teaching the matcher to read hashed names: under
|
|
280
280
|
* `hash: true` a class is an opaque digest with no property to compare.
|
|
281
281
|
*
|
|
282
|
-
* So precedence is decided where it can be decided the same way everywhere: by
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
282
|
+
* So precedence is decided where it can be decided the same way everywhere: by the compiler,
|
|
283
|
+
* which merges every Bamboo style a `cx()` call holds before a class exists, later arguments
|
|
284
|
+
* winning. What reaches this join at runtime is only what the compiler could not see — a class
|
|
285
|
+
* passed in, or one assembled at runtime — and no
|
|
286
|
+
* {@link https://bamboocss.com/docs/concepts/cascade-layers cascade layer} ranks it above the
|
|
287
|
+
* styles it is joined with: recipes compile to the same `utilities` atoms as `css()`, and the
|
|
288
|
+
* named `recipes` layer is not emitted. An override a caller chooses belongs in a recipe variant.
|
|
288
289
|
*/
|
|
289
290
|
const declaration = outdent.default`
|
|
290
291
|
type Argument = string | boolean | null | undefined | Argument[]
|
|
@@ -292,14 +293,15 @@ const declaration = outdent.default`
|
|
|
292
293
|
/**
|
|
293
294
|
* Join classNames into a single string.
|
|
294
295
|
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
296
|
+
* Bamboo styles passed here — a \`css()\` call, a recipe, or a binding holding either — are
|
|
297
|
+
* merged by the compiler before any class exists, later arguments winning:
|
|
298
|
+
* \`cx(css({ paddingX: '4' }), css({ paddingX: '2' }))\` compiles to the one class for
|
|
299
|
+
* \`paddingX: '2'\`.
|
|
298
300
|
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
*
|
|
301
|
+
* Anything else is only joined, such as a \`className\` prop or a class assembled at runtime, and
|
|
302
|
+
* the join does **not** resolve conflicts: recipes and \`css()\` share one cascade layer, so where
|
|
303
|
+
* such a class sets a property these styles set too, the browser picks by stylesheet order rather
|
|
304
|
+
* than by the order you passed them. For an override a caller chooses, expose a recipe variant.
|
|
303
305
|
*/
|
|
304
306
|
export declare function cx(...args: Argument[]): string
|
|
305
307
|
|
package/dist/index.mjs
CHANGED
|
@@ -253,12 +253,13 @@ function generateCvaFn(ctx) {
|
|
|
253
253
|
* The two could not be reconciled by teaching the matcher to read hashed names: under
|
|
254
254
|
* `hash: true` a class is an opaque digest with no property to compare.
|
|
255
255
|
*
|
|
256
|
-
* So precedence is decided where it can be decided the same way everywhere: by
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
256
|
+
* So precedence is decided where it can be decided the same way everywhere: by the compiler,
|
|
257
|
+
* which merges every Bamboo style a `cx()` call holds before a class exists, later arguments
|
|
258
|
+
* winning. What reaches this join at runtime is only what the compiler could not see — a class
|
|
259
|
+
* passed in, or one assembled at runtime — and no
|
|
260
|
+
* {@link https://bamboocss.com/docs/concepts/cascade-layers cascade layer} ranks it above the
|
|
261
|
+
* styles it is joined with: recipes compile to the same `utilities` atoms as `css()`, and the
|
|
262
|
+
* named `recipes` layer is not emitted. An override a caller chooses belongs in a recipe variant.
|
|
262
263
|
*/
|
|
263
264
|
const declaration = outdent$1`
|
|
264
265
|
type Argument = string | boolean | null | undefined | Argument[]
|
|
@@ -266,14 +267,15 @@ const declaration = outdent$1`
|
|
|
266
267
|
/**
|
|
267
268
|
* Join classNames into a single string.
|
|
268
269
|
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
270
|
+
* Bamboo styles passed here — a \`css()\` call, a recipe, or a binding holding either — are
|
|
271
|
+
* merged by the compiler before any class exists, later arguments winning:
|
|
272
|
+
* \`cx(css({ paddingX: '4' }), css({ paddingX: '2' }))\` compiles to the one class for
|
|
273
|
+
* \`paddingX: '2'\`.
|
|
272
274
|
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
275
|
+
* Anything else is only joined, such as a \`className\` prop or a class assembled at runtime, and
|
|
276
|
+
* the join does **not** resolve conflicts: recipes and \`css()\` share one cascade layer, so where
|
|
277
|
+
* such a class sets a property these styles set too, the browser picks by stylesheet order rather
|
|
278
|
+
* than by the order you passed them. For an override a caller chooses, expose a recipe variant.
|
|
277
279
|
*/
|
|
278
280
|
export declare function cx(...args: Argument[]): string
|
|
279
281
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bamboocss/generator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.63.0",
|
|
4
4
|
"description": "The css generator for css bamboo",
|
|
5
5
|
"homepage": "https://bamboocss.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"pluralize": "8.0.0",
|
|
39
39
|
"postcss": "8.5.26",
|
|
40
40
|
"ts-pattern": "5.9.0",
|
|
41
|
-
"@bamboocss/core": "1.
|
|
42
|
-
"@bamboocss/is-valid-prop": "^1.
|
|
43
|
-
"@bamboocss/logger": "1.
|
|
44
|
-
"@bamboocss/shared": "1.
|
|
45
|
-
"@bamboocss/token-dictionary": "1.
|
|
46
|
-
"@bamboocss/types": "1.
|
|
41
|
+
"@bamboocss/core": "1.63.0",
|
|
42
|
+
"@bamboocss/is-valid-prop": "^1.63.0",
|
|
43
|
+
"@bamboocss/logger": "1.63.0",
|
|
44
|
+
"@bamboocss/shared": "1.63.0",
|
|
45
|
+
"@bamboocss/token-dictionary": "1.63.0",
|
|
46
|
+
"@bamboocss/types": "1.63.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/pluralize": "0.0.33"
|