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:
<div class="bg-[var(--h-btn-bg,color-mix(in_oklab,var(--h-info)_100%,transparent))]"></div>Expected output:
background-color: var(--h-btn-bg, color-mix(in oklab, var(--h-info) 100%, transparent));Actual output:
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
- Read the Contributing Guidelines.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Source: unocss/unocss