@bamboocss/types 1.53.1 → 1.54.1

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 +43 -0
  2. package/package.json +2 -2
package/dist/config.d.ts CHANGED
@@ -350,6 +350,16 @@ interface CssgenOptions {
350
350
  * @default false
351
351
  */
352
352
  minify?: boolean
353
+ /**
354
+ * Whether the stylesheet carries the 🎋 in its `--made-with-bamboo` declaration on `:root`.
355
+ *
356
+ * `false` keeps the declaration and drops the emoji from its value. The declaration itself
357
+ * stays because the Vite plugin recognises its stylesheet by that property once a bundler
358
+ * has minified and merged it with other css.
359
+ *
360
+ * @default true
361
+ */
362
+ watermark?: boolean
353
363
  /**
354
364
  * What to drop from the generated stylesheet. See `PruneOptions`.
355
365
  */
@@ -373,6 +383,9 @@ interface CssgenOptions {
373
383
 
374
384
  export type UnresolvedTokenSeverity = 'off' | 'warn' | 'error'
375
385
 
386
+ /** @see UserConfig.invalidDeclaration */
387
+ export type InvalidDeclarationSeverity = 'off' | 'warn' | 'error'
388
+
376
389
  /** `'auto'` hashes in production and leaves names readable in development. */
377
390
  export type HashSetting = boolean | 'auto'
378
391
 
@@ -754,6 +767,36 @@ export interface Config
754
767
  * @default { token: 'error', grammar: 'warn' }
755
768
  */
756
769
  unresolvedToken?: UnresolvedTokenSeverity | { token?: UnresolvedTokenSeverity; grammar?: UnresolvedTokenSeverity }
770
+
771
+ /**
772
+ * What to do about a declaration in the emitted stylesheet that is not valid CSS for its
773
+ * property.
774
+ *
775
+ * - `off` says nothing.
776
+ * - `warn` logs each one, once, the first time a sheet is emitted with it.
777
+ * - `error` fails the build, listing every one the sheet holds.
778
+ *
779
+ * Asked of the finished sheet rather than of the styles that built it, so it sees what a
780
+ * utility transform, a mixin, a config recipe, the `[…]` escape hatch and the preset's own
781
+ * reset actually emitted. `bgLinear: '65deg'` reaches the sheet as `background-image: 65deg`
782
+ * and `width: '[10px 20px]'` as `width: 10px 20px`; both parse, so the stylesheet is valid
783
+ * and nothing downstream objects, and the browser drops the declaration at compute time.
784
+ *
785
+ * A value that reads a variable — `var()`, `env()`, `attr()`, `if()` — is not checked,
786
+ * because the grammar cannot see what will be substituted; in a token-backed sheet that is
787
+ * most declarations. A property the grammar has never heard of is not reported either. Only
788
+ * a value the grammar knows and rejects is.
789
+ *
790
+ * `warn` is the default because the judge is the CSS grammar, whose data lags the spec:
791
+ * `display: 'masonry'` and `containerType: 'scroll-state'` are valid CSS it has not caught
792
+ * up with. Escalate once the sheet is known to be clean.
793
+ *
794
+ * A value naming a token that does not exist belongs to {@link unresolvedToken}, whatever
795
+ * that is set to, and is never reported here.
796
+ *
797
+ * @default 'warn'
798
+ */
799
+ invalidDeclaration?: InvalidDeclarationSeverity
757
800
  }
758
801
 
759
802
  export interface Preset extends ExtendableOptions, PresetOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/types",
3
- "version": "1.53.1",
3
+ "version": "1.54.1",
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.53.1"
35
+ "@bamboocss/extractor": "1.54.1"
36
36
  },
37
37
  "scripts": {
38
38
  "dev": "tsx scripts/watch.ts",