Skip to content

Color names #653

Answered by saadeghi
TiagoNH asked this question in Q&A
Mar 25, 2022 · 5 comments · 25 replies
Discussion options

You must be logged in to vote

The best way is to extend Tailwind CSS color using CSS variables
and then define that variable value in daisyUI themes:

https://play.tailwindcss.com/zuwkjrS6yl?file=config

// tailwind.config.js
module.exports = {
  plugins: [require('daisyui')],
  theme: {
    extend: {
      colors: {
        'primary-cool': "hsl(var(--primary-cool) / <alpha-value>)",
      },
    },
  },
  daisyui: {
    themes: [
      {
        light: {
          ...require('daisyui/src/theming/themes')['[data-theme=light]'],
          '--primary-cool': '338 83% 66%',
        },
      },
      {
        cupcake: {
          ...require('daisyui/src/theming/themes')['[data-theme=cupcake]'],
          '--primary-cool': '…

Replies: 5 comments 25 replies

Comment options

You must be logged in to vote
7 replies
@KatiePup
Comment options

@saadeghi
Comment options

@thnee
Comment options

@saadeghi
Comment options

@thnee
Comment options

Answer selected by saadeghi
Comment options

You must be logged in to vote
10 replies
@AutomateAaron
Comment options

@saadeghi
Comment options

@AutomateAaron
Comment options

@saadeghi
Comment options

@AutomateAaron
Comment options

Comment options

You must be logged in to vote
1 reply
@saadeghi
Comment options

Comment options

You must be logged in to vote
7 replies
@levino
Comment options

@saadeghi
Comment options

@levino
Comment options

@saadeghi
Comment options

@levino
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment