Git Product home page Git Product logo

Comments (4)

Dunqing avatar Dunqing commented on June 15, 2024

I think it's okay now, upgrade to the latest version.

from unocss-preset-theme.

Mintnoii avatar Mintnoii commented on June 15, 2024

Version 0.9.3 still has this problem,my unocss version is 0.56.0 @Dunqing

from unocss-preset-theme.

Dunqing avatar Dunqing commented on June 15, 2024

Version 0.9.3 still has this problem,my unocss version is 0.56.0 @Dunqing

Thank you for the feedback.

This is a problem caused by the inconsistency between your unocss version and the unocss version of unocss-preset-theme. Normally it will only cause a type error, so you can ignore it and wait until this preset is synchronized with the latest version of unocss to fix it.

Now you can update to 0.10.0 and the problem will be gone!

from unocss-preset-theme.

wtto00 avatar wtto00 commented on June 15, 2024

@Dunqing Hello, this issue has resurfaced in version 0.11.0, and my unocss version is 0.57.3.

Can the following types of changes be made?

interface PresetThemeOptions<Theme extends Record<string, any>> {
  theme: Record<string, Theme>
}
// changed to blow
interface Colors {
    [key: string]: Colors & {
        DEFAULT?: string;
    } | string;
}
interface PresetThemeOptions<Theme extends Record<string, any>> {
  theme: Record<string, { colors: Colors }>
  // or Record<string, Colors>
}

Colors type from https://github.com/unocss/unocss/blob/af91b66e141794489e49bffd521d989dd8b76888/packages/preset-mini/src/_theme/types.ts#L11-L13

Remove all other configuration options and keep only colors. Users can use dark:xxx in their business code for condition checking. This plugin should only handle color-related logic.

from unocss-preset-theme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.