greghunt / tailpress

Seamlessly add Tailwind to your WordPress site without any build steps.
4 stars 2 forks source link

Add Tailwind to iframes in Admin (mobile preview, site editting, etc) #11

Open greghunt opened 1 year ago

Triloworld commented 11 months ago

For documentation: https://github.com/WordPress/gutenberg/pull/49655#issuecomment-1520252345

dz0ny commented 1 month ago

This is a small patch that enables rendering FSE.

    public function __construct(Plugin $plugin)
    {

        add_action(
            'enqueue_block_assets',
            array($this, 'enqueue_scripts_public')
        );
    }

    public function enqueue_scripts_public(){
        $scripts = $this->plugin->get_admin_scripts();
        $name = $this->plugin->name . '_twind_admin';
        wp_enqueue_script($name, $scripts['main']);
        wp_add_inline_script($name, $scripts['setup']);
    }