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

Feat: Add new typography options for figcaption on image block [#34643] #47424

Closed
wants to merge 6 commits into from

Conversation

hbhalodia
Copy link
Contributor

What?

  • Adds new typography options that can be used to set fig captions.

Why?

How?

  • Added experimental typography options as supports to image block.

Testing Instructions

  • Testing how PR is affecting the blocks is being added in below screencast.

Testing Instructions for Keyboard

  • NIL

Screenshots or screencast

ImageBlockCaption.webm

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jan 25, 2023
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @hbhalodia! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@hbhalodia hbhalodia marked this pull request as ready for review January 25, 2023 16:19
@skorasaurus skorasaurus added [Feature] Media Anything that impacts the experience of managing media [Block] Image Affects the Image Block [Block] Gallery Affects the Gallery Block - used to display groups of images labels Feb 15, 2023
@hbhalodia
Copy link
Contributor Author

Hi @Mamaduka, I have added only for the font Size and a selector. Can you please review the PR. Thanks.

Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The codewise looks good.

@richtabor, I would appreciate 2nd opinion, if having a Typography option on Image block makes sense.

cc @scruffian.

@richtabor
Copy link
Member

richtabor commented Feb 17, 2023

@richtabor, I would appreciate 2nd opinion, if having a Typography option on Image block makes sense.

No, I don't think it does.

We do have the ability to style captions within theme.json — that should probably be exposed within Global Styles in the Elements panel instead.

"styles": {
	"elements": {
		"caption": {
			"color": {
				"text": "#111111"
			},
			"typography": {
				"fontSize": "0.8rem",
				"lineHeight": ".7",
				"textTransform": "uppercase"
			}
		}
	}
}

CleanShot 2023-02-17 at 13 28 33

@scruffian
Copy link
Contributor

Can you give a context when this would be useful?

@richtabor
Copy link
Member

Can you give a context when this would be useful?

The idea is to be able to set a different caption font size on a per-image basis.

I don't think we should have font size for captions on individual image blocks — but rather expose figcaption element styling within Global Styles.

@richtabor
Copy link
Member

@Mamaduka I think we're good to close this out, now that caption support is added to Global Styles via #49141?

I don't foresee further implementing image-specific caption size controls. Site-wide control is pretty nice in #49141 though.

@Mamaduka
Copy link
Member

I'll close the PR. Thanks for contributing, @hbhalodia!

@Mamaduka Mamaduka closed this Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Block] Image Affects the Image Block [Feature] Media Anything that impacts the experience of managing media First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants