Tailpress Child Theme #168
Replies: 4 comments 7 replies
-
Hello Jeffrey, I am circling back to see if you had any thoughts on this. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
@sm2dev Not sure if this answer is still relevant but @jeffreyvr had this to say about Child Themes last year: #44 (comment) |
Beta Was this translation helpful? Give feedback.
-
What you could do is:
module.exports = {
content: [
'../tailpress/*.php',
'../tailpress/**/*.php',
'../tailpress/resources/css/*.css',
'../tailpress/resources/js/*.js',
'../tailpress/safelist.txt',
'./*.php',
'./**/*.php',
'./resources/css/*.css',
'./resources/js/*.js',
'./safelist.txt'
],
function tailpress_child_enqueue_scripts()
{
$theme = wp_get_theme();
wp_dequeue_style('tailpress', get_template_directory_uri() . 'css/app.css');
wp_dequeue_script('tailpress', get_template_directory_uri() . 'js/app.js');
wp_enqueue_style('tailpress-child', tailpress_asset('css/app.css'), array(), $theme->get('Version'));
wp_enqueue_script('tailpress-child', tailpress_asset('js/app.js'), array(), $theme->get('Version'));
}
add_action('wp_enqueue_scripts', 'tailpress_enqueue_scripts');
@import "../../../tailpress/resources/css/app.css"; Do the same for @import "../../../tailpress/resources/css/editor-style.css"; And app.js import '../../../tailpress/resources/js/app.js' This would give you a child theme that inherits the Tailwind classes from the parent, as well the parent's javascript. It also allows you to set custom fonts, colors etc.. Drawbacks; there is some duplication since you are copying I haven't tested it thoroughly, but here is a quick demo: https://github.com/jeffreyvr/tailpress-child-theme-demo |
Beta Was this translation helpful? Give feedback.
-
When using the example code the backend complains it cannot find the main theme. I am positive it is there. What else should I run after configuring the child theme? |
Beta Was this translation helpful? Give feedback.
-
Hi,
Could you advise on the steps needed to create a child theme that would be used to change the colors that Tailwind uses? I am able to change the color palette in the blocks via the child theme's theme.json file, but I am having trouble connecting the child theme's theme.json file to replace the colors that the Tailwind classes use (ex:
text-primary
is still outputting the parent theme.json color instead of the child theme.json color).Thank you.
Beta Was this translation helpful? Give feedback.
All reactions