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

Buttons are using wrong purple color, should be using WP primary color #37172

Closed
5 tasks done
ecgan opened this issue Mar 10, 2023 · 0 comments · Fixed by #39182
Closed
5 tasks done

Buttons are using wrong purple color, should be using WP primary color #37172

ecgan opened this issue Mar 10, 2023 · 0 comments · Fixed by #39182
Assignees
Labels
focus: product Issues related to product or product page. team: SomewhereWarm

Comments

@ecgan
Copy link
Member

ecgan commented Mar 10, 2023

Prerequisites

  • I have carried out troubleshooting steps and I believe I have found a bug.
  • I have searched for similar bugs in both open and closed issues and cannot find a duplicate.

Describe the bug

Some buttons in WooCommerce are using the wrong WooCommerce purple (pinkish) color. See examples below.

Coupons page:

image

"Update WooCommerce database" button:

image

Orders page:

Captura de ecrã 2023-03-10, às 09 16 25

Products page:

Captura de ecrã 2023-03-10, às 09 16 57

Expected behavior

Desired behavior: The buttons should be using WordPress theme's primary button color. This would also make it consistent with the use of @wordpress/component's Button component in WooCommerce Admin.

Alternative behavior: The buttons should be using the correct WooCommerce purple button color.

Actual behavior

The buttons are using the wrong WooCommerce purple (pinkish) color.

Steps to reproduce

  1. Setup a new site and go to Marketing > Coupons page: /wp-admin/edit.php?post_type=shop_coupon.
  2. See the "Create your first coupon" button color.

Additional info

Possible solution

I looked into the code and the button color comes from the following CSS:

.woocommerce-message,
.woocommerce-BlankState {
a.button-primary,
button.button-primary {
background: #bb77ae;
border-color: #a36597;
box-shadow: inset 0 1px 0 rgba( 255, 255, 255, 0.25 ), 0 1px 0 #a36597;
color: #fff;
text-shadow: 0 -1px 1px #a36597, 1px 0 1px #a36597, 0 1px 1px #a36597,
-1px 0 1px #a36597;
display: inline-block;
&:hover,
&:focus,
&:active {
background: #a36597;
border-color: #a36597;
box-shadow: inset 0 1px 0 rgba( 255, 255, 255, 0.25 ),
0 1px 0 #a36597;
}
}
}

One way to fix this is to remove the above CSS code and remove the usage of the CSS class. It seems like by doing that, the buttons would then be using WP primary color based on admin color scheme.

Screenshot below shows that CSS is disabled in dev tools and the button uses WP default primary color:

image

To change the WP Admin color scheme, go to Users > Profile page: /wp-admin/profile.php.

Screenshot below shows that CSS is disabled in dev tools and the site is using "Sunrise" admin color scheme:

image

WordPress Environment

N/A

Isolating the problem

  • I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
  • This bug happens with a default WordPress theme active, or Storefront.
  • I can reproduce this bug consistently using the steps above.
@github-actions github-actions bot added the status: awaiting triage This is a newly created issue waiting for triage. label Mar 10, 2023
@octaedro octaedro added focus: product Issues related to product or product page. and removed status: awaiting triage This is a newly created issue waiting for triage. labels Mar 10, 2023
@PanosSynetos PanosSynetos self-assigned this Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: product Issues related to product or product page. team: SomewhereWarm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants