unpreset / unocss-preset-theme

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

Can not use color variables #71

Closed robin-dongbin closed 8 months ago

robin-dongbin commented 8 months ago

When I set a HEX color string, it works well, but when I set it use color variables, It's not work

import {
  defineConfig,
  presetIcons,
  presetTypography,
  presetUno,
  transformerDirectives,
  transformerVariantGroup,
} from 'unocss'

import presetTheme from 'unocss-preset-theme'

const colors = presetUno().theme.colors

export default defineConfig({
  theme: {
    colors: {
      base: {
        DEFAULT: colors.light[5],
        foreground: colors.dark[5],
      },
    },
  },
  presets: [
    presetUno(),
    presetIcons(),
    presetTypography(),
    presetTheme({
      theme: {
        dark: {
          colors: {
            base: {
              DEFAULT: colors.dark[5],
              foreground: colors.light[5],
            },
          },
        },
      },
    }),
  ],
  transformers: [
    transformerDirectives(),
    transformerVariantGroup(),
  ],
})