Commit b11c7912 authored by Kushal Pandya's avatar Kushal Pandya

Update toggle styles to use icons

parent a15c4d49
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
border: 0; border: 0;
outline: 0; outline: 0;
display: block; display: block;
width: 100px; width: 50px;
height: 24px; height: 24px;
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;
...@@ -42,31 +42,31 @@ ...@@ -42,31 +42,31 @@
background: none; background: none;
} }
&::before { .toggle-icon {
color: $feature-toggle-text-color;
font-size: 12px;
line-height: 24px;
position: absolute;
top: 0;
left: 25px;
right: 5px;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
animation: animate-disabled .2s ease-in;
content: attr(data-disabled-text);
}
&::after {
position: relative; position: relative;
display: block; display: block;
content: "";
width: 22px;
height: 18px;
left: 0; left: 0;
border-radius: 9px; border-radius: 9px;
background: $feature-toggle-color; background: $feature-toggle-color;
transition: all .2s ease; transition: all .2s ease;
&,
.toggle-icon-svg {
width: 18px;
height: 18px;
}
.toggle-icon-svg {
fill: $feature-toggle-color-disabled;
}
.toggle-status-checked {
display: none;
}
.toggle-status-unchecked {
display: inline;
}
} }
.loading-icon { .loading-icon {
...@@ -77,11 +77,10 @@ ...@@ -77,11 +77,10 @@
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
&.is-loading { &.is-loading {
&::before { .toggle-icon {
display: none; display: none;
} }
...@@ -100,15 +99,20 @@ ...@@ -100,15 +99,20 @@
&.is-checked { &.is-checked {
background: $feature-toggle-color-enabled; background: $feature-toggle-color-enabled;
&::before { .toggle-icon {
left: 5px; left: calc(100% - 18px);
right: 25px;
animation: animate-enabled .2s ease-in;
content: attr(data-enabled-text);
}
&::after { .toggle-icon-svg {
left: calc(100% - 22px); fill: $feature-toggle-color-enabled;
}
.toggle-status-checked {
display: inline;
}
.toggle-status-unchecked {
display: none;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment