unpreset / unocss-preset-theme

The dynamic theme presets for UnoCSS.
https://unocss-preset-theme.todev.cc
119 stars 11 forks source link

Incorrect CSS color generated in the latest unocss #66

Closed wearzdk closed 8 months ago

wearzdk commented 8 months ago

After some investigation, this may be related to the breaking change in unocss/unocss#3221

In the latest version of unocss, when this plugin is disabled, the generated background color CSS is rgb(250 250 250 / var(--un-bg-opacity)). However, when it is enabled, the generated background color CSS is rgb(var(--un-preset-theme-colors-canvas) / var(--un-bg-opacity)), where --un-preset-theme-colors-canvas has a value of 37, 37, 37 in dark mode.

As a result, the final generated output is rgb(37, 37, 37 / var(--un-bg-opacity)). This syntax might be incorrect, but when I changed it to rgb(37 37 37 / var(--un-bg-opacity)), it worked correctly.

This issue might be related to the color generation logic of the plugin.

Dunqing commented 8 months ago

Thank you for your feedback. I've figured out what the issue is!