Skip to content

Commit

Permalink
style: fix focus styling
Browse files Browse the repository at this point in the history
  • Loading branch information
rshen91 committed Nov 12, 2020
1 parent ec97027 commit 5b842fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
16 changes: 8 additions & 8 deletions src/components/legend/_legend.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
&--top,
&--bottom {
.echLegendList {
display: grid;
display: flex;
grid-column-gap: $echLegendColumnGap;
grid-row-gap: $echLegendRowGap;
margin-top: $echLegendRowGap;
Expand All @@ -19,6 +19,7 @@
&--right {
.echLegendList {
flex-direction: column;
width: 100%;
}
}

Expand All @@ -37,17 +38,16 @@
position: relative;
}

:focus {
box-shadow: inset 0 0 0 $euiSizeXS / 4 $euiFocusRingColor;
}

.echLegendListContainer {
@include euiYScrollWithShadows;
width: 100%;
overflow-y: auto;
}

&:focus {
box-shadow: inset 0 0 0 $euiSizeXS / 4 $euiFocusRingColor;
:focus {
@include euiFocusRing;
background-color: $euiFocusBackgroundColor;
border-radius: $euiBorderRadius / 2;
margin-right: $euiSizeXS;
}
}
}
7 changes: 2 additions & 5 deletions src/components/legend/_legend_item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ $legendItemVerticalPadding: $echLegendRowGap / 2;
align-items: center;
width: 100%;

&:focus {
box-shadow: inset 0 0 0 $euiSizeXS / 4 $euiFocusRingColor;
}

&:not(&--hidden) {
.echLegendItem__color--changable {
cursor: pointer;
Expand All @@ -35,6 +31,7 @@ $legendItemVerticalPadding: $echLegendRowGap / 2;

&__color {
margin-right: $euiSizeXS;
margin-left: $euiSizeXS;

.euiPopover {
vertical-align: inherit; // prevents color dot from shifting
Expand All @@ -53,7 +50,7 @@ $legendItemVerticalPadding: $echLegendRowGap / 2;
@include euiFontSizeXS;
@include euiTextTruncate;
flex: 1 1 auto;
width: 100%;
width: $echLegendMaxWidth;
text-align: left;
overflow-x: scroll;
overflow: hidden;
Expand Down

0 comments on commit 5b842fe

Please sign in to comment.