-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
✨ Tailwind v4 #3208
base: main
Are you sure you want to change the base?
✨ Tailwind v4 #3208
Conversation
Thank you for testing it out and the feedback! Not yet sure how to tackle the iframe'd editor's CSS in dev mode |
Pushed some updates this weekend that have improved the integration between Vite's dev server and the iframed block editor a bit for updates made to
|
I thought we could get away with this: /**
* Add Vite's HMR client to iframed block editor.
*
* @return void
*/
add_action('enqueue_block_assets', function () {
if (! is_admin() || ! get_current_screen()?->is_block_editor()) {
return;
}
if (! Vite::isRunningHot()) {
return;
}
$devUrl = trim(File::get(Vite::hotFile()));
wp_enqueue_script_module('vite-hmr', $devUrl.'/@vite/client');
}); But it looks like A workaround: wp_register_script('vite-hmr', false);
wp_enqueue_script('vite-hmr');
wp_add_inline_script('vite-hmr', "
if (window.self !== window.top) {
const script = document.createElement('script');
script.type = 'module';
script.src = '{$devUrl}/@vite/client';
document.head.appendChild(script);
}
"); |
Ref https://tailwindcss.com/blog/tailwindcss-v4