Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove Gutenberg styles from the head tag #261

Closed
hanifbirgani opened this issue Jun 23, 2020 · 3 comments
Closed

Remove Gutenberg styles from the head tag #261

hanifbirgani opened this issue Jun 23, 2020 · 3 comments
Assignees

Comments

@hanifbirgani
Copy link
Contributor

Considering that Flynt disables the Gutenberg by default, we can safely remove Gutenberg styles from the head tag:

/**
 * Remove Gutenberg default styles
 */
add_action('wp_print_styles', function (): void {
    wp_dequeue_style('wp-block-library');
    wp_dequeue_style('wp-block-library-theme');
});

I can make a PR to add this to the core.

@steffenbew
Copy link
Member

True! However, Gutenberg adds even more stuff that we like to disable with a plugin like Disable Gutenberg.

@hanifbirgani
Copy link
Contributor Author

You are right about completely disabling Gutenberg by a plugin, but my suggestion only focuses on front-end codes. I think Flynt could deliver a cleaner head by removing unused Gutenberg front-end styles.

@steffenbew
Copy link
Member

Right, and I agree it makes sense. I just don't want to integrate something seemingly simple now, that could become a complex feature over time, with even more functionality to disable Gutenberg. Because that's something existing plugins provide already.
At the same time, we're also removing the editor in the theme already. That's why removing header styles in the frontend seems to be a sensible thing to do.

I would propose to add it to the removeEditor.php file directly, as it's tied to each other.

What do you think? Would you like to submit a pull request?

@steffenbew steffenbew reopened this Jun 26, 2020
@steffenbew steffenbew self-assigned this Jul 15, 2020
domtra added a commit that referenced this issue Aug 12, 2020
* Removes Gutenberg default styles on front-end #261

* refactor(RemoveEditor): remove type hints

Co-authored-by: Dominik Tränklein <dominik@bleech.de>
@domtra domtra closed this as completed Aug 12, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants