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

Introduce "Caption" as a new element #40205

Closed
mtias opened this issue Apr 9, 2022 · 6 comments
Closed

Introduce "Caption" as a new element #40205

mtias opened this issue Apr 9, 2022 · 6 comments
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json

Comments

@mtias
Copy link
Member

mtias commented Apr 9, 2022

Hinted at in #34574.

It's time to move towards introducing some new elements to the Elements API. Captions are used across blocks (images, embeds, videos, etc) and a prime example of what we have called elements in the global styles' sense. Right now core registers some default styles for captions through wp-block-styles, which we should transition to this system.

Captions would become a new element alongside Links in the interface, and can be defined globally or per block type.

At the block level, we should probably introduce a new component to encapsulate the definition, class, CSS variables, etc. Blocks can use this component like they use RichText (it'd be a wrapper around RichText anyways).

@mtias mtias added [Feature] Block API API that allows to express the block paradigm. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Apr 9, 2022
@scruffian
Copy link
Contributor

Related: #41966

@scruffian
Copy link
Contributor

This was closed by #41140

@mtias
Copy link
Member Author

mtias commented Sep 10, 2022

@scruffian can we add a follow up to add the UI for it in global styles?

@MaggieCabrera
Copy link
Contributor

I created the issue here

@mtias
Copy link
Member Author

mtias commented Sep 12, 2022

Thanks!

@aaronrobertshaw
Copy link
Contributor

I'm a bit late to this party but thought it worth noting that while #44094 introduces UI controls for the new caption element, it does differ a little from what the RichText component for individual block captions currently offers.

At the block level, we should probably introduce a new component to encapsulate the definition, class, CSS variables, etc. Blocks can use this component like they use RichText (it'd be a wrapper around RichText anyways).

This part of the issue suggests to me that we still need to address the gaps and this isn't fully closed?

Things that can be configured through the element API and Global Styles (as of #44094) but not at the individual block level are:

  • Font family
  • Font size
  • Line height
  • Font weights other than bold or normal

A standalone block for captions might be worth revisiting. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
Projects
None yet
Development

No branches or pull requests

4 participants