grafana/public/sass/components/_switch.scss

145 lines
2.3 KiB
SCSS
Raw Normal View History

2016-03-21 05:07:37 -05:00
/* ============================================================
2016-03-21 07:37:56 -05:00
SWITCH 3 - YES NO
2016-03-21 05:07:37 -05:00
============================================================ */
2016-03-21 07:37:56 -05:00
.gf-form-switch {
&--small {
max-width: 2rem;
min-width: 1.5rem;
input + label {
height: 25px;
}
input + label::before,
input + label::after {
font-size: $font-size-sm;
}
}
&--table-cell {
margin-bottom: 0;
margin-right: 0;
input + label {
height: 3.6rem;
}
}
}
.gf-form-switch--transparent {
input + label {
background: transparent;
2017-12-12 06:55:32 -06:00
border: none;
}
2017-12-19 09:22:41 -06:00
input + label::before,
input + label::after {
background: transparent;
2017-12-12 06:55:32 -06:00
border: none;
}
&:hover {
input + label::before {
background: transparent;
}
input + label::after {
background: transparent;
}
}
}
.gf-form-switch--search-result__section {
min-width: 3.05rem;
margin-right: -0.3rem;
input + label {
height: 1.7rem;
}
}
.gf-form-switch--search-result__item {
min-width: 2.7rem;
input + label {
height: 2.7rem;
}
}
.gf-form-switch--search-result-filter-row__checkbox {
min-width: 3.75rem;
input + label {
height: 2.5rem;
}
}
2017-12-19 09:22:41 -06:00
gf-form-switch[disabled] {
.gf-form-label,
.gf-form-switch input + label {
cursor: default;
pointer-events: none !important;
&::before,
&::after {
color: $text-color-faint;
text-shadow: none;
}
}
2016-03-21 05:07:37 -05:00
}
2018-11-14 15:29:09 -06:00
.gf-form-switch-container {
display: flex;
}
2018-11-14 15:29:09 -06:00
.gf-form-switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
background: $switch-bg;
2018-11-14 15:29:09 -06:00
input {
opacity: 0;
width: 0;
height: 0;
}
}
/* The slider */
.gf-form-switch__slider {
position: absolute;
2018-11-14 23:35:02 -06:00
top: 8px;
left: 16px;
right: 14px;
2018-11-14 23:35:02 -06:00
bottom: 10px;
background: $switch-slider-off-bg;
border-radius: 8px;
height: 16px;
2018-11-14 15:29:09 -06:00
&::before {
position: absolute;
content: '';
height: 12px;
width: 12px;
2018-11-14 23:35:02 -06:00
left: 2px;
bottom: 2px;
background: $switch-slider-color;
2018-11-14 15:29:09 -06:00
transition: 0.4s;
border-radius: 50%;
box-shadow: $switch-slider-shadow;
2018-11-14 15:29:09 -06:00
}
}
input:checked + .gf-form-switch__slider {
background: $switch-slider-on-bg;
2018-11-14 15:29:09 -06:00
}
/* input:focus + .gf-form-switch__slider { */
/* box-shadow: 0 0 1px #2196f3; */
/* } */
input:checked + .gf-form-switch__slider::before {
transform: translateX(14px);
2018-11-14 15:29:09 -06:00
}