Skip to content
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

Allow all Gutenberg theme support options to be defined in theme.json #26901

Closed
kjellr opened this issue Nov 11, 2020 · 15 comments
Closed

Allow all Gutenberg theme support options to be defined in theme.json #26901

kjellr opened this issue Nov 11, 2020 · 15 comments
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.

Comments

@kjellr
Copy link
Contributor

kjellr commented Nov 11, 2020

Many of Gutenberg's add_theme_support() options are already available to define in experimental-theme.json:

  • disable-custom-font-sizes
  • disable-custom-colors
  • disable-custom-gradients
  • editor-color-palette
  • editor-gradient-presets
  • editor-font-sizes
  • custom-line-height
  • custom-units
  • custom-spacing
  • experimental-link-color

The rest should be made available there as well:

  • align-wide
  • core-block-patterns (opt-out)
  • editor-styles
  • dark-editor-style
  • post-thumbnails
  • responsive-embeds
  • wp-block-styles
@kjellr kjellr added [Type] Enhancement A suggestion for improvement. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Nov 11, 2020
@oandregal
Copy link
Member

Some of these are already possible:

  • disable-custom-font-sizes => settings.typography.customFontSize
  • disable-custom-colors => settings.color.custom
  • disable-custom-gradients => settings.color.customGradient

From the convo, I presume the list of missing options should also contain: align-wide, wp-block-styles.

@oandregal oandregal mentioned this issue Nov 12, 2020
82 tasks
@kjellr
Copy link
Contributor Author

kjellr commented Nov 12, 2020

Thanks, I updated the list above. 👍

@jorgefilipecosta
Copy link
Member

I wonder if for themes with theme.json "editor-styles", and "wp-block-styles" should be true by default. These are new themes being build and it seems like they should play well with all the styles a block contains.

@kjellr
Copy link
Contributor Author

kjellr commented Nov 13, 2020

I wonder if for themes with theme.json "editor-styles", and "wp-block-styles" should be true by default.

Yeah, I think that makes sense.

@pagelab
Copy link
Contributor

pagelab commented Jan 13, 2021

It would be nice to include add_theme_support('html5', ['script', 'style']);, as the type attribute is not required in HTML5 and currently enqueued files show them by default. Reference.

@carolinan
Copy link
Contributor

I wonder if for themes with theme.json "editor-styles", and "wp-block-styles" should be true by default.

Does it make sense to have editor-styles on by default if the theme has no editor style file?

post-thumbnails The block works without theme support being enabled, but without the setting in the document sidebar. I wonder if this is already working as intended. (#22313)
It depends on how we want to convert existing featured images to blocks 🤔

@LeoSeyers
Copy link

+1 for alignement controls in theme.json (not only wide)

@devfle
Copy link
Contributor

devfle commented Aug 2, 2021

Do we need something like this the other way around? Things like the new border settings, or the margin feature can currently only be used by FSE themes.

@youknowriad
Copy link
Contributor

core-block-patterns (opt-out)
editor-styles
post-thumbnails
responsive-embeds
wp-block-styles
html5

For what reasons these are disabled by default? I mean shouldn't we take the opportunity of FSE themes (or themes with theme.json) to enable these automatically? Does it still make sense for these to be configurable, should they be opt-in or opt-out.

@kjellr
Copy link
Contributor Author

kjellr commented Oct 8, 2021

editor-styles
post-thumbnails
responsive-embeds
wp-block-styles
html5

Yeah, all of those seem like things we should enable by default for block themes.

@jasmussen
Copy link
Contributor

Fairly sure that dark-editor-style has been absorbed and retired as a separate feature.

@noisysocks
Copy link
Member

It seems then that the only action required here is to add a setting that equates to align-wide?

@carolinan
Copy link
Contributor

Isn't align-wide the layout setting? If you do not include that in theme.json, the wide and full width is not enabled.

@youknowriad
Copy link
Contributor

yes align-wide is kind of deprecated for block themes.

@youknowriad
Copy link
Contributor

Let's close this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

10 participants