Menu

Five of our colour tokens were never registered as colours, so eight classes using them match nothing in the stylesheet
📰

Five of our colour tokens were never registered as colours, so eight classes using them match nothing in the stylesheet

DEV Community: css·Daniel Pertu·18 days ago
#Xyu0hvhD
#devtocss#devto#dev#fafafa#foreground
Reading 0:00
15s threshold

CogniPrep is on Tailwind v4, which means there is no

tailwind.config.ts in the repository at all. The theme is CSS, in

app/globals.css , 719 lines of it, and it starts like this:

@import 'tailwindcss' ;

@custom-variant dark ( & : is (. dark * ));

Enter fullscreen mode

Exit fullscreen mode

Then 24 colour custom properties in :root , 24 again in .dark , and a second

@theme block that hands them to Tailwind so they become utilities:

@theme { --color-background : var ( --background ); --color-foreground : var ( --foreground ); /* ... */ --color-ring : var ( --ring ); }

Enter fullscreen mode

Exit fullscreen mode

There are 19 lines in that block and 24 tokens. The five that did not make it

are --chart-1 through --chart-5 , and this post is mostly about what happens

to a token that exists everywhere except in @theme .

A custom property is not a colour

The five chart tokens are declared in both themes, so they resolve perfectly

well at runtime.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.