Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $my-colors: (
- 'default-blue': #0071ce,
- 'blue': #064f8e,
- 'yellow': #f79428,
- 'light-blue': #1888c8,
- 'green': #54a546,
- 'red': #C82022,
- 'pink': #b51e6d,
- 'orange': #e54e26
- );
- $my-opacity: (
- 'dark': 1,
- 'light': 0.8
- );
- @function get-color($key: 'default-blue') {
- @return map-get($my-colors, $key);
- }
- @function get-color-alpha($name: 'default-blue', $opacity: 'dark') {
- $color: get-color($name);
- // Get the named opacity level, if it exists
- @if map-key-exists($my-opacity, $opacity) {
- $opacity: map-get($my-opacity, $opacity);
- }
- // Use rgba() to manipulate the color's alpha level
- @return rgba($color, $opacity);
- }
- li h3 {
- color: get-color-alpha('default-blue', 'light');
- }
Add Comment
Please, Sign In to add comment