Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Include classes from content in compiling #391

Open
3 tasks done
Dorf opened this issue Mar 26, 2022 · 1 comment
Open
3 tasks done

Feature Request: Include classes from content in compiling #391

Dorf opened this issue Mar 26, 2022 · 1 comment

Comments

@Dorf
Copy link

Dorf commented Mar 26, 2022

Terms

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

@retlehs retlehs transferred this issue from roots/sage Mar 26, 2022
@retlehs retlehs added the sage label Mar 26, 2022
@retlehs
Copy link
Member

retlehs commented Apr 25, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants