Make WordPress Core

Opened 4 months ago

Closed 2 months ago

#65263 closed defect (bug) (invalid)

Colors from theme.json doesnt parse for hover states

Reported by: tonnysantana Owned by:
Priority: normal Milestone:
Component: Editor Version: 7.0
Severity: normal Keywords: needs-testing
Cc: Focuses: javascript, css

Description

When using variables from the theme.json, the value is not parsed and doesn't save in the hover state for buttons.

You can test going to the site editor > styles > blocks > button & selecting a color from the theme.json in the hover state. It is not going to save unless you use a raw value that were not been saved in the theme.

https://yourwp.local/wp-admin/site-editor.php?p=%2Fstyles&section=%2Fblocks

If it somehow work with the default colors, try create a new one in the theme.json

thank you

Change History (9)

#1 @audrasjb
4 months ago

Removing trunk version as this is not going to be shipped with WP 7.0 but in the next releases.

#2 @audrasjb
4 months ago

  • Milestone Awaiting Review7.0.1
  • Version trunk

#3 @desrosj
4 months ago

  • Versiontrunk

@tonnysantana thanks for this! And welcome to Trac!

It's possible that this may require some discussion upstream in the Gutenberg repository. Could you open an issue there as well?

I'm unclear whether this is a regression specific to 7.0 or not, so re-adding the trunk version until that can be clarified.

#4 @wildworks
3 months ago

When using variables from the theme.json, the value is not parsed and doesn't save in the hover state for buttons.

I tested using the following Theme.json, and the colors were applied correctly according to the button state.

{
	"version": 3,
	"settings": {
		"appearanceTools": true,
		"layout": {
			"contentSize": "840px"
		}
	},
	"styles": {
		"blocks": {
			"core/button": {
				":hover": {
					"color": {
						"background": "#ff0000"
					}
				},
				":focus": {
					"color": {
						"background": "#00ff00"
						}
				},
				":active": {
					"color": {
						"background": "#0000ff"
					}
				}
			}
		}
	}
}

@tonnysantana It would be helpful if you could provide more details about how you define your theme.json, what specific actions you've taken, and what problems you're encountering, so that other contributors can test it.

This ticket was mentioned in Slack in #core by cbravobernal. View the logs.


2 months ago

#6 follow-up: @masteradhoc
2 months ago

Hey @tonnysantana

Thank you very much for the ticket!

We just checked it on our bug-scrub for the WP 7.0.1 milestone. We havent yet received and answer from your for the request of Aki. We'll have to move the ticket to a later milestone as we cant replicate it at the moment.

#7 @cbravobernal
2 months ago

  • Milestone 7.0.17.1

#8 in reply to: ↑ 6 @tonnysantana
2 months ago

Hi I am so sorry @masteradhoc. I am envolved in some tasks on the company that I work, and we use gutenberg a lot. I didn't have time to answer at first, and then when I did, I forgot to answer.

Thank you for taking a look on this.

I would like to let you know that I did test now and it seems to be working fine!

Replying to masteradhoc:

Hey @tonnysantana

Thank you very much for the ticket!

We just checked it on our bug-scrub for the WP 7.0.1 milestone. We havent yet received and answer from your for the request of Aki. We'll have to move the ticket to a later milestone as we cant replicate it at the moment.

Last edited 2 months ago by tonnysantana (previous) (diff)

#9 @masteradhoc
2 months ago

  • Milestone 7.1
  • Resolutioninvalid
  • Status newclosed

Thanks @tonnysantana - appreciate your response! Please let us know for any other issue you find and we're happy to take a look again.

Note: See TracTickets for help on using tickets.