Git Product home page Git Product logo

Comments (5)

therealokoro avatar therealokoro commented on June 3, 2024 1

Beautiful work @Dunqing.

from unocss-preset-theme.

Dunqing avatar Dunqing commented on June 3, 2024

You also need to set the theme type for unocss

Please refer to the following
https://github.com/Dunqing/unocss-preset-theme/blob/f2419617670bdcb5eb12b4b4850e2af49418ec75/playground/vite.config.ts#L10

from unocss-preset-theme.

therealokoro avatar therealokoro commented on June 3, 2024

Uhm... So i'm using unocss with nuxt 3 and my config lies in an unocss.config.ts file not in vite.config.ts. This means that the unocss export from vite is not needed. So how do I then use this preset?

How about you try using this preset with nuxt 3.

Here's an example of my config.

export default defineConfig({
  theme: {},
  presets: [
    presetUno(),
    presetAttributify(),
    presetIcons({ scale: 1.2 }),
    presetForms(),
    presetTheme<Theme>({
      theme: {
        dark: {
          colors: {
            primary: "#1668dc",
            "primary-border": "#1668dc",
            border: "#424242"
          }
       }
    }),
  transformers: [transformerDirectives(), transformerVariantGroup()]
})

from unocss-preset-theme.

Dunqing avatar Dunqing commented on June 3, 2024

Just like this

export default defineConfig<Theme>({...})

from unocss-preset-theme.

therealokoro avatar therealokoro commented on June 3, 2024

Works like a charm👌. Nice one

So one more thing. I think it would be nice if the plugin could convert colors to rgba so as to respect a opacity when available.

Currently when you pass in a color value(except for color names) to the color property in the default theme option of unocss, It's converted to rgba so if in usage, an opacity is passed, then it can be used.

See examples below.

Default

image one
image

Notice how the rgb color value passed to the color property in the config was converted rgba so it could respect opacity.

With this preset

image
image

Notice that it ignores the possibility of have opacity.

I do hope that this is clear enough. Thanks

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.