Open
Description
Terms
- I have read the guidelines for Contributing to Roots Projects
- This request is not a duplicate of an existing issue
- This is not a personal support request that should be posted on the Roots Discourse community
Summary
I would appreciate guidance on Tailwind & Wordpress blocks in the Roots Docs, and best practices about classes in content.
I added an add_action in setup.php, to put page content into a folder in views
add_action('save_post', function ($post_id, $post) {
if($post->post_type === 'page') {
$filename = get_template_directory() . '/resources/views/content/' . $post->post_type . 's/' . $post_id . '.html';
file_put_contents($filename, $post->post_content);
}
}, 10, 2);
And I updated tailwind config include "html"
content: ['./app/**/*.php', './resources/**/*.{php,vue,js,html}'],
Motivation
Why are we doing this?
Tailwind classes added to pages will get compiled
As an added benefit, when in a dev session, assets are compiled when saving a page
What use cases does it support?
supports
yarn build & yarn dev
What is the expected outcome?
Tailwind classes in content get compiled
Potential conflicts / foreseeable issues
Potentially a large number of files and content to be parsed, especially if expanded to posts or products
Additional Context
Thank you Roots