Skip to content
Discussion options

You must be logged in to vote

Hey! 👋

Yes, I’ve run into something similar. In my Next.js + Tailwind setup, I also had to add this snippet to globals.css in order for the default border color (based on your CSS variable --border) to take effect:

@layer base {

  • {
    @apply border-(--border);
    }
    }

From my understanding, this is kind of expected because Tailwind doesn’t automatically pick up CSS custom properties for utilities like border-* — it works with its predefined theme values unless you explicitly map your variable using @apply.

So you’re not doing anything wrong; it’s just a quirk of how Tailwind handles dynamic CSS variables vs its generated utility classes.

A few things I found helpful:

Keep this in a @layer base …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bestickley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants