Skip to content

Instantly share code, notes, and snippets.

@lmartins
Created December 17, 2014 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmartins/6e0c573e868906bae977 to your computer and use it in GitHub Desktop.
Save lmartins/6e0c573e868906bae977 to your computer and use it in GitHub Desktop.
Color management with Sass
// Color Settings
$color: (
nav: (
text: #333,
text-hover: #FFF,
bg: #FFF,
bg-hover: #FEF160
),
site-footer: (
title: #FFF,
info-border: rgba(#FFF, 0.1),
bg: #2A3137
)
);
// Helper Function
@function color($el, $color, $map: $colors) {
@return map-get(map-get($map, $el), $color);
}
// Usage
.site-footer {
background-color: color(site-footer, bg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment