#5326·unocss

preset-wind4 emits invalid CSS for `/oklab` color modifiers inside shortcuts

Author: CNSeniorious000Created Sep 9, 2026Updated Sep 11, 2026

UnoCSS version

66.10.1

Describe the bug

With presetWind4, using the color interpolation modifier /oklab inside an arbitrary selector variant nested in a shortcut makes the Vite production build emit invalid CSS.

The warning is:

[unocss] unmatched utility "[&[aria-selected=true]]:(bg-accent/9/oklab" in shortcut "rail-tab"

The generated stylesheet then fails Lightning CSS minification:

[vite:css-post] SyntaxError: [lightningcss minify] Unexpected token CloseParenthesis

The failure is reproducible in CNSeniorious000/macaron-agent-skills#158, at commit f624c01. The relevant configuration is webui/uno.config.ts:

typescript
presets: [presetWind4(), presetIcons()],
theme: {
  colors: {
    accent: 'light-dark(#a65e2b, #c99076)',
    'accent-strong': 'light-dark(#a64f4f, #cb7676)',
  },
},
shortcuts: {
  'rail-tab':
    '... [&[aria-selected=true]]:(bg-accent/9/oklab text-accent-strong/oklab)',
},

The project uses Vite 8.2.2 with the default Lightning CSS minifier. Lint, type checking, and tests pass; only the production CSS build fails.

Expected behavior

Either the shortcut variant should be parsed and compiled to valid CSS, or it should be rejected without emitting malformed CSS. vite build should not fail during CSS minification.

Reproduction

Run deno install and deno task build from the linked commit above.

Related reports: #5251 covers a different Lightning CSS parse failure, and #5290 fixes a separate CSS-variable fallback bug.