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

Site Title: Impossible to override theme.json setting with an instance of the block. #42330

Closed
scruffian opened this issue Jul 11, 2022 · 2 comments
Labels
[Block] Site Title Affects the Site Title Block Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended

Comments

@scruffian
Copy link
Contributor

Description

It is impossible to override theme.json setting with an instance of the Site Title block.

Step-by-step reproduction instructions

Add this to your theme.json file:

			"core/site-title": {
				"elements": {
					"link": {
						"color": {
							"text": {
								"ref": "styles.color.text"
							}
						}
					}
				}
			}

Now add the site title block to a template/post and modify the color of the link. The setting from theme.json takes priority still.

Screenshots, screen recording, code snippet

Screenshot 2022-07-11 at 16 23 21

Screenshot 2022-07-11 at 16 23 54

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@scruffian scruffian added [Type] Bug An existing feature does not function as intended Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Block] Site Title Affects the Site Title Block labels Jul 11, 2022
@carolinan
Copy link
Contributor

carolinan commented Aug 26, 2022

I am not able to reproduce this with current Gutenberg trunk (14.0 rc).
The resulting CSS is:

.wp-elements-8d95b57417310fb18a39fe4e32abf24b a {
    color: var(--wp--preset--color--luminous-vivid-orange); // block style selected in editor, shows
}

.wp-block-site-title a:where(:not(.wp-element-button)) {
    color: green; //theme.json site title elements link, overwritten
    text-decoration: none;
}
a:where(:not(.wp-element-button)) {
    color: var(--wp--preset--color--contrast); // theme.json root level elements link, overwritten
    text-decoration: underline;
}

I did not use ref

@scruffian
Copy link
Contributor Author

I can confirm this is no longer happening for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Site Title Affects the Site Title Block Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants