Created
January 23, 2015 22:02
-
-
Save coding-horror/346d4b2677a255ea6dd9 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or 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
<div class="bg"><div class="in">14 / 21</div></div> |
This file contains hidden or 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.9) | |
// Compass (v1.0.1) | |
// ---- | |
$success: #009900; | |
$secondary: #ffffff; | |
@function brightness($color) { | |
@return ((red($color) * .299) + (green($color) * .587) + (blue($color) * .114)); //w3c definition of color brightness | |
} | |
@function dark-light-diff($adjusted-color, $comparison-color, $lightness, $darkness) { | |
@if brightness($adjusted-color) < brightness($comparison-color) { | |
@return scale-color($adjusted-color, $lightness: $lightness) | |
} @else { | |
@return scale-color($adjusted-color, $lightness: $darkness) | |
} | |
} | |
div { | |
background-color: desaturate(dark-light-diff($success, $secondary, 60%, -35%), 30%); | |
width:100px; | |
font-weight: bold; | |
color: #919191; | |
} | |
.in { | |
padding-top:10px; | |
padding-left:40px; | |
height:30px; | |
font-family:sans-serif; | |
font-size:14pt; | |
} |
This file contains hidden or 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
div { | |
background-color: #86ea86; | |
width: 100px; | |
font-weight: bold; | |
color: #919191; | |
} | |
.in { | |
padding-top: 10px; | |
padding-left: 40px; | |
height: 30px; | |
font-family: sans-serif; | |
font-size: 14pt; | |
} |
This file contains hidden or 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
<div class="bg"><div class="in">14 / 21</div></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment