Skip to content

Commit

Permalink
feat(component): Merge pull request #4 from takenet/feature/checkbox-…
Browse files Browse the repository at this point in the history
…and-radio

Feature/checkbox and radio
  • Loading branch information
Brenner Pacelli authored Jun 1, 2018
2 parents 3458939 + 81c6a9c commit ccecd8a
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build/dist/blip-toolkit.css

Large diffs are not rendered by default.

48 changes: 39 additions & 9 deletions src/scss/components/_input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
/**
* Eliminating arrows from number input
*/
.bp-input[type="number"]::-webkit-outer-spin-button, .bp-input[type="number"]::-webkit-inner-spin-button {
.bp-input[type="number"]::-webkit-outer-spin-button,
.bp-input[type="number"]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
Expand All @@ -59,15 +60,15 @@
padding-bottom: 0.5*$m;
}

.bp-input[type="checkbox"], .bp-input[type="radio"] {
.bp-input[type="checkbox"],
.bp-input[type="radio"] {
display: none;
}

.bp-input--checkbox, .bp-input--radio {
.bp-input--checkbox,
.bp-input--radio, {
display: inline-block;
background-color: $bp-color-white;
border: 0.1*$m solid $bp-color-time;
text-align: center;
transition: all 500ms;

&:hover {
Expand All @@ -77,9 +78,6 @@

.bp-input--checkbox {
border-radius: 0.2*$m;
font-size: $bp-fs-6;
font-weight: $bp-fw-bold;
color: $bp-color-white;
width: 2.4*$m;
height: 2.4*$m;
}
Expand All @@ -92,11 +90,43 @@
background-clip: content-box;
}

.bp-input[type="checkbox"]:checked + .bp-input--checkbox, .bp-input[type="radio"]:checked + .bp-input--radio {
.bp-input[type="checkbox"]:checked + .bp-input--checkbox,
.bp-input[type="radio"]:checked + .bp-input--radio {
background-color: $bp-color-blip-light;
border-color: $bp-color-blip-light;

&:hover {
background-color: bp-darken($bp-color-blip-light);
border-color: bp-darken($bp-color-blip-light);
}
}

.bp-input[type="checkbox"]:checked + .bp-input--checkbox {
animation: checkbox .6s ease;
}

@include keyframes(checkbox) {
0% { transform: scale(1, 1); }
30% { transform: scale(1.25, 0.75); }
40% { transform: scale(0.75, 1.25); }
50% { transform: scale(1.15, 0.85); }
65% { transform: scale(0.95, 1.05); }
75% { transform: scale(1.05, 0.95); }
100% { transform: scale(1, 1); }
}

.bp-input--checkbox--disabled,
.bp-input--radio--disabled,
.bp-input[type="checkbox"]:checked + .bp-input--checkbox--disabled,
.bp-input[type="radio"]:checked + .bp-input--radio--disabled {
background-color: $bp-color-offwhite;
border-color: $bp-color-breeze;

&:hover {
background-color: $bp-color-offwhite;
border-color: $bp-color-breeze;
}
}

/**
* Wrapper
Expand Down
11 changes: 11 additions & 0 deletions src/scss/mixins/_keyframes.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@mixin keyframes($name) {
@-webkit-keyframes #{$name} {
@content;
}
@-moz-keyframes #{$name} {
@content;
}
@keyframes #{$name} {
@content;
}
}
1 change: 1 addition & 0 deletions src/scss/mixins/module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "box-shadow";
@import "button";
@import "keyframes";
@import "placeholder";
@import "scrollbar";

0 comments on commit ccecd8a

Please sign in to comment.