-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
How to remove "wp-block-navigation-link-inline-css" or "wp-block-site-logo-inline-css" #61237
Comments
@tablufc88, are you looking to remove the CSS altogether for each block, or do you just not want it inlined? |
@colorful-tones ideally I'd like to filter the styles to remove a couple of conflicts but it would be useful to know why they are showing on my page when they are not in the queue if you know? Possibly could be enqueued differently since I opted in for block-template-parts support? Got rid of these inline styles with wp_deregister_style for now. add_action('wp_enqueue_scripts', function () {
wp_deregister_style('wp-block-navigation-link');
wp_deregister_style('wp-block-navigation');
wp_deregister_style('wp-block-image');
wp_deregister_style('wp-block-list');
wp_deregister_style('wp-block-site-logo');
}); When dumping the queue: add_action('wp_enqueue_scripts', function () {
global $wp_styles;
dd($wp_styles->queue);
}); I get the following. I expected them to be in here: [
0 => "admin-bar"
1 => "wp-block-heading"
2 => "wp-block-paragraph"
3 => "wp-block-button"
4 => "wp-block-buttons"
5 => "wp-block-block"
6 => "wp-block-column"
7 => "wp-block-columns"
8 => "wp-block-library"
9 => "classic-theme-styles"
10 => "woocommerce-layout"
11 => "woocommerce-smallscreen"
12 => "woocommerce-general"
13 => "woocommerce-inline"
14 => "duplicate-post"
] Thanks for your help |
Are you all set then? Are we good to close this out? |
Kind of but if they are not enqueued, why are the styled inlined in the first place? |
I believe this is for performance improvement. You can check the post below for more details. Block-styles loading enhancements in WordPress 5.8 – Make WordPress Core |
Is it possible to remove inline styles with ids such as "wp-block-navigation-link-inline-css", "wp-block-site-logo-inline-css", "wp-block-list-inline-css" or "wp-block-image-inline-css"?
This doesn't do it - https://fullsiteediting.com/lessons/how-to-remove-default-block-styles/#h-how-to-remove-the-inline-styles-on-the-front
I'm not using an fse theme & have removed 'block-templates' support.
But I have added support for 'block-template-parts' so that I can create template parts for header and footer.
The text was updated successfully, but these errors were encountered: