$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>css - If I dequeue Gutenberg Stylesheet will that have any effect on WordPress 5.0.1?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

css - If I dequeue Gutenberg Stylesheet will that have any effect on WordPress 5.0.1?

matteradmin8PV0评论

In updating to Wordpress 5.0.1 I noticed when examining my Sources from Chrome's DevTools that a new file and directory were created, a stylesheet named style.min.css in a dist directory:

/wp-includes/css/dist/block-library
  style.min.css

From research and memory there is wp_dequeue_style() and I can do:

add_action('wp_print_styles',function() {
    wp_dequeue_style('wp-block-library');
},100);

that removes the file from Source but I'm unsure on a custom theme if there are any adverse effects or another way to remove the file? Is there another way to remove Gutenberg CSS from WordPress 5.0.1 and if I dequeue will that cause any problems?

Here are some Github issues I found when searching:

  • How to remove gutenberg CSS
  • Column Block CSS Media Query

In updating to Wordpress 5.0.1 I noticed when examining my Sources from Chrome's DevTools that a new file and directory were created, a stylesheet named style.min.css in a dist directory:

/wp-includes/css/dist/block-library
  style.min.css

From research and memory there is wp_dequeue_style() and I can do:

add_action('wp_print_styles',function() {
    wp_dequeue_style('wp-block-library');
},100);

that removes the file from Source but I'm unsure on a custom theme if there are any adverse effects or another way to remove the file? Is there another way to remove Gutenberg CSS from WordPress 5.0.1 and if I dequeue will that cause any problems?

Here are some Github issues I found when searching:

  • How to remove gutenberg CSS
  • Column Block CSS Media Query
Share Improve this question edited Dec 18, 2018 at 14:13 user9447 asked Dec 18, 2018 at 3:44 user9447user9447 1,7927 gold badges30 silver badges55 bronze badges 3
  • In the admin, or the front-end? Why do you want to dequeue it? It's presumably loaded for a reason. – Jacob Peattie Commented Dec 18, 2018 at 3:48
  • @JacobPeattie By that logic you're also ok with using emojicons? I haven't played or learned much of Gutenberg yet which is why I asked. – user9447 Commented Dec 18, 2018 at 3:50
  • 1 If you're going to use the classic editor, it should be safe to remove it. But sooner or later you need to enqueue it again, since the classic editor won't be a permanent solution. – Johansson Commented Dec 18, 2018 at 3:52
Add a comment  | 

1 Answer 1

Reset to default 1

You probably do not need to dequeue it if you do not use gutenberg. It should be used only with the block editor. Obviously there might be bugs, but if you are using the classic editor plugin to avoid the gutenberg **** you can open a bug report with it.

But there is nothing wrong with dequeuing it if you decide to disable gutenberg "by hand", or you can not be bothered to wait until relevant bugs are fixed.

A notice regarding the future is probably needed here. As wordpress wants to have everything as blocks this CSS might get reused in other parts of the system in the future, therefor as always, be careful in which context you dequeue the CSS.

Post a comment

comment list (0)

  1. No comments so far