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

Add: Twilight style variation #232

Open
wants to merge 10 commits into
base: trunk
Choose a base branch
from
Open

Conversation

beafialho
Copy link
Contributor

Description

Adds twilight style variation

Screenshots

Captura de ecrã 2024-09-05, às 17 06 34

Captura de ecrã 2024-09-05, às 17 06 17

Captura de ecrã 2024-09-05, às 17 06 24

Copy link

github-actions bot commented Sep 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: beafialho <[email protected]>
Co-authored-by: carolinan <[email protected]>
Co-authored-by: aaronrobertshaw <[email protected]>
Co-authored-by: richtabor <[email protected]>

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

@carolinan
Copy link
Contributor

carolinan commented Sep 6, 2024

Similar to the dusk variation, the outline button, when placed in the section style with the light background, has no visible border 🤔

@beafialho
Copy link
Contributor Author

Similar to the dusk variation, the outline button, when placed in the section style with the light background, has no visible border

Is there a solution for this?

@carolinan
Copy link
Contributor

carolinan commented Sep 11, 2024

I think the border needs to be set to the same color as the button text.

@beafialho
Copy link
Contributor Author

I think the border needs to be set to the same color as the button text.

I believe I don't know how to do that in each section style. If someone can, I appreciate the help.

@carolinan
Copy link
Contributor

I did not know about it either before Rich suggested it here: #142 (comment)

@carolinan
Copy link
Contributor

carolinan commented Sep 12, 2024

Oh typically, variations inside variations inside variations 🤯 do not work:
image
Are there any plans to add this in 6.7 @aaronrobertshaw ?


I think the best alternative, is for all outline buttons in the twilight variation to have the border set to "currentColor".

But that would mean that on top of style 2, the outline button would have an orange border:
image

"core/button": {
				"spacing": {
					"padding": {
						"bottom": "4px",
						"left": "14px",
						"right": "14px",
						"top": "4px"
					}
				},
				"typography": {
					"fontSize": "var(--wp--preset--font-size--large)",
					"letterSpacing": "0px",
					"textTransform": "uppercase"
				},
				"variations": {
					"outline": {
						"spacing": {
							"padding": {
								"bottom": "4px",
								"left": "14px",
								"right": "14px",
								"top": "4px"
							}
						},
						"border": {
							"color": "currentColor"
						}
					}
				}
			},



@aaronrobertshaw
Copy link

Thanks for the ping 👍

Oh typically, variations inside variations inside variations 🤯 do not work:

That was a conscious decision made early on in the section styling explorations. Essentially there are a lot of inception-like issues that can occur. It also greatly complicates sanitization and any future Global Styles UI for users to customize block style variations or create their own.

Are there any plans to add this in 6.7 @aaronrobertshaw ?

None for 6.7.

I'd have also thought there were no plans to support it for any future release at this stage. Of course, with enough valid use cases and some creative design ideas for the Global Styles IA and UI, any of this can be revisited.

The case of outline buttons is a tricky one. On one hand they are a block style variation like the one you are trying to create. Variations are supposed to be able to be applied in a nested fashion rather than "styled in a nested fashion" if that makes sense. I can definitely see the argument for how you are trying to accomplish this but unfortunately, I don't have any better ideas than the one Carolina shared off the top of my head.

@carolinan
Copy link
Contributor

Thank you for the quick response.

@carolinan
Copy link
Contributor

carolinan commented Sep 12, 2024

Without very careful styling, these combinations can quickly become an accessibility problem. It is not unique to this style but also the default.

One thing I have thought about is that if the theme has 5 section styles, there is no way to turn them off.
Just as an example, maybe in the twilight variation, I only wanted to have 3 section styles.
Or maybe I need 7.

@aaronrobertshaw
Copy link

One thing I have thought about is that if the theme has 5 section styles, there is no way to turn them off.

The ability to deregister a style variation was touched on a few times during the initial iterations on this feature. There are some complications to this around potential merging and filtering of theme.json data as well as block style registration via register_block_style with style_data supplied.

I think this is something that we want to be able to support but it needs more time and exploration. It won't be something that makes it for 6.7 but hopefully progress can be made in the somewhat near future though.

@richtabor
Copy link
Member

Without very careful styling, these combinations can quickly become an accessibility problem.

Each theme style variation should account for each section style individually, and support the same number as the parent.

@carolinan
Copy link
Contributor

carolinan commented Sep 13, 2024

They do, if the border on the outline variation is set to the current color, a style that @beafialho approved yesterday.
So this PR can now be merged.

The remaining exception is the hover style for the outline variation. And as you know, this is a limitation in the editor/ global styles.
I spent about 4 hours on looking into how to solve WordPress/gutenberg#55359 but was not able to.

@richtabor
Copy link
Member

They do, if the border on the outline variation is set to the current color, a style that @beafialho approved yesterday.
So this PR can now be merged.

I question if we should include full style variations. That's double to maintain (the color set, typography set along with the combined style). If anything perhaps it's the very last thing we do; to try to reduce the burden.

@carolinan
Copy link
Contributor

carolinan commented Sep 14, 2024

Without the combined variations, there is no way to preview and highlight the combinations that Bea has created.

I would like to see atleast some of the combined / full variations to be included before WCUS contributor day on Tuesday since there are two table leads who have notified that they are planning to test the theme.

@juanfra juanfra added the [Priority] High Used to indicate top priority items that need quick attention label Sep 16, 2024
Copy link

github-actions bot commented Sep 20, 2024

Preview changes

You can preview these changes by following the link below:

I will update this comment with the latest preview links as you push more changes to this PR.
⚠️ Note: The preview sites are created using WordPress Playground. You can add content, edit settings, and test the themes as you would on a real site, but please note that changes are not saved between sessions.

@carolinan
Copy link
Contributor

In style 1, The white text color on top of the orange background has a too low contrast ratio:
FFFFFF and FF6442 has contrast ratio 2.93:1, it needs to be 4.5:1 (3:1 for large text).

@carolinan
Copy link
Contributor

carolinan commented Sep 20, 2024

If the color was changed to base, it would pass the contrast requirements. It does not in my opinion look as nice but Other options would mean changing the palette colors.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Style Variations [Priority] High Used to indicate top priority items that need quick attention
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants