@bamboocss/generator 1.62.0 → 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 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
- * {@link https://bamboocss.com/docs/concepts/cascade-layers cascade layers}. A component
284
- * whose styles a consumer will override belongs in `recipes` — write it with `cva`/`sva`,
285
- * not bare `css()` — and the consumer's `css()` in `utilities` wins by layer, in every
286
- * build. Two `css()` outputs joined with `cx` are in the same layer and resolve by source
287
- * order; when you own both, merge the style objects with `css(a, b)` instead.
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
- * This does **not** resolve conflicts between them: \`cx('px_4', 'px_2')\` keeps both, and
296
- * the browser picks by their order in the stylesheet rather than by the order you passed
297
- * them. That is true of every build — atomic, hashed and grouped alike.
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
- * To override a style rather than append to it, let the cascade decide: styles from
300
- * \`cva\`/\`sva\` sit in the \`recipes\` layer and \`css()\` in \`utilities\`, so a consumer's
301
- * \`css()\` always wins. Between two \`css()\` calls you own, merge the objects instead —
302
- * \`css(base, override)\` resolves per property before any class name exists.
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
- * {@link https://bamboocss.com/docs/concepts/cascade-layers cascade layers}. A component
258
- * whose styles a consumer will override belongs in `recipes` — write it with `cva`/`sva`,
259
- * not bare `css()` — and the consumer's `css()` in `utilities` wins by layer, in every
260
- * build. Two `css()` outputs joined with `cx` are in the same layer and resolve by source
261
- * order; when you own both, merge the style objects with `css(a, b)` instead.
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
- * This does **not** resolve conflicts between them: \`cx('px_4', 'px_2')\` keeps both, and
270
- * the browser picks by their order in the stylesheet rather than by the order you passed
271
- * them. That is true of every build — atomic, hashed and grouped alike.
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
- * To override a style rather than append to it, let the cascade decide: styles from
274
- * \`cva\`/\`sva\` sit in the \`recipes\` layer and \`css()\` in \`utilities\`, so a consumer's
275
- * \`css()\` always wins. Between two \`css()\` calls you own, merge the objects instead —
276
- * \`css(base, override)\` resolves per property before any class name exists.
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.62.0",
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.62.0",
42
- "@bamboocss/is-valid-prop": "^1.62.0",
43
- "@bamboocss/logger": "1.62.0",
44
- "@bamboocss/shared": "1.62.0",
45
- "@bamboocss/token-dictionary": "1.62.0",
46
- "@bamboocss/types": "1.62.0"
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"