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

Fix TwentyX styling issues for cart/checkout form fields #4046

Merged
merged 4 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion assets/js/base/components/checkbox-control/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
position: relative;

.wc-block-components-checkbox__input[type="checkbox"] {
font-size: 1em;
appearance: none;
border: 2px solid $input-border-gray;
border-radius: 2px;
Expand All @@ -24,6 +25,11 @@
border-color: $input-border-gray;
}

&::before,
&::after {
content: "";
}

&:not(:checked) + .wc-block-components-checkbox__mark {
display: none;
}
Expand Down Expand Up @@ -75,7 +81,8 @@
}

.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 {
Comment on lines +84 to +85
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this auto-formatted? I think keeping each selector in one line makes code clearer.

Suggested change
.has-dark-controls
.wc-block-components-checkbox__input[type="checkbox"]:checked {
.has-dark-controls .wc-block-components-checkbox__input[type="checkbox"]:checked {

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it looks like my IDE wrapped it due to length.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, let's merge it as-is. 👍

background-color: #fff;
border-color: var(--form--border-color);
}
Expand Down
17 changes: 15 additions & 2 deletions assets/js/base/components/quantity-selector/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
-webkit-appearance: none;
margin: 0;
}

.wc-block-components-quantity-selector__button {
@include reset-button;
@include font-size(regular);
Expand All @@ -75,6 +76,7 @@
color: $gray-900;
font-style: normal;
text-align: center;
text-decoration: none;

&:hover,
&:focus {
Expand All @@ -99,10 +101,21 @@
}
}
}
.wc-block-components-quantity-selector__button--minus {

> .wc-block-components-quantity-selector__button--minus {
order: 1;
}
.wc-block-components-quantity-selector__button--plus {

> .wc-block-components-quantity-selector__button--plus {
order: 3;
}
}

.theme-twentyseventeen {
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
&:hover,
&:focus {
background: none transparent;
}
}
}
21 changes: 20 additions & 1 deletion assets/js/base/components/select/style.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.wc-block-components-form .wc-block-components-select,
.wc-block-components-select {
height: 3em;
position: relative;

label {
label.components-custom-select-control__label {
@include reset-typography();
@include font-size(regular);
line-height: 1.375; // =22px when font-size is 16px.
Expand Down Expand Up @@ -70,6 +71,8 @@
text-transform: none;
white-space: nowrap;
width: 100%;
opacity: initial;
border-radius: 4px;
.has-dark-controls & {
background: $input-background-dark;
border-color: $input-border-dark;
Expand Down Expand Up @@ -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;
}
}
}
}
8 changes: 8 additions & 0 deletions assets/js/base/components/text-input/style.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.wc-block-components-form .wc-block-components-text-input,
.wc-block-components-text-input {
position: relative;
margin-top: em($gap-large);
Expand Down Expand Up @@ -56,11 +57,18 @@

&:focus {
background-color: #fff;
color: $input-text-active;
}

.has-dark-controls & {
background-color: $input-background-dark;
border-color: $input-border-dark;
color: $input-text-dark;

&:focus {
background-color: $input-background-dark;
color: $input-text-dark;
}
}
}

Expand Down
7 changes: 6 additions & 1 deletion packages/checkout/panel/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@

.theme-twentytwenty .wc-block-components-panel__button,
.theme-twentyseventeen .wc-block-components-panel__button {
background: transparent;
background: none transparent;
color: inherit;

&.wc-block-components-panel__button:hover,
&.wc-block-components-panel__button:focus {
background: none transparent;
}
}