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

remove radius from checkout submit button (use theme button style) #2390

Merged
merged 1 commit into from
May 4, 2020

Conversation

haszari
Copy link
Member

@haszari haszari commented May 4, 2020

Fixes #2306

In Storefront, the checkout submit button had rounded corners, as opposed to square corners for cart submit and add coupon buttons.

This was because the Checkout block had css to set a border-radius for the checkout submit button - i.e. an "opinionated" style rule.

We need the blocks to work well in a range of themes. Many themes have a (valid) opinion for button styling. In this PR I've removed our opinionated border-radius to leave it up to the theme. This way the buttons in the checkout should look more consistent (same border radius) with other buttons on the site.

cc @Aljullu @garymurray for feedback on this approach - defer to current theme for button radius, since it's safe and consistent to do so.

Screenshots

Storefront – note square buttons throughout cart/checkout, consistent with other site buttons (e.g. my account):

Screen Shot 2020-05-04 at 3 22 43 PM

Screen Shot 2020-05-04 at 3 22 53 PM

Screen Shot 2020-05-04 at 3 32 38 PM

Bistro (Storefront child theme) has rounded buttons:

Screen Shot 2020-05-04 at 3 23 58 PM

Screen Shot 2020-05-04 at 3 34 28 PM

How to test the changes in this Pull Request:

  1. Publish pages with cart/checkout blocks. Add stuff to cart and view cart, checkout.
  2. Confirm buttons have consistent appearance and look appropriate within checkout.
  3. Confirm buttons are broadly consistent with other buttons on the front end of the site.

Note that this relies on the theme having sufficiently robust rules targeting all the varieties of buttons (<button> or <a> tags with various classes).

I tested in Storefront (2.5.6 RC), Bistro (Storefront child theme, Twenty Twenty, Twenty Sixteen and Twenty Sixteen. The buttons were consistent with eachother and the theme in all cases except Twenty Sixteen. (Note that there were other styling/typography/layout issues in Twenty/core themes - we should address those separately.)

In my testing I noticed that Twenty Sixteen shows the original issue – I'd view this as a theme issue (maybe worth reporting to Twenty Sixteen).

@haszari haszari requested a review from a team as a code owner May 4, 2020 03:41
@haszari haszari requested review from senadir and removed request for a team May 4, 2020 03:41
@haszari haszari self-assigned this May 4, 2020
@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2020

Size Change: -10 B (0%)

Total Size: 1.77 MB

Filename Size Change
build/style-rtl.css 15.6 kB -5 B (0%)
build/style.css 15.6 kB -5 B (0%)
ℹ️ View Unchanged
Filename Size Change
build/active-filters-frontend.js 7.38 kB 0 B
build/active-filters.js 8.03 kB 0 B
build/all-products-frontend.js 71.4 kB 0 B
build/all-products.js 18.7 kB 0 B
build/all-reviews-legacy.js 10.5 kB 0 B
build/all-reviews.js 10.7 kB 0 B
build/attribute-filter-frontend.js 16.8 kB 0 B
build/attribute-filter.js 11.5 kB 0 B
build/block-error-boundary-legacy.js 774 B 0 B
build/block-error-boundary.js 774 B 0 B
build/blocks-legacy.js 2.92 kB 0 B
build/blocks.js 2.92 kB 0 B
build/cart-frontend.js 111 kB 0 B
build/cart.js 30.6 kB 0 B
build/checkout-frontend.js 117 kB 0 B
build/checkout.js 35.2 kB 0 B
build/custom-select-control-style-legacy.js 783 B 0 B
build/custom-select-control-style.js 782 B 0 B
build/editor-legacy-rtl.css 12.6 kB 0 B
build/editor-legacy.css 12.6 kB 0 B
build/editor-rtl.css 13.6 kB 0 B
build/editor.css 13.7 kB 0 B
build/featured-category-legacy.js 146 kB 0 B
build/featured-category.js 146 kB 0 B
build/featured-product-legacy.js 9.15 kB 0 B
build/featured-product.js 9.45 kB 0 B
build/handpicked-products-legacy.js 6.96 kB 0 B
build/handpicked-products.js 7.26 kB 0 B
build/panel-style-legacy.js 773 B 0 B
build/panel-style.js 774 B 0 B
build/price-filter-frontend.js 14 kB 0 B
build/price-filter.js 10.1 kB 0 B
build/product-best-sellers-legacy.js 7.06 kB 0 B
build/product-best-sellers.js 7.34 kB 0 B
build/product-categories-legacy.js 3.2 kB 0 B
build/product-categories.js 3.19 kB 0 B
build/product-category-legacy.js 7.96 kB 0 B
build/product-category.js 8.24 kB 0 B
build/product-list-style-legacy.js 775 B 0 B
build/product-new-legacy.js 7.22 kB 0 B
build/product-new.js 7.5 kB 0 B
build/product-on-sale-legacy.js 7.57 kB 0 B
build/product-on-sale.js 7.9 kB 0 B
build/product-search-legacy.js 3.29 kB 0 B
build/product-search.js 3.53 kB 0 B
build/product-tag-legacy.js 6.15 kB 0 B
build/product-tag.js 6.42 kB 0 B
build/product-top-rated-legacy.js 7.19 kB 0 B
build/product-top-rated.js 7.47 kB 0 B
build/products-by-attribute-legacy.js 7.92 kB 0 B
build/products-by-attribute.js 8.2 kB 0 B
build/reviews-by-category-legacy.js 12.5 kB 0 B
build/reviews-by-category.js 12.7 kB 0 B
build/reviews-by-product-legacy.js 13.9 kB 0 B
build/reviews-by-product.js 14.2 kB 0 B
build/reviews-frontend-legacy.js 8.12 kB 0 B
build/reviews-frontend.js 8.93 kB 0 B
build/snackbar-notice-style-legacy.js 778 B 0 B
build/snackbar-notice-style.js 779 B 0 B
build/spinner-style-legacy.js 775 B 0 B
build/spinner-style.js 772 B 0 B
build/style-legacy-rtl.css 5.41 kB 0 B
build/style-legacy.css 5.41 kB 0 B
build/vendors-legacy.js 280 kB 0 B
build/vendors-style-legacy-rtl.css 1.65 kB 0 B
build/vendors-style-legacy.css 1.65 kB 0 B
build/vendors-style-legacy.js 105 B 0 B
build/vendors-style-rtl.css 1.65 kB 0 B
build/vendors-style.css 1.65 kB 0 B
build/vendors-style.js 106 B 0 B
build/vendors.js 366 kB 0 B
build/wc-blocks-data.js 7.06 kB 0 B
build/wc-blocks-registry.js 1.68 kB 0 B
build/wc-payment-method-cheque.js 753 B 0 B
build/wc-payment-method-paypal.js 829 B 0 B
build/wc-payment-method-stripe.js 11 kB 0 B
build/wc-settings.js 2.14 kB 0 B

compressed-size-action

Copy link
Contributor

@Aljullu Aljullu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @Aljullu @garymurray for feedback on this approach - defer to current theme for button radius, since it's safe and consistent to do so.

This approach makes sense to me. 👍

In my testing I noticed that Twenty Sixteen shows the original issue

Yeah... I see it adds a border-radius to <button> but not to .button.

@haszari
Copy link
Member Author

haszari commented May 4, 2020

I'm merging this - based on review and more consistency. @garymurray let me know if you have any feedback about this – we can adjust in a future PR if needed.

@haszari haszari merged commit 4ee1232 into master May 4, 2020
@haszari haszari deleted the fix/2306-let-theme-style-button-radius branch May 4, 2020 20:13
@garymurray
Copy link

Happy with this approach.

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.

Cart/Checkout: Apply btn on coupon component does not follow corner radius of other buttons
4 participants