Skip to content

Commit

Permalink
Fix visibility of WooCommerce checkboxes and radios (#598)
Browse files Browse the repository at this point in the history
* Fix visibility of checkboxes and radios

* tweak

* Remove & .selector in WooCommerce scss files
  • Loading branch information
EvanHerman authored Nov 16, 2020
1 parent ef40958 commit 03a0739
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 115 deletions.
26 changes: 13 additions & 13 deletions .dev/assets/shared/css/woocommerce/blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@

.wp-block-woocommerce-all-reviews {

& .wc-block-sort-select__select {
.wc-block-sort-select__select {
-moz-appearance: none;
-webkit-appearance: none;
display: inline;
padding: 5px 10px !important;
width: auto;
}

& .wc-block-review-list {
.wc-block-review-list {
padding-left: 0;

& .wc-block-review-list-item__item {
.wc-block-review-list-item__item {
margin: 0 0 40px;

&:last-child {
margin: 0;
}

& .wc-block-review-list-item__rating__stars span::before {
.wc-block-review-list-item__rating__stars span::before {
color: var(--go--color--primary);
color: var(--go--hyperlink--color--text, var(--go--color--primary));
}
Expand All @@ -48,24 +48,24 @@ h2 + .wc-block-grid {

.wc-block-grid {

& .wc-block-grid__product-rating {
.wc-block-grid__product-rating {
margin-bottom: 1em;

& .star-rating span::before {
.star-rating span::before {
color: var(--go--color--primary);
color: var(--go--hyperlink--color--text, var(--go--color--primary));
}
}

& .wc-block-grid__product-link {
.wc-block-grid__product-link {
text-decoration: none;
}

& .wc-block-grid__product-image {
.wc-block-grid__product-image {
margin-bottom: 0;
}

& .wc-block-grid__product-onsale {
.wc-block-grid__product-onsale {
background-color: transparent;
border-radius: unset;
display: inline-block;
Expand All @@ -80,20 +80,20 @@ h2 + .wc-block-grid {
width: unset;
}

& li .price {
li .price {
margin: 0.5em 0;

& + .wc-block-grid__product-add-to-cart {
+ .wc-block-grid__product-add-to-cart {
margin-top: 1em;
}
}

& ul {
ul {
justify-content: space-between;
max-width: 100%;
width: 100%;

& li {
li {
margin: 0;
}
}
Expand Down
26 changes: 13 additions & 13 deletions .dev/assets/shared/css/woocommerce/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ body {
&.woocommerce-page {

/* Primary Button */
& #respond input#submit.alt,
& .button.alt,
& .button {
#respond input#submit.alt,
.button.alt,
.button {
@include button;

&:hover,
Expand All @@ -16,19 +16,19 @@ body {
}
}

& .button.disabled,
& .button.alt.disabled,
& .button.disabled:hover,
& .button.alt.disabled:hover,
& .woocommerce button.button:disabled,
& .woocommerce button.button:disabled[disabled] {
.button.disabled,
.button.alt.disabled,
.button.disabled:hover,
.button.alt.disabled:hover,
.woocommerce button.button:disabled,
.woocommerce button.button:disabled[disabled] {
@include button;
}

/* Secondary Button */
& #respond input#submit,
& .button,
& .wp-block-button__link.add_to_cart_button {
#respond input#submit,
.button,
.wp-block-button__link.add_to_cart_button {
@include button;

&:hover,
Expand Down Expand Up @@ -66,7 +66,7 @@ body {
}
}

& .widget_shopping_cart a.wc-forward {
.widget_shopping_cart a.wc-forward {
@include button;

&:hover,
Expand Down
18 changes: 9 additions & 9 deletions .dev/assets/shared/css/woocommerce/cart.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ body {

&.woocommerce-cart {

& .coupon {
.coupon {
display: flex;

& #coupon_code {
#coupon_code {
padding: var(--go-input--padding--y) var(--go-input--padding--x);
width: auto !important;
}
}

& td.product-remove a {
td.product-remove a {
color: var(--go--color--primary) !important;
margin: 0 auto;

Expand All @@ -21,23 +21,23 @@ body {
}
}

& table.cart th,
& table.cart td {
table.cart th,
table.cart td {
text-align: center;
}

& .product-thumbnail img {
.product-thumbnail img {
width: 150px;
}

& .cart-empty-icon {
.cart-empty-icon {
margin: 0 auto;
max-width: 75px;
text-align: center;
width: 100%;
}

& .return-to-shop {
.return-to-shop {
margin-top: 1em;
text-align: center;
}
Expand All @@ -47,7 +47,7 @@ body {
&.woocommerce,
&.woocommerce-page {

& .input-text {
.input-text {
width: 180px;
}
}
Expand Down
1 change: 1 addition & 0 deletions .dev/assets/shared/css/woocommerce/checkbox.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*! WooCommerce: Checkbox */
.woocommerce-page input[type="checkbox"] {
appearance: checkbox;
opacity: 1;
}

.woocommerce .woocommerce-form-login .woocommerce-form-login__rememberme {
Expand Down
4 changes: 2 additions & 2 deletions .dev/assets/shared/css/woocommerce/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
.comment-form-cookies-consent {
position: relative;

& input[type="checkbox"] {
input[type="checkbox"] {
display: none;
}
}
Expand All @@ -195,7 +195,7 @@
border: none;
padding: 0;

& legend {
legend {
border-top: 1px solid var(--go-input--border-color, var(--go-heading--color--text));
display: block;
margin: 0 0 1.5rem;
Expand Down
2 changes: 1 addition & 1 deletion .dev/assets/shared/css/woocommerce/notice.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
top: inherit;
z-index: 9998;

& a {
a {
color: var(--go--color--white);
text-decoration: underline;

Expand Down
18 changes: 9 additions & 9 deletions .dev/assets/shared/css/woocommerce/pagination.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
.woocommerce nav.woocommerce-pagination {
text-align: center;

& ul,
& ul li {
ul,
ul li {
border: none;
}

& ul li {
ul li {

& a,
& span {
a,
span {
border-bottom: 0;
font-weight: 700;
margin: 0 1px;
Expand Down Expand Up @@ -41,8 +41,8 @@
}
}

& .prev,
& .next {
.prev,
.next {
font-size: 1rem;
position: relative;
text-indent: -9999px;
Expand All @@ -59,11 +59,11 @@
}
}

& .next {
.next {
margin-left: 0.25rem;
}

& .prev {
.prev {
margin-right: 0.25rem;

&::before {
Expand Down
20 changes: 10 additions & 10 deletions .dev/assets/shared/css/woocommerce/product.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
}

/* Avoid last child bottom margin */
& .wc-block-grid__product-link,
& .woocommerce-loop-product__link {
.wc-block-grid__product-link,
.woocommerce-loop-product__link {
display: block;

& > *:last-child {
> *:last-child {
margin-bottom: 0;
}
}
Expand Down Expand Up @@ -108,7 +108,7 @@ table.variations tbody tr:nth-child(odd) {
display: block;
width: 100%;

& label {
label {
margin-bottom: 0;
padding: 0;
}
Expand All @@ -125,30 +125,30 @@ table.variations tbody tr:nth-child(odd) {
/* Input qty and add to cart button when HAS variations */
.cart.variations_form {

& .single_variation_wrap {
.single_variation_wrap {

& .woocommerce-variation-add-to-cart {
.woocommerce-variation-add-to-cart {
align-items: center;
display: flex;
justify-content: center;

& .quantity {
.quantity {
flex: 1;

& input {
input {
margin-bottom: 0;
padding: var(--go-input--padding--y) 36px var(--go-input--padding--y) var(--go-input--padding--x);
width: 100%;
}
}

& button[type="submit"] {
button[type="submit"] {
flex: 1;
margin-right: 1em;
}
}

& .woocommerce-variation-price {
.woocommerce-variation-price {
margin: 0 0 1.5rem;
}
}
Expand Down
15 changes: 12 additions & 3 deletions .dev/assets/shared/css/woocommerce/radio.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
.woocommerce-page {

& .wc_payment_methods {
.wc_payment_methods,
.woocommerce-shipping-methods {

& input[name="payment_method"] {
input[name="payment_method"],
.shipping_method {
display: none;
}

& label {
label {
@include checkbox-radio-label;
position: relative;

Expand All @@ -21,4 +23,11 @@
}
}
}

.woocommerce-shipping-methods {

label::before {
top: 3px;
}
}
}
Loading

0 comments on commit 03a0739

Please sign in to comment.