-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ (tables): move filter control out of settings drawer
- Loading branch information
1 parent
053fe9a
commit 85aa9f0
Showing
5 changed files
with
134 additions
and
86 deletions.
There are no files selected for viewing
98 changes: 98 additions & 0 deletions
98
packages/@ourworldindata/grapher/src/controls/LabeledSwitch.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
$light-fill: #dadada; | ||
$active-fill: #dbe5f0; | ||
|
||
$light-text: #858585; | ||
$dark-text: #5b5b5b; | ||
|
||
$info-icon: #a1a1a1; | ||
$active-switch: #6e87a2; | ||
|
||
$medium: 400; | ||
$lato: $sans-serif-font-stack; | ||
|
||
@at-root { | ||
// placed either directly in controls row or in settings menu | ||
.controlsRow .controls, | ||
.settings-menu-contents { | ||
// on/off switch with label written to the right | ||
.labeled-switch { | ||
display: flex; | ||
color: $light-text; | ||
font: $medium 13px/16px $lato; | ||
letter-spacing: 0.01em; | ||
|
||
position: relative; | ||
margin: 8px 0; | ||
-webkit-user-select: none; | ||
user-select: none; | ||
|
||
label { | ||
color: $dark-text; | ||
padding-left: 35px; | ||
white-space: nowrap; | ||
|
||
&:hover { | ||
cursor: pointer; | ||
} | ||
|
||
svg { | ||
color: $info-icon; | ||
height: 13px; | ||
padding: 0 0.333em; | ||
} | ||
} | ||
|
||
.labeled-switch-subtitle { | ||
// only show subtitle in settings menu, otherwise use icon + tooltip | ||
display: none; | ||
} | ||
|
||
input { | ||
position: absolute; | ||
opacity: 0; | ||
left: 0; | ||
} | ||
|
||
.outer { | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
content: " "; | ||
width: 29px; | ||
height: 16px; | ||
background: $light-fill; | ||
border-radius: 8px; | ||
pointer-events: none; | ||
.inner { | ||
position: relative; | ||
content: " "; | ||
width: 10px; | ||
height: 10px; | ||
background: $light-text; | ||
border-radius: 5px; | ||
top: 3px; | ||
left: 3px; | ||
pointer-events: none; | ||
transition: transform 333ms; | ||
} | ||
} | ||
|
||
&:hover { | ||
.outer .inner { | ||
background: $dark-text; | ||
} | ||
} | ||
|
||
input:checked + .outer { | ||
background: $active-fill; | ||
.inner { | ||
background: $active-switch; | ||
transform: translate(13px, 0); | ||
} | ||
} | ||
&:hover input:checked + .outer .inner { | ||
background: darken($active-switch, 13%); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters