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

Footnotes: Add link, background and text color support #52897

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

mikachan
Copy link
Member

What?

This adds link, background and text color support to the Footnotes block.

Why?

Closes #51991.

How?

Updates the Footnotes block.json file so that it includes supports.color.link, and also sets __experimentalDefaultControls.background and __experimentalDefaultControls.text to true.

I added the __experimentalDefaultControls settings so that the three color controls had the same configuration as the paragraph block, where background and text are shown by default, and the user needs to click into the Color Options menu to find the link controls:

image

Testing Instructions

  1. Open the Post Editor
  2. Add some text
  3. Highlight some text, use the drop down menu in the block toolbar to add a footnote
  4. Open block settings for the footnote and set a link color
  5. The footnote arrow color should update to the correct color

Screenshots or screencast

image

@github-actions
Copy link

github-actions bot commented Jul 24, 2023

Flaky tests detected in 493c359.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5646848822
📝 Reported issues:

Copy link
Contributor

@priethor priethor left a comment

Choose a reason for hiding this comment

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

Works as expected! However, I see some layout changes when adding background color:

Grabacion.de.pantalla.2023-07-24.a.las.19.04.54.mov

@priethor priethor added the [Type] Enhancement A suggestion for improvement. label Jul 24, 2023
@ndiego
Copy link
Member

ndiego commented Jul 24, 2023

Works as expected! However, I see some layout changes when adding background color:

Yeah, we need to add typography, dimensions, and border controls in 6.4 😅

@mikachan
Copy link
Member Author

Thanks for testing!

However, I see some layout changes when adding background color:

This is the current intended behaviour when adding a background color to a block, but it can be confusing and unexpected, and there's a discussion/proposal here to improve it: #50813

@priethor
Copy link
Contributor

Thanks for pointing me to that discussion, Sarah! 👀 I was sure it was unrelated, hence the ✅

@ellatrix
Copy link
Member

Why aren't these controls added automatically to all blocks (with maybe an opt-out instead of opt-in)?

@ndiego
Copy link
Member

ndiego commented Jul 24, 2023

Why aren't these controls added automatically to all blocks (with maybe an opt-out instead of opt-in)?

As far as I'm aware, they have always been opt-in via the supports section of block.json.

@mikachan
Copy link
Member Author

Yeah, we need to add typography, dimensions, and border controls in 6.4

Should this PR add these controls, or would it be better to handle this separately in another PR? I'm happy to update this one if that works best.

@priethor
Copy link
Contributor

Since the next RC is not coming until next Wednesday, I think it's ok to merge this PR and follow up in a second one, if that's easier for you.

@mikachan
Copy link
Member Author

Thanks @priethor, will merge this now then!

@mikachan mikachan merged commit 2892f3c into trunk Jul 25, 2023
@mikachan mikachan deleted the update/footnotes-link-color branch July 25, 2023 15:19
@github-actions github-actions bot added this to the Gutenberg 16.4 milestone Jul 25, 2023
@bph bph added Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta and removed Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Jul 25, 2023
@bph
Copy link
Contributor

bph commented Jul 25, 2023

oops. Got the RC reference above wrong.
@priethor was referring to GB 16.4 RC
Nothing to see here

@richtabor
Copy link
Member

What do you think about having Text and Link as the default controls, instead of Text and Background?

Seems Text and Link would be the most used color tools.

CleanShot 2023-07-25 at 13 08 25

@ndiego
Copy link
Member

ndiego commented Jul 25, 2023

What do you think about having Text and Link as the default controls, instead of Text and Background?

Seems Text and Link would be the most used color tools.

I agree, but the current implementation is consistent with the current settings on the Paragraph block. Perhaps that needs to change too. 🤔

@richtabor
Copy link
Member

I agree, but the current implementation is consistent with the current settings on the Paragraph block. Perhaps that needs to change too. 🤔

I think that's probably fine that the paragraph block is treated a bit different. It won't always have links, where the Footnotes block will.

@mikachan
Copy link
Member Author

I've opened a follow-up PR that adds the typography, dimensions, and border controls, and also sets text and link as the default color controls: #53044. Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Footnotes Affects the Footnotes Block Needs User Documentation Needs new user documentation [Type] Enhancement A suggestion for improvement.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Footnote: changing link color doesn't update footnote arrow link color
7 participants