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

Ensure Checkout block supports the theme-level global styles for Colors » Links #8807

Closed
Tracked by #8710
tarunvijwani opened this issue Mar 21, 2023 · 1 comment
Closed
Tracked by #8710
Assignees
Labels
block: checkout Issues related to the checkout block. focus: global styles Issues that involve styles/css/layout structure. type: enhancement The issue is a request for an enhancement.

Comments

@tarunvijwani
Copy link

Currently, the Checkout block partially supports the default theme-level global styles for Colors » Links. This issue aims to ensure that the Checkout block fully supports the default theme-level global styles.

Steps to reproduce

  1. Go to WP Admin » Apperance » Editor.
  2. Open the Styles sidebar.
  3. Open the Colors » Links settings.
  4. Adjust the color settings for Default and Hover.
  5. See that the Default color is not reflected.

Screenshots

Checkout:

Colors-Links-Checkout
@tarunvijwani tarunvijwani added the type: enhancement The issue is a request for an enhancement. label Mar 21, 2023
@tarunvijwani tarunvijwani changed the title Ensure Checkout blocks support the theme-level global styles for Colors » Links Ensure Checkout block support the theme-level global styles for Colors » Links Mar 21, 2023
@tarunvijwani tarunvijwani changed the title Ensure Checkout block support the theme-level global styles for Colors » Links Ensure Checkout block supports the theme-level global styles for Colors » Links Mar 21, 2023
@tarunvijwani tarunvijwani added block: checkout Issues related to the checkout block. focus: global styles Issues that involve styles/css/layout structure. labels Mar 21, 2023
@nielslange nielslange self-assigned this Mar 22, 2023
@nielslange
Copy link
Member

nielslange commented Mar 22, 2023

While looking into this issue, I noticed that the problem only appears when using Twenty Twenty-Three, but not when using Twenty Twenty-Two, Adventurer, Beaumont, Björk or Tove.

While investigating Twenty Twenty-Three, I noticed that the theme.json of Twenty Twenty-Three contains the following definition:

"core/post-content": {
  "elements": {
	  "link": {
      "color": {
		  "text": "var(--wp--preset--color--secondary)"
		}
	  }
  }
},

This definition results in the following CSS code:

.wp-block-post-content a:where(:not(.wp-element-button)) {

  color: var(--wp--preset--color--secondary);
}

While the Global Styles CSS looks like this:

a:where(:not(.wp-element-button)) {
  color: var(--wp--preset--color--vivid-red);
}

Due to Specificity, the CSS code of the Twenty Twenty-Three theme overwrites the Global Styles CSS code. Given that this problem not only affects the link colors within the Checkout block, but all link colors, this problem should be addressed within the Twenty Twenty-Three theme itself. Therefore, I created https://core.trac.wordpress.org/ticket/57968.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: checkout Issues related to the checkout block. focus: global styles Issues that involve styles/css/layout structure. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

No branches or pull requests

3 participants