Fix TwentyX styling issues for cart/checkout form fields (https://github.com/woocommerce/woocommerce-blocks/pull/4046)

* Fix checkbox styling in 2020 and 2017 themes by setting input font size

* 2017 button hover style fixes

* Fix editor dark inputs

* Restore dark color
This commit is contained in:
Mike Jolley 2021-04-12 11:03:36 +01:00 committed by GitHub
parent 4703f5b5fa
commit 7556d47b5c
5 changed files with 57 additions and 5 deletions

View File

@ -6,6 +6,7 @@
position: relative; position: relative;
.wc-block-components-checkbox__input[type="checkbox"] { .wc-block-components-checkbox__input[type="checkbox"] {
font-size: 1em;
appearance: none; appearance: none;
border: 2px solid $input-border-gray; border: 2px solid $input-border-gray;
border-radius: 2px; border-radius: 2px;
@ -24,6 +25,11 @@
border-color: $input-border-gray; border-color: $input-border-gray;
} }
&::before,
&::after {
content: "";
}
&:not(:checked) + .wc-block-components-checkbox__mark { &:not(:checked) + .wc-block-components-checkbox__mark {
display: none; display: none;
} }
@ -75,7 +81,8 @@
} }
.wc-block-components-checkbox__input[type="checkbox"]:checked, .wc-block-components-checkbox__input[type="checkbox"]:checked,
.has-dark-controls .wc-block-components-checkbox__input[type="checkbox"]:checked { .has-dark-controls
.wc-block-components-checkbox__input[type="checkbox"]:checked {
background-color: #fff; background-color: #fff;
border-color: var(--form--border-color); border-color: var(--form--border-color);
} }

View File

@ -67,6 +67,7 @@
-webkit-appearance: none; -webkit-appearance: none;
margin: 0; margin: 0;
} }
.wc-block-components-quantity-selector__button { .wc-block-components-quantity-selector__button {
@include reset-button; @include reset-button;
@include font-size(regular); @include font-size(regular);
@ -75,6 +76,7 @@
color: $gray-900; color: $gray-900;
font-style: normal; font-style: normal;
text-align: center; text-align: center;
text-decoration: none;
&:hover, &:hover,
&:focus { &:focus {
@ -99,10 +101,21 @@
} }
} }
} }
.wc-block-components-quantity-selector__button--minus {
> .wc-block-components-quantity-selector__button--minus {
order: 1; order: 1;
} }
.wc-block-components-quantity-selector__button--plus {
> .wc-block-components-quantity-selector__button--plus {
order: 3; order: 3;
} }
} }
.theme-twentyseventeen {
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
&:hover,
&:focus {
background: none transparent;
}
}
}

View File

@ -1,8 +1,9 @@
.wc-block-components-form .wc-block-components-select,
.wc-block-components-select { .wc-block-components-select {
height: 3em; height: 3em;
position: relative; position: relative;
label { label.components-custom-select-control__label {
@include reset-typography(); @include reset-typography();
@include font-size(regular); @include font-size(regular);
line-height: 1.375; // =22px when font-size is 16px. line-height: 1.375; // =22px when font-size is 16px.
@ -70,6 +71,8 @@
text-transform: none; text-transform: none;
white-space: nowrap; white-space: nowrap;
width: 100%; width: 100%;
opacity: initial;
border-radius: 4px;
.has-dark-controls & { .has-dark-controls & {
background: $input-background-dark; background: $input-background-dark;
border-color: $input-border-dark; border-color: $input-border-dark;
@ -141,3 +144,19 @@
} }
} }
} }
.theme-twentyseventeen {
// Extra classes for specificity.
&.theme-twentyseventeen.theme-twentyseventeen {
.components-custom-select-control__button {
background-color: $select-dropdown-light;
color: $input-text-active;
}
.has-dark-controls {
.components-custom-select-control__button {
background-color: $select-dropdown-dark;
color: $input-text-dark;
}
}
}
}

View File

@ -1,3 +1,4 @@
.wc-block-components-form .wc-block-components-text-input,
.wc-block-components-text-input { .wc-block-components-text-input {
position: relative; position: relative;
margin-top: em($gap-large); margin-top: em($gap-large);
@ -56,11 +57,18 @@
&:focus { &:focus {
background-color: #fff; background-color: #fff;
color: $input-text-active;
} }
.has-dark-controls & { .has-dark-controls & {
background-color: $input-background-dark; background-color: $input-background-dark;
border-color: $input-border-dark; border-color: $input-border-dark;
color: $input-text-dark; color: $input-text-dark;
&:focus {
background-color: $input-background-dark;
color: $input-text-dark;
}
} }
} }

View File

@ -56,6 +56,11 @@
.theme-twentytwenty .wc-block-components-panel__button, .theme-twentytwenty .wc-block-components-panel__button,
.theme-twentyseventeen .wc-block-components-panel__button { .theme-twentyseventeen .wc-block-components-panel__button {
background: transparent; background: none transparent;
color: inherit; color: inherit;
&.wc-block-components-panel__button:hover,
&.wc-block-components-panel__button:focus {
background: none transparent;
}
} }