Wordpress child theme with Tailwind #2566
Replies: 2 comments
-
Check out the |
Beta Was this translation helpful? Give feedback.
-
I found this while looking for a way to handle Tailwind in a parent child theme. Some of the issues you're experiencing might be solved with But after reading your question I'm going to try something like this: Your Parent theme is probably already working fine. So the goal is to have a child theme that compiles Tailwind correctly without loosing class names correct? I think if you were to update the child themes module.exports = {
content: [
'./**/*.php',
'./assets/js/**/*.js',
'../**/*.php',
'../theme-name/assets/js/**/*.js',
],
} You'd be loading all of your CSS from the child theme which should be fine, If you've setup any tailwind conf properties that you'd want in your child theme then I think you need to move that data out and into it's own module or something. colours.js module.exports = {
'primary': '#15D234',
'secondary': '#FF3F33',
} tailwind.config.js const customColors = require("../theme-name/config/tailwind/colors");
module.exports = {
theme: {
extend: {
colors: {
...customColors,
// whatever you need for the child theme.
}
}
} |
Beta Was this translation helpful? Give feedback.
-
Hello everybody, i've a little problem..
I've a parent theme with tailwind installed on a wordpress site, css is purged and everything is working fine..
I need a child theme with Tailwind as well, but i've some problem because some classes are overriding..
For example if i have a
And the div has width: 100% even on lg desktop
Sorry for my bad english, i hope you can understand :)
Beta Was this translation helpful? Give feedback.
All reactions