Created
June 6, 2015 02:51
-
-
Save cristianferrarig/1f853d925facd2f78d40 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%label.follow | |
%input{type: "checkbox"} | |
%span +0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.13) | |
// Compass (v1.0.3) | |
// ---- | |
@function solidify($alpha-color, $background-color: white) { | |
$percent: alpha($alpha-color) * 100%; | |
$opaque: opacify($alpha-color, 1); | |
$solid-color: mix($opaque, $background-color, $percent); | |
@return $solid-color; | |
} | |
$color: #12B398; | |
$light-color: solidify(rgba($color,.2)); | |
$inverse: white; | |
body { | |
margin: 0; | |
padding: 50px; | |
} | |
.button { | |
display: block; | |
width: 40px; | |
height: 40px; | |
line-height: 40px; | |
text-align: center; | |
border-radius: 50%; | |
font-family: sans-serif; | |
& { | |
margin: 5px; | |
border: 1px solid $light-color; | |
color: $color; | |
} | |
&:active { | |
margin: 0; | |
border: 6px solid $light-color; | |
background: $light-color; | |
} | |
&:focus { | |
background: $color; | |
color: $inverse; | |
border: 1px; | |
margin: 5px; | |
} | |
} | |
.follow { | |
& { | |
position: relative; | |
} | |
span { | |
border-radius: 50%; | |
font-family: sans-serif; | |
text-align: center; | |
display: block; | |
width: 40px; | |
height: 40px; | |
line-height: 40px; | |
background: $inverse; | |
color: $color; | |
border: 1px solid $light-color; | |
background-clip: padding-box; | |
margin: 5px; | |
user-select: none; | |
cursor: pointer; | |
transition: all .25s; | |
} | |
span:active { | |
background: $light-color; | |
border-width: 6px; | |
margin: 0; | |
} | |
input { | |
position: absolute; | |
visibility: hidden; | |
} | |
input:checked { | |
+ span { | |
background: $color; | |
color: $inverse; | |
border-color: $color; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 0; | |
padding: 50px; | |
} | |
.button { | |
display: block; | |
width: 40px; | |
height: 40px; | |
line-height: 40px; | |
text-align: center; | |
border-radius: 50%; | |
font-family: sans-serif; | |
} | |
.button { | |
margin: 5px; | |
border: 1px solid #cfefea; | |
color: #12B398; | |
} | |
.button:active { | |
margin: 0; | |
border: 6px solid #cfefea; | |
background: #cfefea; | |
} | |
.button:focus { | |
background: #12B398; | |
color: white; | |
border: 1px; | |
margin: 5px; | |
} | |
.follow { | |
position: relative; | |
} | |
.follow span { | |
border-radius: 50%; | |
font-family: sans-serif; | |
text-align: center; | |
display: block; | |
width: 40px; | |
height: 40px; | |
line-height: 40px; | |
background: white; | |
color: #12B398; | |
border: 1px solid #cfefea; | |
background-clip: padding-box; | |
margin: 5px; | |
user-select: none; | |
cursor: pointer; | |
transition: all .25s; | |
} | |
.follow span:active { | |
background: #cfefea; | |
border-width: 6px; | |
margin: 0; | |
} | |
.follow input { | |
position: absolute; | |
visibility: hidden; | |
} | |
.follow input:checked + span { | |
background: #12B398; | |
color: white; | |
border-color: #12B398; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<label class='follow'> | |
<input type='checkbox'> | |
<span>+0</span> | |
</label> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment