Skip to content

Commit

Permalink
Add animation for controls
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhailov-s committed Aug 9, 2019
1 parent 616836b commit afacc1b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/v2/scss/components/_forms/_checkbox.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
.ui.option {

.control__indicator::after {
transform: translateY(-4px);
top: 0;
}

&.checkbox {
.control__input {
&:checked ~ .control__indicator::after {
background-image: url("/static/v2/img/icons/checkmark.svg");
background-repeat: no-repeat;
background-position: 50% 50%;
transform: translateY(0);
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/v2/scss/components/_forms/_options.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
border-radius: $border-radius;
border: $control-border-width solid $control-border-color;
background-color: $control-bg;
transition: .075s ease-out;
transition-property: transform, border-color, background-color;
}
}

Expand All @@ -67,6 +69,7 @@

&::after {
opacity: 1;
transition: opacity .075s ease-in-out, transform .125s ease-in-out;
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/v2/scss/components/_forms/_radio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
height: 8px;
background-color: #fff;
border-radius: 50%;
transform: scale(1);
}
}

Expand All @@ -17,6 +18,8 @@

.control__indicator::after {
background-image: none;
transform: scale(.5);
transition: opacity .075s ease-in-out, transform .125s ease-in-out;
}
}
}
Expand Down

0 comments on commit afacc1b

Please sign in to comment.