@unocss/transformer-directives 0.55.0 → 0.55.2

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
@@ -218,5 +218,5 @@ async function transformDirectives(code, uno, options, filename, originalCode, o
218
218
  await Promise.all(stack);
219
219
  }
220
220
 
221
- exports["default"] = transformerDirectives;
221
+ exports.default = transformerDirectives;
222
222
  exports.transformDirectives = transformDirectives;
@@ -0,0 +1,41 @@
1
+ import { SourceCodeTransformer, UnoGenerator } from '@unocss/core';
2
+ import MagicString from 'magic-string';
3
+
4
+ interface TransformerDirectivesOptions {
5
+ enforce?: SourceCodeTransformer['enforce'];
6
+ /**
7
+ * Throw an error if utils or themes are not found.
8
+ *
9
+ * @default true
10
+ */
11
+ throwOnMissing?: boolean;
12
+ /**
13
+ * Treat CSS variables as @apply directives for CSS syntax compatible.
14
+ *
15
+ * Pass `false` to disable.
16
+ *
17
+ * @default ['--at-apply', '--uno-apply', '--uno']
18
+ */
19
+ applyVariable?: false | string | string[];
20
+ /**
21
+ * Treat CSS variables as directives for CSS syntax compatible.
22
+ *
23
+ * Pass `false` to disable, or a string to use as a prefix.
24
+ *
25
+ * @deprecated use `applyVariable` to specify the full var name instead.
26
+ * @default '--at-'
27
+ */
28
+ varStyle?: false | string;
29
+ }
30
+ interface TransformerDirectivesContext {
31
+ code: MagicString;
32
+ uno: UnoGenerator;
33
+ options: TransformerDirectivesOptions;
34
+ applyVariable: string[];
35
+ offset?: number;
36
+ filename?: string;
37
+ }
38
+ declare function transformerDirectives(options?: TransformerDirectivesOptions): SourceCodeTransformer;
39
+ declare function transformDirectives(code: MagicString, uno: UnoGenerator, options: TransformerDirectivesOptions, filename?: string, originalCode?: string, offset?: number): Promise<void>;
40
+
41
+ export { TransformerDirectivesContext, TransformerDirectivesOptions, transformerDirectives as default, transformDirectives };
@@ -0,0 +1,41 @@
1
+ import { SourceCodeTransformer, UnoGenerator } from '@unocss/core';
2
+ import MagicString from 'magic-string';
3
+
4
+ interface TransformerDirectivesOptions {
5
+ enforce?: SourceCodeTransformer['enforce'];
6
+ /**
7
+ * Throw an error if utils or themes are not found.
8
+ *
9
+ * @default true
10
+ */
11
+ throwOnMissing?: boolean;
12
+ /**
13
+ * Treat CSS variables as @apply directives for CSS syntax compatible.
14
+ *
15
+ * Pass `false` to disable.
16
+ *
17
+ * @default ['--at-apply', '--uno-apply', '--uno']
18
+ */
19
+ applyVariable?: false | string | string[];
20
+ /**
21
+ * Treat CSS variables as directives for CSS syntax compatible.
22
+ *
23
+ * Pass `false` to disable, or a string to use as a prefix.
24
+ *
25
+ * @deprecated use `applyVariable` to specify the full var name instead.
26
+ * @default '--at-'
27
+ */
28
+ varStyle?: false | string;
29
+ }
30
+ interface TransformerDirectivesContext {
31
+ code: MagicString;
32
+ uno: UnoGenerator;
33
+ options: TransformerDirectivesOptions;
34
+ applyVariable: string[];
35
+ offset?: number;
36
+ filename?: string;
37
+ }
38
+ declare function transformerDirectives(options?: TransformerDirectivesOptions): SourceCodeTransformer;
39
+ declare function transformDirectives(code: MagicString, uno: UnoGenerator, options: TransformerDirectivesOptions, filename?: string, originalCode?: string, offset?: number): Promise<void>;
40
+
41
+ export { TransformerDirectivesContext, TransformerDirectivesOptions, transformerDirectives as default, transformDirectives };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/transformer-directives",
3
- "version": "0.55.0",
3
+ "version": "0.55.2",
4
4
  "description": "UnoCSS transformer for `@apply` directive",
5
5
  "author": "hannoeru <me@hanlee.co>",
6
6
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "css-tree": "^2.3.1",
36
- "@unocss/core": "0.55.0"
36
+ "@unocss/core": "0.55.2"
37
37
  },
38
38
  "devDependencies": {
39
39
  "magic-string": "^0.30.2"