Replies: 1 comment
-
For anybody wondering, as of now, Tailwind doesn't provide any API to achieve this. But you can achieve this using CSS variables (mostly to gain proper specificity): html {
--border-color: #d4d4d4; /* neutral.300 */
&.dark {
--border-color: #282828; /* neutral.800 */
}
} Then, in your Tailwind config: export default {
theme: {
extend: {
borderColor: {
DEFAULT: 'var(--border-color)'
}
}
}
} Nothing else I found online worked because it created an insanely high specificity selector, making it impossible to override border colors on a component level. This above does work well. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm current using borderColor option in tailwind.config.js to change the default color for my entire website, but I missed a dark mode option to set the default color for dark mode.
Beta Was this translation helpful? Give feedback.
All reactions