Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Set text colour for file block button #290

Merged
merged 7 commits into from
Oct 24, 2022
Merged

Set text colour for file block button #290

merged 7 commits into from
Oct 24, 2022

Conversation

mikachan
Copy link
Member

This sets a text colour for the file block button, which overrides a default :visited text colour set by Core here.

Fixes #288.

@mikachan mikachan requested a review from carolinan October 21, 2022 09:57
@carolinan
Copy link
Collaborator

I tested the PR, but only in the default theme.json, not variations. The button text is always black, so when hovering over the button, the text is black over black background.

@carolinan
Copy link
Collaborator

I think it needs to be

			"core/file": {
				"elements": {
					"button": {
						":visited": {
							"color": {
								"text": "var(--wp--preset--color--contrast)"
							}
						}
					}
				}
			},

But the schema says it is invalid

@mikachan
Copy link
Member Author

Ah that's strange, all the pseudo-states seem to work in the same way as the default button for me. This is what I see on hover:

image

I don't think the visited state was included when pseudo-state support was added to theme.json.

@carolinan
Copy link
Collaborator

It was: WordPress/gutenberg#42096
But was it not added to core then?

@carolinan
Copy link
Collaborator

I can confirm it is not in the schema and needs to be added.

@mikachan
Copy link
Member Author

Ugh I'm sorry, the :visited state seems to be working well for me now. I wasn't seeing any new CSS generated for it at all, but I'm guessing it must've been my environment..

I've tested with both the latest GB trunk and just WP 6.1 RC2 (with GB plugin deactivated), and it's working for me in both. Looks like it's just the schema that needs updating for this!

@mikachan
Copy link
Member Author

I've moved the visited setting to elements.button now, for the base theme and all variations. I thought this was cleaner than adding the file block settings.

@mikachan
Copy link
Member Author

I'm going to bring this in as I believe it's the fix that @carolinan originally intended, and I'd like this included in RC3.

@mikachan mikachan merged commit e2005b0 into trunk Oct 24, 2022
@mikachan mikachan deleted the fix/file-button branch October 24, 2022 16:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider adding button visited styles
2 participants