@bamboocss/types 1.17.3 → 1.19.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.
Files changed (2) hide show
  1. package/dist/config.d.ts +18 -3
  2. package/package.json +2 -2
package/dist/config.d.ts CHANGED
@@ -286,12 +286,27 @@ interface CssgenOptions {
286
286
  * The token layer declares every token in the theme, and an app typically uses a small
287
287
  * fraction of them, so this is usually the largest single saving in render-blocking css.
288
288
  *
289
+ * The same walk also drops an `@property` registration for a custom property the finished
290
+ * stylesheet neither declares nor reads. A preset registers what its utilities compose —
291
+ * filters, gradients, transforms, transitions — and ships the whole set regardless of what
292
+ * the app draws, so an app using none of them carries all of it for nothing. Registrations
293
+ * declared through `globalVars` are yours and are never removed.
294
+ *
289
295
  * It is opt-in because reachability cannot be proven for every reference. `token()` and
290
296
  * `token.var()` calls are read out of the source, as is any literal `var(--x)` written
291
297
  * by hand. Three things stay invisible: a token named by a path the source does not
292
- * spell out as a string literal — `token.var(key)` — one referenced only from a
293
- * stylesheet outside `include`, and one used by a separate package consuming the output
294
- * as design tokens. Use `staticCss` to keep those.
298
+ * spell out as a string literal, one referenced only from a stylesheet outside
299
+ * `include`, and one used by a separate package consuming the output as design tokens.
300
+ * Use `staticCss` to keep those.
301
+ *
302
+ * Only the *second* form of the first case is a risk. `token(key)` is safe for any path,
303
+ * because javascript receives a literal for a plain token rather than a reference. It is
304
+ * `token.var(key)` — the form that hands back `var(--x)` — that needs the declaration to
305
+ * still be there, so that is the one to hold with `staticCss`.
306
+ *
307
+ * A custom property declared by `globalCss` or `globalVars` is not one of these cases:
308
+ * the declaration ships whether or not anything in the stylesheet reads it, so whatever
309
+ * it references is kept alongside it.
295
310
  *
296
311
  * Tokens that javascript receives as a `var()` rather than a literal are always kept, so
297
312
  * that `token()` answers correctly for any path at runtime. That covers virtual tokens
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/types",
3
- "version": "1.17.3",
3
+ "version": "1.19.0",
4
4
  "description": "The types for css bamboo",
5
5
  "homepage": "https://bamboocss.com",
6
6
  "license": "MIT",
@@ -32,7 +32,7 @@
32
32
  "ncp": "2.0.0",
33
33
  "pkg-types": "2.3.0",
34
34
  "ts-morph": "28.0.0",
35
- "@bamboocss/extractor": "1.17.3"
35
+ "@bamboocss/extractor": "1.19.0"
36
36
  },
37
37
  "scripts": {
38
38
  "dev": "tsx scripts/watch.ts",