Skip to content

Commit

Permalink
fix: inputs: border color used for inputs is not a11y friendly (#499)
Browse files Browse the repository at this point in the history
* fix: inputs: border color used for inputs is not a11y friendly

* chore: inputs: address pr feedback by editing comment
  • Loading branch information
dkilgore-eightfold authored Jan 11, 2023
1 parent b4a5dc2 commit cb386bd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@
&-status-success.picker-underline {
div {
&:before {
border-color: var(--border-color);
border-color: var(--input-border-color);
}

&:after {
border-color: var(--primary-color-60);
border-color: var(--input-border-color-underline-active);
}

&:hover {
&:before {
border-color: var(--grey-color-60);
border-color: var(--input-border-color-underline-hover);
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/DateTimePicker/Internal/ocpicker.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
}

&:hover:not(.picker-disabled):not(.picker-underline):not(.picker-borderless) {
border-color: var(--grey-color-60);
border-color: var(--input-border-color);
}

&-focused:not(.picker-disabled):not(.picker-underline):not(.picker-borderless) {
Expand Down Expand Up @@ -1015,7 +1015,7 @@
&-underline {
.picker-input {
&:before {
border-bottom: 1px solid var(--border-color);
border-bottom: 1px solid var(--input-border-color);
left: 0;
bottom: 0;
content: '';
Expand All @@ -1027,7 +1027,7 @@
}

&:after {
border-bottom: 1px solid var(--primary-color-60);
border-bottom: 1px solid var(--input-border-color-underline-active);
left: 0;
bottom: 0;
content: '';
Expand All @@ -1041,7 +1041,7 @@

&:hover {
&:before {
border-color: var(--grey-color-60);
border-color: var(--input-border-color-underline-hover);
}
}

Expand Down
15 changes: 6 additions & 9 deletions src/components/Inputs/input.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
.input-wrapper {
--input-border-color: var(--grey-color-60);
--input-border-color-active: var(--grey-color-80);

position: relative;
width: fit-content;
$input-small-size: 28px;
Expand Down Expand Up @@ -338,7 +335,7 @@
}

&:hover:not([disabled]) {
border-color: var(--input-border-color-active);
border-color: var(--input-border-color-hover);

&.underline {
border-color: transparent;
Expand Down Expand Up @@ -1002,7 +999,7 @@
}

&:hover:not([disabled]):not(.underline) {
border-color: var(--input-border-color-active);
border-color: var(--input-border-color-hover);
}

&.status-success {
Expand Down Expand Up @@ -1119,7 +1116,7 @@
}

&:after {
border-bottom: 1px solid var(--primary-color-60);
border-bottom: 1px solid var(--input-border-color-underline-active);
left: 0;
bottom: 0;
content: '';
Expand All @@ -1133,7 +1130,7 @@

&:hover {
&:before {
border-color: var(--input-border-color-active);
border-color: var(--input-border-color-underline-hover);
}
}

Expand All @@ -1143,12 +1140,12 @@
}

&:after {
border-color: var(--primary-color-60);
border-color: var(--input-border-color-underline-active);
}

&:hover {
&:before {
border-color: var(--input-border-color-active);
border-color: var(--input-border-color-underline-hover);
}
}
}
Expand Down
11 changes: 9 additions & 2 deletions src/styles/themes/_default-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@
--border-radius-l: 16px;
--border-radius-xl: 24px;

// ------ Input theme ------
--input-border-color: var(--grey-color-60);
--input-border-color-active: var(--grey-color-80);
--input-border-color-hover: var(--input-border-color-active);
--input-border-color-underline-active: var(--primary-color-70);
--input-border-color-underline-hover: var(--input-border-color-active);

// ------ Tabs theme ------
--tab-label: var(--text-secondary-color);
--tab-background: transparent;
Expand Down Expand Up @@ -257,8 +264,8 @@
// ------ Picker theme ------
--picker-background-color: var(--background-color);
--picker-foreground-color: var(--text-secondary-color);
--picker-border-color: var(--border-color);
--picker-border-color-active: var(--primary-color);
--picker-border-color: var(--input-border-color);
--picker-border-color-active: var(--input-border-color-active);
--picker-cell-background-color: var(--background-color);
--picker-cell-background-color-active: var(--primary-color-20);
--picker-cell-background-color-hover: var(--accent-color-30);
Expand Down

0 comments on commit cb386bd

Please sign in to comment.