Created
October 29, 2015 12:45
-
-
Save ierhyna/a3da0e03ffcf534a644e to your computer and use it in GitHub Desktop.
Basic Sass Functions
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
// | |
// Color Functions | |
// | |
// Get color | |
// Use: $button-color: color('primary'); | |
@function color($key: 'primary') { | |
@return map-get($colors, $key); | |
} | |
// Generate opacity | |
// Use: $button-transparent-color: color-alpha('primary', 'light'); | |
// => rgba(#8e3329, 0.8) | |
@function color-alpha($name: 'primary', $opacity: 0) { | |
$color: color($name); | |
$opacity: map-get($color-opacity, $opacity); | |
@return rgba($color, $opacity); | |
} | |
// | |
// Text Functions | |
// | |
// Using type-scale values | |
@function type-scale($level) { | |
@return map-get($type-scale, $level); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment