@bamboocss/types 1.53.0 → 1.54.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 +33 -0
  2. package/package.json +2 -2
package/dist/config.d.ts CHANGED
@@ -373,6 +373,9 @@ interface CssgenOptions {
373
373
 
374
374
  export type UnresolvedTokenSeverity = 'off' | 'warn' | 'error'
375
375
 
376
+ /** @see UserConfig.invalidDeclaration */
377
+ export type InvalidDeclarationSeverity = 'off' | 'warn' | 'error'
378
+
376
379
  /** `'auto'` hashes in production and leaves names readable in development. */
377
380
  export type HashSetting = boolean | 'auto'
378
381
 
@@ -754,6 +757,36 @@ export interface Config
754
757
  * @default { token: 'error', grammar: 'warn' }
755
758
  */
756
759
  unresolvedToken?: UnresolvedTokenSeverity | { token?: UnresolvedTokenSeverity; grammar?: UnresolvedTokenSeverity }
760
+
761
+ /**
762
+ * What to do about a declaration in the emitted stylesheet that is not valid CSS for its
763
+ * property.
764
+ *
765
+ * - `off` says nothing.
766
+ * - `warn` logs each one, once, the first time a sheet is emitted with it.
767
+ * - `error` fails the build, listing every one the sheet holds.
768
+ *
769
+ * Asked of the finished sheet rather than of the styles that built it, so it sees what a
770
+ * utility transform, a mixin, a config recipe, the `[…]` escape hatch and the preset's own
771
+ * reset actually emitted. `bgLinear: '65deg'` reaches the sheet as `background-image: 65deg`
772
+ * and `width: '[10px 20px]'` as `width: 10px 20px`; both parse, so the stylesheet is valid
773
+ * and nothing downstream objects, and the browser drops the declaration at compute time.
774
+ *
775
+ * A value that reads a variable — `var()`, `env()`, `attr()`, `if()` — is not checked,
776
+ * because the grammar cannot see what will be substituted; in a token-backed sheet that is
777
+ * most declarations. A property the grammar has never heard of is not reported either. Only
778
+ * a value the grammar knows and rejects is.
779
+ *
780
+ * `warn` is the default because the judge is the CSS grammar, whose data lags the spec:
781
+ * `display: 'masonry'` and `containerType: 'scroll-state'` are valid CSS it has not caught
782
+ * up with. Escalate once the sheet is known to be clean.
783
+ *
784
+ * A value naming a token that does not exist belongs to {@link unresolvedToken}, whatever
785
+ * that is set to, and is never reported here.
786
+ *
787
+ * @default 'warn'
788
+ */
789
+ invalidDeclaration?: InvalidDeclarationSeverity
757
790
  }
758
791
 
759
792
  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.0",
3
+ "version": "1.54.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.53.0"
35
+ "@bamboocss/extractor": "1.54.0"
36
36
  },
37
37
  "scripts": {
38
38
  "dev": "tsx scripts/watch.ts",