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

Read more block: add support for text color #39796

Merged
merged 1 commit into from
Mar 28, 2022
Merged

Conversation

MaggieCabrera
Copy link
Contributor

What?

This PR adds support for text color on the read more block

Why?

When this block was introduced in #37649 it was mentioned that the way to control the color would be:

because is just a link, the way to control the color of the link is through the highlight control in RichText toolbar options.

That brings a couple of problems:

  • a theme can't define a default color for all instances of the block via theme.json
  • using the highlight tool creates an extra <mark> tag that is not very semantic if we just want to change colors for stylistic reasons only

How?

I just added support for text color on block.json

Testing Instructions

On a query block with the read more block in it, try to change the text color.
It should also work if we add this to theme.json:

"core/read-more": {
    "color": {
        "text": "red"
    }
}

Screenshots or screencast

Screenshot 2022-03-28 at 10 50 13

@MaggieCabrera MaggieCabrera added [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Block] Read More Affects the Read More Block labels Mar 28, 2022
@MaggieCabrera MaggieCabrera self-assigned this Mar 28, 2022
Copy link
Contributor

@scruffian scruffian left a comment

Choose a reason for hiding this comment

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

LGTM

@MaggieCabrera MaggieCabrera changed the title updated docs Read more block: add support for text color Mar 28, 2022
Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

FYI I hadn't added text color in the initial PR because it felt a bit inconsistent settng color to a link from text color. The reasons you mention though are good ones, especially the control from theme.json.

@ntsekouras ntsekouras merged commit d4e7748 into trunk Mar 28, 2022
@ntsekouras ntsekouras deleted the add-text-color-read-more branch March 28, 2022 16:12
@github-actions github-actions bot added this to the Gutenberg 13.0 milestone Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Read More Affects the Read More Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants