2017-01-27 23:41:11 +08:00
|
|
|
.react-toggle {
|
|
|
|
display: inline-block;
|
|
|
|
position: relative;
|
|
|
|
cursor: pointer;
|
|
|
|
background-color: transparent;
|
|
|
|
border: 0;
|
|
|
|
padding: 0;
|
|
|
|
|
|
|
|
-webkit-touch-callout: none;
|
|
|
|
-webkit-user-select: none;
|
|
|
|
-khtml-user-select: none;
|
|
|
|
-moz-user-select: none;
|
|
|
|
-ms-user-select: none;
|
|
|
|
user-select: none;
|
|
|
|
|
|
|
|
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.react-toggle-screenreader-only {
|
|
|
|
border: 0;
|
|
|
|
clip: rect(0 0 0 0);
|
|
|
|
height: 1px;
|
|
|
|
margin: -1px;
|
|
|
|
overflow: hidden;
|
|
|
|
padding: 0;
|
|
|
|
position: absolute;
|
|
|
|
width: 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.react-toggle--disabled {
|
|
|
|
cursor: not-allowed;
|
|
|
|
opacity: 0.5;
|
2019-01-25 00:16:23 +08:00
|
|
|
transition: opacity calc(var(--enableAnimation) * 0.25s);
|
2017-01-27 23:41:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.react-toggle-track {
|
|
|
|
overflow: hidden;
|
|
|
|
width: 3.5rem;
|
|
|
|
height: 1.5rem;
|
|
|
|
padding: 0;
|
|
|
|
border-radius: 2rem;
|
2021-08-20 19:54:08 +08:00
|
|
|
background-color: var(--color-danger);
|
2019-01-25 00:16:23 +08:00
|
|
|
transition: all calc(var(--enableAnimation) * 0.2s) ease;
|
2017-01-27 23:41:11 +08:00
|
|
|
}
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
.react-toggle-track:dir(rtl) {
|
|
|
|
width: 4rem;
|
|
|
|
}
|
|
|
|
|
2017-01-27 23:41:11 +08:00
|
|
|
.react-toggle--checked .react-toggle-track {
|
2021-08-20 19:54:08 +08:00
|
|
|
background-color: var(--color-success);
|
2017-01-27 23:41:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.react-toggle-track-check {
|
|
|
|
position: absolute;
|
|
|
|
color: white;
|
|
|
|
width: 1rem;
|
|
|
|
line-height: 1.5rem;
|
|
|
|
font-size: 0.8rem;
|
|
|
|
left: 0.5rem;
|
|
|
|
opacity: 0;
|
2019-01-25 00:16:23 +08:00
|
|
|
transition: opacity calc(var(--enableAnimation) * 0.25s) ease;
|
2017-01-27 23:41:11 +08:00
|
|
|
}
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
.react-toggle-track-check:dir(rtl) {
|
2019-05-17 00:27:43 +08:00
|
|
|
left: 0.8rem;
|
2019-05-14 21:15:54 +08:00
|
|
|
}
|
|
|
|
|
2017-01-27 23:41:11 +08:00
|
|
|
.react-toggle--checked .react-toggle-track-check {
|
|
|
|
opacity: 1;
|
2019-01-25 00:16:23 +08:00
|
|
|
transition: opacity calc(var(--enableAnimation) * 0.25s) ease;
|
2017-01-27 23:41:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.react-toggle-track-x {
|
|
|
|
position: absolute;
|
|
|
|
color: white;
|
|
|
|
width: 1rem;
|
|
|
|
line-height: 1.5rem;
|
|
|
|
font-size: 0.8rem;
|
2017-03-09 22:34:33 +08:00
|
|
|
left: 1.7rem;
|
2017-01-27 23:41:11 +08:00
|
|
|
opacity: 1;
|
2019-01-25 00:16:23 +08:00
|
|
|
transition: opacity calc(var(--enableAnimation) * 0.25s) ease;
|
2017-01-27 23:41:11 +08:00
|
|
|
}
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
.react-toggle-track-x:dir(rtl) {
|
|
|
|
left: 2.2rem;
|
|
|
|
}
|
|
|
|
|
2017-01-27 23:41:11 +08:00
|
|
|
.react-toggle--checked .react-toggle-track-x {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.react-toggle-thumb {
|
|
|
|
transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0ms;
|
|
|
|
position: absolute;
|
|
|
|
top: 1px;
|
|
|
|
left: 1px;
|
|
|
|
width: 1.35rem;
|
|
|
|
height: 1.35rem;
|
|
|
|
border-radius: 50%;
|
|
|
|
background-color: #FAFAFA;
|
|
|
|
box-sizing: border-box;
|
2019-01-25 00:16:23 +08:00
|
|
|
transition: opacity calc(var(--enableAnimation) * 0.25s) ease;
|
2017-01-27 23:41:11 +08:00
|
|
|
box-shadow: 2px 0px 10px -1px rgba(0,0,0,0.4);
|
|
|
|
}
|
|
|
|
|
|
|
|
.react-toggle--checked .react-toggle-thumb {
|
|
|
|
left: 2.1rem;
|
|
|
|
box-shadow: -2px 0px 10px -1px rgba(0,0,0,0.4);
|
|
|
|
}
|
2017-02-16 02:49:40 +08:00
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
.react-toggle--checked:dir(rtl) .react-toggle-thumb:dir(rtl) {
|
|
|
|
left: 2.6rem;
|
|
|
|
}
|
|
|
|
|
2017-02-16 02:49:40 +08:00
|
|
|
.react-toggle--focus .react-toggle-thumb {
|
2017-07-08 00:17:45 +08:00
|
|
|
box-shadow: 0px 0px 2px 3px #0F70D7;
|
2017-02-16 02:49:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.react-toggle:active:not(.react-toggle--disabled) .react-toggle-thumb {
|
2017-07-08 00:17:45 +08:00
|
|
|
box-shadow: 0px 0px 5px 5px #0F70D7;
|
2017-02-16 02:49:40 +08:00
|
|
|
}
|