admin管理员组文章数量:1130349
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
- 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
1 Answer
Reset to default 1You 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.
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
- 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
1 Answer
Reset to default 1You 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.
本文标签: cssIf I dequeue Gutenberg Stylesheet will that have any effect on WordPress 501
版权声明:本文标题:css - If I dequeue Gutenberg Stylesheet will that have any effect on WordPress 5.0.1? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749086938a2313922.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论