-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Enable theme supports automatically for FSE theme #35593
Conversation
These look good to me! // Opt-in to only load styles for rendered blocks.
add_filter( 'should_load_separate_core_block_assets', '__return_true' ); Note that this is currently done manually in the TT2 theme for example, and it should be the default out of the box |
Excellent. We should probably do an issue to keep track of what would be good defaults. Most of these features have been rolled out incrementally and opt-in, as things get settled, good defaults are crucial. |
This comment has been minimized.
This comment has been minimized.
Just personally I appreciate this, as it furthers the thing I've appreciated the most about developing a new theme: all the complexity and boilerplate code that's beeen absorbed by the system, rather than being something I have to shepard along from theme to theme. In addition to those mentioned, I have I do wonder if we can't remove |
Updated this:
|
Sweet! |
@youknowriad I realize the following use case is not something to cater to, as I'm fully aware of how hacky and temporary it is. However in case it has legitimate side effects, I wanted to share. Until I can fix them at the source, I'm loading a low-specificity stylesheet into the editor, like so:
As of this PR, that file no longer gets loaded at all. I checked to verify that the commit before this worked fine. Can you tell if this is just me doing it wrong (very possible since I know it's hacky), or whether there's a legitimate issue here? |
It's definitely related to this PR, basically this #35593 (comment) ensures that we only load block styles when the block is being used and your random block is not being loaded. I think you should consider alternatives why not just enqueue the stylesheet directly? Why does it need to be a block? |
Oh it's super hacky which is why I couched my comment so thoroughly. The sample in question was intended to load a stylesheet into the editor with minimal specificity (without the Thanks for the context. |
By default, block themes should have a few theme supports enabled by default. These are: post-thumbnails, responsive-embeds, editor-styles, html5, automatic-feed-links. This is a backport of WordPress/gutenberg#35593.
By default, block themes should have a few theme supports enabled by default. These are: `post-thumbnails`, `responsive-embeds`, `editor-styles`, `html5`, `automatic-feed-links`. This changeset backports the changes introduced in WordPress/gutenberg#35593. Props noisysocks, ocean90, youknowriad, audrasjb, hellofromTonya. Fixes #54597. Built from https://develop.svn.wordpress.org/trunk@52369 git-svn-id: http://core.svn.wordpress.org/trunk@51961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
By default, block themes should have a few theme supports enabled by default. These are: `post-thumbnails`, `responsive-embeds`, `editor-styles`, `html5`, `automatic-feed-links`. This changeset backports the changes introduced in WordPress/gutenberg#35593. Props noisysocks, ocean90, youknowriad, audrasjb, hellofromTonya. Fixes #54597. Built from https://develop.svn.wordpress.org/trunk@52369 git-svn-id: https://core.svn.wordpress.org/trunk@51961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Related #26901
We're introducing new kind of themes so it's a good opportunity to rethink what should be the defaults for themes. The idea is that ideally block themes shouldn't need to have a
functions.php
file at all to work properly. And if they need some config/theme supports, theme.json should be preferred.The latter (theme.json config) is not supported yet in this PR, it will open a new kind of issues as Right now we use theme-supports to generate the final theme.json config used as a last resort cc @oandregal while we want to do the opposite for other theme supports: theme.json informs the value of theme supports. I think the idea here would be to have a
ThemeConfig
object/model that is the result of boththeme.json
andtheme supports
at the same time, and that model should be used consistently in WP's code base instead of relying directly on theme.json file or theme supports.Questions