HTML & CSS · Middle · Question 43 of 75

How do you add a custom brand color in Tailwind v4 so that bg-brand, text-brand, etc. work?

Explanation

In v4 configuration moved into CSS: variables in @theme { --color-brand: oklch(...); } create both the utilities (bg-brand, border-brand) and a regular CSS variable var(--color-brand). The old tailwind.config.js is supported via @config but isn't needed by default.

Further reading

Problem with a question

HTML & CSS · Middle · question 43

Test yourself

Take the HTML & CSS · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz