#5370·unocss

preset-wind4: Background color arbitrary values containing CSS variables are unexpectedly wrapped in color-mix()

Author: euwei7Created Sep 30, 2026Updated Sep 30, 2026

UnoCSS version

Latest Version

Describe the bug

When using a CSS custom property with a color-mix() fallback in a background color utility, preset-wind4 automatically wraps the entire expression in another color-mix() function.

Reproduction

Class name:

xml
<div class="bg-[var(--h-btn-bg,color-mix(in_oklab,var(--h-info)_100%,transparent))]"></div>

Expected output:

css
background-color: var(--h-btn-bg, color-mix(in oklab, var(--h-info) 100%, transparent));

Actual output:

css
background-color: color-mix(in oklab, var(--h-btn-bg, color-mix(in oklab, var(--h-info) 100%, transparent)) var(--un-bg-opacity), transparent);

System Info

Validations