{"id":163,"hash":"5dd413ab4b9b0f0a8f092fc16c98048759f9863144de49435d0001a181e45eb3","pattern":"Cannot apply unknown utility class `border-border` - the `border-border` class does not exist per TailwindCSS; even if I manually define it as a class","full_message":"The border-border class does not exist. If border-border is a custom class, make sure it is defined within a @layer directive.\n\nglobals.css\n\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n \n@layer base {\n  * {\n    @apply border-border; /* [ERROR]: Cannot apply unknown utility class `border-border` */\n  }\n  body {\n    @apply bg-background text-foreground;\n  }\n}\n\nI don't know how this was happening. This was a React Next App with TailwindCSS the problem was happening in tailwind.config.js or globals.css.","ecosystem":"npm","package_name":"reactjs","package_version":null,"solution":"This is the global stylesheet for shadcn/ui & shadcn/vue. For those viewing this in 2025, the issue is likely that you're using Tailwind v4 with a tailwind.config.js file. ShadcnUI hasn't yet updated its installation documentation.\n\nThe issue is that Tailwind v4.0 no longer detects Javascript config files automatically, but supports them for backward compatibility.\n\nTo fix it, just replace:\n\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\nwith:\n\n@import \"tailwindcss\";\n@config \"../../tailwind.config.js\";\n\nThe full file in this case is:\n\n@import \"tailwindcss\";\n@config \"../../tailwind.config.js\";\n\n@layer base {\n  * {\n    @apply border-border;\n  }\n  body {\n    @apply bg-background text-foreground;\n  }\n}\n\nConveniently, Tailwind v4.0 doesn't require all those @tailwind directives and loads with a simple @import \"tailwindcss\". For more information on upgrading check tailwindcss.com/docs/upgrade-guide. In the meantime, I'm sure shadcn/ui and shadcn/vue projects will fix this, and add updated installation instructions for TailwindCSS version 4.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/77443221/cannot-apply-unknown-utility-class-border-border-the-border-border-class-d","votes":57,"created_at":"2026-04-19T04:41:25.077509+00:00","updated_at":"2026-04-19T04:51:06.849429+00:00"}