-
Notifications
You must be signed in to change notification settings - Fork 40
Should we include any Gutenberg Theme settings by default? #87
Comments
Also, new hooks for enqueue and dequeue Gutenberg scripts: |
my understanding is that core blocks have the potential following CSS files within them:
See Gutenberg Issue #6947 - Support adding opt-in visual styles for core blocks |
|
It's definitely hard balance what to include in theme scaffold. I personally dequeue all Gutenberg styles in the front-end, and roll my own. I have article coming on the subject, I'll try to link it here for reference. |
@samikeijonen I would be interested to read your post, because dequeuing everything would likely be my suggestion. It is a similar approach I use when doing WooCommerce sites. |
|
@colorful-tones Even that is not needed because there is <figure class="wp-block-embed-youtube alignwide wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio">
<div class="wp-block-embed__wrapper">
<iframe width="500" height="281" src="https://www.youtube.com/embed/thIlxChNYqk?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="">
</iframe>
</div>
</figure> |
@samikeijonen I do not know how I overlooked that simpler approach. Love it. I'm not entirely sold on the directory organization, but that example |
I would vote that we refrain from adding most of the Gutenberg I do think we should add something like @samikeijonen 's Uuups theme's blocks directory to Theme Scaffold, but that is not related to this ticket. |
It's definitely hard balance what to include in scaffold. Even more so because we don't know is block editor used or not. Here are my thoughts based on assumption that block editor is common workflow in upcoming 10up projects. What should go in
For most client sites I don't see us allowing any custom colors or font sizes which are added as inline styles. What should not go in
This outputs // Dequeue Core block styles.
wp_dequeue_style( 'wp-block-library' ) But that's more related to styles and issue #83. I'll comment separately in there.
What happens to editor styles and how they are rolled can be decided on project by project. I personally use PostCSS to prefix all editor styles with
This is not needed as mentioned in the comment above.
Needed only when styling dark editor experience. Perhaps
If going with Gutenberg, it's hard to see why not adding support for I vote for adding
In most cases we would overwrite or remove Core color palette and font sizes. This is also related to adding example styles. For colors I'd add only black and white since we already have them as example colors. If I have to vote, I'd say no to this. |
Thanks all! Agreed on all fronts except one it looks like. My PR currently includes these:
The one I'm on the fence on is I feel like this will prevent that super-common issue where embeds are getting cut off on smallest screens. But I agree that it may conflict with an embed being used somewhere else (like in a hero as Damon said). I think the benefit outweighs the risk here: there's a bunch of possible embeds and it's easy to forget to check that these are responsive — and it's a quite common QA issue. If you're doing something like making an embed the background for a hero, you'll be writing custom styles for that anyway and can easily work around anything that tl; did read:
But don't have agreement on:
As always, open to suggestion. |
@saltcod |
To @saltcod list I think |
Example 1: A typical oEmbed output with Gutenberg on front end:
Example 2: With
Example 3: We don't use the
Note the additional wrapping I believe Example 1 is ideal, i.e. we do not add the |
closing since we implemented something similar to this |
There are many potential Gutenberg-specific feature opt-ins that we can use: https://wordpress.org/gutenberg/handbook/extensibility/theme-support/
These should probably be revised on a project-by-project basis. That said, some of them seem like useful defaults:
Disabling custom font sizes
add_theme_support('disable-custom-font-sizes');
Disabling custom colors
add_theme_support( 'disable-custom-colors' );
Use editor styles in the WYSIWYG
add_theme_support('editor-styles');
Use responsive embeds
add_theme_support( 'responsive-embeds' );
The text was updated successfully, but these errors were encountered: