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

Update style book headings to new design #67546

Merged
merged 3 commits into from
Dec 5, 2024

Conversation

tellthemachines
Copy link
Contributor

What?

Part of #53431.

Updates the styles of stylebook headings to match designs on that issue.

Testing Instructions

  1. With a block theme active, go to "Styles" in the site editor and select "Style book" from the Preview dropdown.
  2. Check that style book headings look as expected.

The one thing in the design that I'm not sure how to best implement is the color difference between headings and actual theme text color:

Screenshot 2024-12-04 at 11 02 01 am

Hardcoding a color in here won't work because the style book uses whatever background color is defined by the theme (and text color as well). The design seems to use always the same color, but what happens if the theme background color happens to be that exact color, or one very close to it?

We should also ensure that these headings have accessible levels of contrast, which some of the variations in the design don't seem to have.

Before I jump into making complicated JS calculations around text/background color in order to dynamically find the appropriate heading color, I just want to make sure we're all on the same page about this 😅 so:

  • Is the intention that the heading color be always a little bit lighter than text color when the background is light, and a little darker when the background is dark?
  • Do we want it to always be grey, or should it match the theme text color?

Current headings match theme text color, and I haven't changed that yet in this PR:

Screenshot 2024-12-04 at 10 58 17 am Screenshot 2024-12-04 at 10 58 28 am Screenshot 2024-12-04 at 10 58 50 am

@tellthemachines tellthemachines self-assigned this Dec 4, 2024
Copy link

github-actions bot commented Dec 4, 2024

Flaky tests detected in f97dfc8.
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/12156958045
📝 Reported issues:

@jasmussen
Copy link
Contributor

Thanks for this! I pushed some color changes so that now the headings match the mockups, while meeting contrast:

Screenshot 2024-12-04 at 10 39 58

Screenshot 2024-12-04 at 10 40 02

Doesn't have to be this PR, but can you help me follow up with a few changes to color swatches and the heading example? These two in the mockup:

Screenshot 2024-12-04 at 10 42 50

The color swatches should be shown in 4 columns, and we need a spacer or taller margin between the H1 heading and the two paragraphs in columns, so the spacing gets closer to the mockup. It can be a fixed value if need be. For the moment, they're just next to each other:
Screenshot 2024-12-04 at 10 39 58

@jasmussen
Copy link
Contributor

To clarify: on the Style landing page, the colors should be shown in 4 columns:

Screenshot 2024-12-04 at 11 17 05

On the Colors section, they are two columns, and larger:

Screenshot 2024-12-04 at 11 16 59

Copy link
Contributor

@matiasbenedetto matiasbenedetto left a comment

Choose a reason for hiding this comment

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

On my testing, the headings of the stylebook sections looked like the mockups, and the colors seemed to be clearly visible with both light and dark background colors. I think this PR is good to go.

Screencast.from.2024-12-04.14-23-00.mp4

on the Style landing page, the colors should be shown in 4 columns:

We can work on that in another PR because this one seems targeted to headings. I'll submit a PR for that here: #67597

Copy link

github-actions bot commented Dec 5, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: tellthemachines <[email protected]>
Co-authored-by: jasmussen <[email protected]>
Co-authored-by: matiasbenedetto <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@@ -216,27 +216,25 @@ export const STYLE_BOOK_IFRAME_STYLES = `
}
.edit-site-style-book__duotone-example > div:not(:first-child) {
height: 20px;
border: 1px solid #ddd;
border: 1px solid color-mix( in srgb, currentColor 10%, transparent );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oooh I didn't know we were already using color-mix! That does make things easier.

@tellthemachines tellthemachines merged commit e18605f into trunk Dec 5, 2024
64 of 66 checks passed
@tellthemachines tellthemachines deleted the try/updating-stylebook-styles branch December 5, 2024 04:23
@github-actions github-actions bot added this to the Gutenberg 19.9 milestone Dec 5, 2024
michalczaplinski pushed a commit that referenced this pull request Dec 5, 2024
Co-authored-by: tellthemachines <[email protected]>
Co-authored-by: jasmussen <[email protected]>
Co-authored-by: matiasbenedetto <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Style Book [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants