@terrazzo/plugin-css 0.7.4 β†’ 0.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @terrazzo/plugin-css
2
2
 
3
+ ## 0.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`5edf1fd`](https://github.com/terrazzoapp/terrazzo/commit/5edf1fde42cd53b5883eefcbe849dc5749cfaa8f)]:
8
+ - @terrazzo/cli@0.8.1
9
+ - @terrazzo/token-tools@0.8.1
10
+
11
+ ## 0.8.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#489](https://github.com/terrazzoapp/terrazzo/pull/489) [`63f91e6`](https://github.com/terrazzoapp/terrazzo/commit/63f91e6eee1bec5cf7fae3c1bffdde40a5604ec6) Thanks [@drwpow](https://github.com/drwpow)! - Use Rolldown for packaging πŸš€
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [[`63f91e6`](https://github.com/terrazzoapp/terrazzo/commit/63f91e6eee1bec5cf7fae3c1bffdde40a5604ec6)]:
20
+ - @terrazzo/token-tools@0.8.0
21
+ - @terrazzo/cli@0.8.0
22
+
3
23
  ## 0.7.4
4
24
 
5
25
  ### Patch Changes
package/README.md CHANGED
@@ -21,6 +21,8 @@ export default defineConfig({
21
21
  plugins: [
22
22
  css({
23
23
  filename: "tokens.css",
24
+ variableName: (id) => id.replace(/\./g, "-"),
25
+ baseSelector: ":root",
24
26
  }),
25
27
  ],
26
28
  });
package/dist/index.d.ts CHANGED
@@ -1,6 +1,76 @@
1
- import type { Plugin } from '@terrazzo/parser';
2
- import { type CSSPluginOptions } from './lib.js';
3
- export * from './build/index.js';
4
- export * from './lib.js';
5
- export default function cssPlugin(options?: CSSPluginOptions): Plugin;
1
+ import { BuildHookOptions, Plugin, TokenNormalized, TokenTransformed } from "@terrazzo/parser";
2
+
3
+ //#region src/lib.d.ts
4
+ type UtilityCSSGroup = 'bg' | 'border' | 'font' | 'layout' | 'shadow' | 'text';
5
+ type UtilityCSSPrefix = 'bg' | 'border' | 'font' | 'gap' | 'm' | 'p' | 'shadow' | 'text';
6
+ declare const FORMAT_ID = "css";
7
+ declare const FILE_PREFIX = "/* -------------------------------------------\n * Autogenerated by \u26CB Terrazzo. DO NOT EDIT!\n * ------------------------------------------- */";
8
+ interface CSSPluginOptions {
9
+ /**
10
+ * Where to output CSS
11
+ * @default "index.css"
12
+ */
13
+ filename?: string;
14
+ /** Glob patterns to exclude tokens from output */
15
+ exclude?: string[];
16
+ /** Define mode selectors as media queries or CSS classes */
17
+ modeSelectors?: ModeSelector[];
18
+ /** Control the final CSS variable name */
19
+ variableName?: (token: TokenNormalized) => string;
20
+ /** Override certain token values */
21
+ transform?: (token: TokenNormalized, mode: string) => TokenTransformed['value'];
22
+ /** Generate utility CSS from groups */
23
+ utility?: Record<UtilityCSSGroup, string[]>;
24
+ /**
25
+ * Output colors as hex-6/hex-8 instead of color() function
26
+ * @default false
27
+ */
28
+ legacyHex?: boolean;
29
+ /**
30
+ * Skip generating any `.css` files (useful if you are consuming values in your own plugin and don’t need any `.css` files written to disk).
31
+ * @default false
32
+ */
33
+ skipBuild?: boolean;
34
+ /**
35
+ * Set the base selector, like ":root" or ":host".
36
+ * @default ":root"
37
+ */
38
+ baseSelector?: string;
39
+ }
40
+ interface ModeSelector {
41
+ /** The name of the mode to match */
42
+ mode: string;
43
+ /** Provide token IDs to match. Globs are allowed (e.g: `["color.*", "shadow.dark"]`) */
44
+ tokens?: string[];
45
+ /** Provide CSS selectors to generate. (e.g.: `["@media (prefers-color-scheme: dark)", "[data-color-theme='dark']"]` ) */
46
+ selectors: string[];
47
+ }
48
+ interface CSSRule {
49
+ selectors: string[];
50
+ nestedQuery?: string;
51
+ declarations: Record<string, string>;
52
+ }
53
+ /** Convert CSSRules into a formatted, indented CSS string */
54
+ declare function printRules(rules: CSSRule[]): string;
55
+ interface GetRuleOptions {
56
+ /** Combine a selector with parent selectors (e.g. if adding a @media-query within another selector list) */
57
+ parentSelectors?: string[];
58
+ }
59
+ //# sourceMappingURL=lib.d.ts.map
60
+ //#endregion
61
+ //#region src/build/index.d.ts
62
+ interface BuildFormatOptions {
63
+ exclude: CSSPluginOptions['exclude'];
64
+ getTransforms: BuildHookOptions['getTransforms'];
65
+ modeSelectors: CSSPluginOptions['modeSelectors'];
66
+ utility: CSSPluginOptions['utility'];
67
+ baseSelector: string;
68
+ }
69
+ //#endregion
70
+ //#region src/index.d.ts
71
+ declare function cssPlugin(options?: CSSPluginOptions): Plugin;
72
+ //# sourceMappingURL=index.d.ts.map
73
+
74
+ //#endregion
75
+ export { BuildFormatOptions, CSSPluginOptions, CSSRule, FILE_PREFIX, FORMAT_ID, GetRuleOptions, ModeSelector, UtilityCSSGroup, UtilityCSSPrefix, cssPlugin as default, printRules };
6
76
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI/C,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,UAAU,CAAC;AAEzE,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AAEzB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAwEpE"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/lib.ts","../src/build/index.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;KAEY,eAAA;KAEA,gBAAA;AAFA,cAIC,SAAA,GAJc,KAAA;AAEf,cAIC,WAAA,GAJe,uJAAA;AAEf,UAMI,gBAAA,CANK;EAET;AAIb;;;EAS8B,QAEL,CAAA,EAAA,MAAA;EAAe;EAEH,OAAmB,CAAA,EAAA,MAAA,EAAA;EAAgB;EAEtC,aAAtB,CAAA,EAN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