@kevinmarrec/unocss-config 1.6.0 → 1.7.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.
package/dist/index.d.mts CHANGED
@@ -1,16 +1,15 @@
1
- import { UserConfig } from "unocss";
2
1
  import { IconsOptions } from "@unocss/preset-icons";
3
2
  import { WebFontsOptions } from "@unocss/preset-web-fonts";
4
- import { Theme } from "@unocss/preset-wind4";
3
+ import { PresetWind4Options, Theme } from "@unocss/preset-wind4";
4
+ import { UserConfig } from "@unocss/core";
5
5
 
6
- //#region src/preset.d.ts
7
- interface PresetOptions {
6
+ //#region src/index.d.ts
7
+ interface Config extends UserConfig<Theme> {
8
8
  icons?: IconsOptions;
9
9
  fonts?: WebFontsOptions['fonts'];
10
+ wind?: PresetWind4Options;
10
11
  }
11
- //#endregion
12
- //#region src/index.d.ts
13
- declare function useConfig(userConfig?: UserConfig<Theme> & PresetOptions): UserConfig<Theme>;
12
+ declare function useConfig(config?: Config): UserConfig<Theme>;
14
13
  declare const _default: UserConfig<Theme>;
15
14
  //#endregion
16
- export { _default as default, useConfig };
15
+ export { Config, _default as default, useConfig };
package/dist/index.mjs CHANGED
@@ -1,5 +1,3 @@
1
- import { defineConfig } from "unocss";
2
- import { definePreset } from "@unocss/core";
3
1
  import presetIcons from "@unocss/preset-icons";
4
2
  import presetWebFonts from "@unocss/preset-web-fonts";
5
3
  import { createLocalFontProcessor } from "@unocss/preset-web-fonts/local";
@@ -7,35 +5,25 @@ import presetWind from "@unocss/preset-wind4";
7
5
  import transformerDirectives from "@unocss/transformer-directives";
8
6
  import transformerVariantGroup from "@unocss/transformer-variant-group";
9
7
 
10
- //#region src/preset.ts
11
- var preset_default = definePreset((options) => ({
12
- name: "@kevinmarrec/unocss-preset",
13
- presets: [
14
- presetWind(),
15
- presetIcons(options?.icons),
16
- presetWebFonts({
17
- processors: createLocalFontProcessor(),
18
- fonts: options?.fonts
19
- })
20
- ],
21
- transformers: [transformerDirectives(), transformerVariantGroup()],
22
- preflights: [{
23
- layer: "default",
24
- getCSS: () => "html, body, #app {height: 100%;}"
25
- }]
26
- }));
27
-
28
- //#endregion
29
8
  //#region src/index.ts
30
- function useConfig(userConfig = {}) {
31
- const { fonts, icons, ...config } = userConfig;
32
- return defineConfig({
33
- presets: [preset_default({
34
- fonts,
35
- icons
36
- })],
37
- ...config
38
- });
9
+ function useConfig(config = {}) {
10
+ const { icons, fonts, wind, ...userConfig } = config;
11
+ return {
12
+ presets: [
13
+ presetWind(wind),
14
+ presetIcons(icons),
15
+ presetWebFonts({
16
+ processors: createLocalFontProcessor(),
17
+ fonts
18
+ })
19
+ ],
20
+ transformers: [transformerDirectives(), transformerVariantGroup()],
21
+ preflights: [{
22
+ layer: "default",
23
+ getCSS: () => "html, body, #app {height: 100%;}"
24
+ }],
25
+ ...userConfig
26
+ };
39
27
  }
40
28
  var src_default = useConfig();
41
29
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kevinmarrec/unocss-config",
3
3
  "type": "module",
4
- "version": "1.6.0",
4
+ "version": "1.7.0",
5
5
  "description": "Opinionated UnoCSS config.",
6
6
  "author": "Kevin Marrec <kevin@marrec.io>",
7
7
  "license": "MIT",
@@ -30,14 +30,11 @@
30
30
  "unocss": ">=66.5.0"
31
31
  },
32
32
  "dependencies": {
33
- "@unocss/core": "^66.5.10",
34
- "@unocss/preset-icons": "^66.5.10",
35
- "@unocss/preset-web-fonts": "^66.5.10",
36
- "@unocss/preset-wind4": "^66.5.10",
37
- "@unocss/transformer-directives": "^66.5.10",
38
- "@unocss/transformer-variant-group": "^66.5.10"
39
- },
40
- "devDependencies": {
41
- "unocss": "^66.5.10"
33
+ "@unocss/core": "^66.5.12",
34
+ "@unocss/preset-icons": "^66.5.12",
35
+ "@unocss/preset-web-fonts": "^66.5.12",
36
+ "@unocss/preset-wind4": "^66.5.12",
37
+ "@unocss/transformer-directives": "^66.5.12",
38
+ "@unocss/transformer-variant-group": "^66.5.12"
42
39
  }
43
40
  }