vunor 0.4.5 → 0.4.6

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,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.6
4
+
5
+ ### Fixed
6
+
7
+ - The important variant of a shortcut (`!card`, `card!`) no longer writes `!important !important` on a declaration the shortcut already marks important (`card` makes its dense spacing important). That CSS is invalid: browsers drop the declaration and lightningcss, the CSS minifier of Vite 8, fails the production build. The token `!card` anywhere in a scanned file was enough, `v-if="!card"` included. Every declaration now carries `!important` once, in vunor's shortcuts and in yours; without the `!` nothing changes.
8
+
3
9
  ## 0.4.5
4
10
 
5
11
  ### Added
package/dist/theme.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import defu$1, { defu } from "defu";
2
- import { presetWind } from "unocss";
2
+ import { presetWind, toArray } from "unocss";
3
3
  import { color, palitra } from "@prostojs/palitra";
4
4
  //#region src/theme/utils/define-sc.ts
5
5
  const defineShortcuts = (sc) => sc;
@@ -2537,6 +2537,10 @@ const disabledSoftLiteral = {
2537
2537
  order: -1e3,
2538
2538
  match: (matcher, { generator }) => matcher === DISABLED_SOFT && generator.config.shortcuts.some((sc) => sc[0] === DISABLED_SOFT) ? { matcher: DISABLED_SOFT_LITERAL } : void 0
2539
2539
  };
2540
+ const REPEATED_IMPORTANT = /!important(?:\s*!important)+\s*$/i;
2541
+ const singleImportant = (util) => {
2542
+ for (const entry of util.entries) if (typeof entry[1] === "string" && entry[1].includes("!")) entry[1] = entry[1].replace(REPEATED_IMPORTANT, "!important");
2543
+ };
2540
2544
  const presetVunor = (_opts) => {
2541
2545
  const opts = defu(_opts, defaultOptions);
2542
2546
  const wind = getFixedWind();
@@ -2556,6 +2560,7 @@ const presetVunor = (_opts) => {
2556
2560
  name: "vunor",
2557
2561
  theme: defu(theme.theme, wind.theme),
2558
2562
  variants: [disabledSoftLiteral, ...wind.variants ?? []],
2563
+ postprocess: [...toArray(wind.postprocess), singleImportant],
2559
2564
  shortcuts: [...paletteShortcuts, [DISABLED_SOFT_LITERAL, DISABLED_SOFT]],
2560
2565
  extractors: [createVunorExtractor()],
2561
2566
  layers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vunor",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "files": [
5
5
  "dist",
6
6
  "CHANGELOG.md"