Skip to content

Commit

Permalink
style: fix up legend toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos authored and markov00 committed Jun 7, 2019
1 parent ddee798 commit 21bb075
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 29 deletions.
1 change: 1 addition & 0 deletions src/components/legend/_index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import 'variables';
@import 'legend';
@import 'legend_button';
@import 'legend_list';
@import 'legend_item';
27 changes: 0 additions & 27 deletions src/components/legend/_legend.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,30 +68,3 @@
overflow-y: auto;
overflow-x: hidden;
}

.echLegend__toggle {
padding: 4px;
opacity: 0.35;

&:hover {
opacity: 1;
}

border-radius: $euiBorderRadius;
position: absolute;
bottom: 0;
left: 0;
background-color: $euiColorEmptyShade;
transition: opacity $euiAnimSpeedFast $euiAnimSlightResistance,
background-color $euiAnimSpeedFast $euiAnimSlightResistance $euiAnimSpeedExtraSlow;

&:focus {
box-shadow: none;
background-color: $euiFocusBackgroundColor !important;
}
}

.echLegend__toggle--isOpen {
background-color: transparentize($euiColorDarkestShade, 0.9);
opacity: 1;
}
23 changes: 23 additions & 0 deletions src/components/legend/_legend_button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.echLegendButton {
padding: $euiSizeXS;
line-height: 1;
opacity: 0.35;
border-radius: $euiBorderRadius;
background-color: $euiColorEmptyShade;
position: absolute;
bottom: 0;
left: 0;
transition:
opacity $euiAnimSpeedFast $euiAnimSlightResistance,
background-color $euiAnimSpeedFast $euiAnimSlightResistance;

&:hover,
&:focus {
opacity: 1;
background-color: $euiFocusBackgroundColor;
}
}

.echLegendButton--isOpen {
opacity: 1;
}
4 changes: 2 additions & 2 deletions src/components/legend/legend_button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class LegendButtonComponent extends React.Component<LegendButtonProps> {
return null;
}
const isOpen = !legendCollapsed.get();
const className = classNames('echLegend__toggle', {
'echLegend__toggle--isOpen': isOpen,
const className = classNames('echLegendButton', {
'echLegendButton--isOpen': isOpen,
});
return (
<button
Expand Down

0 comments on commit 21bb075

Please sign in to comment.