Last active
May 13, 2016 15:16
-
-
Save hagenburger/e94ee5c86e25b76b865ffdb2d6dcb095 to your computer and use it in GitHub Desktop.
Use Sass functions in color swatches in your living style guide
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 colors.scss | |
@style background-color: change-color($turquoise, $lightness: 98%) | |
@style color: $pink | |
# Colors | |
No you can use Sass functions in color swatches: | |
@colors { | |
$pink light($pink) dark($pink) | |
$turquoise light($turquoise) dark($turquoise) | |
} | |
Besides Sass variables and functions, you can also use plain CSS colors like `#ca1f70` or `red`. | |
Colors swatches are separated by one or more spaces. | |
[More information](https://github.com/livingstyleguide/livingstyleguide/tree/v2#colors) |
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
$pink: #ca1f70; | |
$turquoise: #2ef1bd; | |
@function light($color) { | |
@return change-color($color, $lightness: 90%); | |
} | |
@function dark($color) { | |
@return change-color($color, $lightness: 30%); | |
} |
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
# To generate your style guide: | |
gem install livingstyleguide -v 2.0.0.pre.3 | |
livingstyleguide compile colors.lsg | |
# open colors.html | |
# or see the result online at http://hagenburger.net/DOWNLOADS/lsg-sass-color-swatches.html | |
# Follow @LSGorg on Twitter and watch livingstyleguide/livingstyleguide on GitHub for more updates! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can see the result online at http://hagenburger.net/DOWNLOADS/lsg-sass-color-swatches.html
Follow @LSGorg on Twitter and watch livingstyleguide/livingstyleguide on GitHub for more updates!