Use presets to override some classes #554
-
Hello, is it possible somehow to use presets to override classes from core tailwind.config? For example, I want to have tailwind.config file that I will use as core file with classes, but on the specific project, I want to override only shadow values inside tailwind config. Tailwind config inside core :
But in the specific project I want to override these values:
I hope that you understand me :) using CRA with styled components |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey there Yes, presets is perfect for this. Here's an example of the preset usage that's working in my tests: // tailwind.config.js
const myConfigDefault = {
theme: {
boxShadow: {
1: "old-shadow",
},
},
};
module.exports = {
presets: [myConfigDefault],
theme: {
boxShadow: {
1: "new-shadow",
},
},
}; // Usage
tw`shadow-1`;
// ↓ ↓ ↓ ↓ ↓ ↓
({
"--tw-shadow": "new-shadow",
"boxShadow": "var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)"
}); Does that help? |
Beta Was this translation helpful? Give feedback.
Hey there
Yes, presets is perfect for this.
Here's an example of the preset usage that's working in my tests:
Does that help?