Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

Try: Add 3 section styles, update Hero: Centered Heading pattern. #151

Merged
merged 3 commits into from
Aug 30, 2024

Conversation

jasmussen
Copy link
Contributor

Description

Starts initial work on adding Section styles (#142). In this case, it adds three section styles from this spot in the Figma file:

Screenshot 2024-08-29 at 11 53 00

These use what I believe is the most suggested format for section style slugs (#3), section-1, section-2, section-3.

Additionally, I made a change to the Hero Centered Heading pattern to remove the explicitly set heading color, so that it will inherit the color set on the container instead.

Screenshots

section styles

Testing Instructions

  1. Open the inserter, insert 4 instances of the Hero Centered Heading pattern.
  2. Set the 2nd to fourth pattern to styles 2-4 in the inspector.
  3. Test additional patterns (group/column based) for these section styles.

@@ -15,8 +15,8 @@
<div class="wp-block-group alignfull" style="min-height:0vh;margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--70);padding-right:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--70);padding-left:var(--wp--preset--spacing--40);">
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|40"}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group">
<!-- wp:heading {"textAlign":"center","level":1,"style":{"spacing":{"margin":{"right":"0","left":"0"},"padding":{"right":"0","left":"0"}},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}}},"textColor":"contrast"} -->
<h1 class="wp-block-heading has-text-align-center has-contrast-color has-text-color has-link-color" style="margin-right:0;margin-left:0;padding-right:0;padding-left:0">Tell your story</h1>
<!-- wp:heading {"textAlign":"center","level":1,"style":{"spacing":{"margin":{"right":"0","left":"0"},"padding":{"right":"0","left":"0"}}}} -->
Copy link
Contributor Author

@jasmussen jasmussen Aug 29, 2024

Choose a reason for hiding this comment

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

@juanfra let me know if it was intentional to explicitly set the heading color here.

Copy link
Member

Choose a reason for hiding this comment

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

No, it was not intentional.

Copy link

github-actions bot commented Aug 29, 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: jasmussen <[email protected]>
Co-authored-by: juanfra <[email protected]>
Co-authored-by: richtabor <[email protected]>
Co-authored-by: justintadlock <[email protected]>
Co-authored-by: carolinan <[email protected]>

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

"blocks": {
"core/separator": {
"color": {
"text": "color-mix(in srgb, currentColor 25%, 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.

@carolinan @beafialho Let me know if I got this right! I only found a few separator designs in the Figma.

This was referenced Aug 29, 2024
@richtabor
Copy link
Member

Additionally, I made a change to the Hero Centered Heading pattern to remove the explicitly set heading color, so that it will inherit the color set on the container instead.

We should remove explicit color application almost everywhere.

@jasmussen
Copy link
Contributor Author

We should remove explicit color application almost everywhere.

I found another instance here:
Screenshot 2024-08-29 at 14 44 19

and pushed a fix to this:

Screenshot 2024-08-29 at 14 45 46

I'm not going to push more to this branch, just to keep it focused, but I'll spin up a separate PR to fix an issue with Large Title:
Screenshot 2024-08-29 at 14 52 41

Also separate, but related question, any advice on what to do with patterns that really look best with color? Example:

color

A few things at play here:

  • That pattern really looks most compelling in the pattern browser when it has that base yellow background color. Removing it loses a lot of character. Can we default a pattern to a Section style? Guess we could, right?
  • Any idea why the link color isn't inherited? I guess that should be defined in these section styles too, yes?

@jasmussen
Copy link
Contributor Author

Actually I got that yellow pattern working pretty well. Okay to push to this branch too?

working

@jasmussen
Copy link
Contributor Author

If no-one minds, I'd like to push the pattern update, it's working quite well, and it's a great way to provide some sectional diversity in the bundled patterns:

pattern with preset section style

@carolinan
Copy link
Contributor

That pattern really looks most compelling in the pattern browser when it has that base yellow background color. Removing it loses a lot of character. Can we default a pattern to a Section style? Guess we could, right?

Yes, that was the plan and why the color wasn't added earlier.

@richtabor
Copy link
Member

Also separate, but related question, any advice on what to do with patterns that really look best with color?
Yes, that was the plan and why the color wasn't added earlier.

The background color should not be applied, but a section style can be added as a class to the pattern (any pattern).

},
"link": {
"color": {
"text": "var(--wp--preset--color--contrast)"
Copy link
Member

Choose a reason for hiding this comment

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

I think we could remove this, if we used currentColor in the parent theme.json.

Copy link
Member

Choose a reason for hiding this comment

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

Otherwise if the user changes the text color, they'll also need to also change the link color.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah, good call!

@jasmussen
Copy link
Contributor Author

The background color should not be applied, but a section style can be added as a class to the pattern (any pattern).

Nice, yeah that's what I did in this commit. Works well.

Copy link
Member

@juanfra juanfra left a comment

Choose a reason for hiding this comment

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

This is so good! Works well for me, and code lalso ooks good.

Screen.Recording.2024-08-29.at.16.03.37.mov

@jasmussen
Copy link
Contributor Author

Thanks all for the reviews and input. I'm going to let this one sit unmerged until tomorrow morning, to let this conversation settle, and I'll implement what gets decided. It won't necessarily be set in stone from that point onwards, we'll always be able to change things until the beta period, but it will be good to land this soon, so all new patterns created can use best practices as far as how to apply colors!

@juanfra juanfra mentioned this pull request Aug 29, 2024
@jasmussen
Copy link
Contributor Author

Coming back this morning, it seems like the conversation ended on the same spot that this PR landed on. So I'm going to go ahead and merge, knowing that this is still possible to change after this merge, I'll be happy to address any followups. Thanks all!

@jasmussen jasmussen merged commit c25ce24 into trunk Aug 30, 2024
10 of 12 checks passed
@jasmussen jasmussen deleted the try/section-styles branch August 30, 2024 06:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants