Skip to content

Instantly share code, notes, and snippets.

@Phunky
Last active August 29, 2015 14:03
Show Gist options
  • Save Phunky/4de9a7007e5470c2727a to your computer and use it in GitHub Desktop.
Save Phunky/4de9a7007e5470c2727a to your computer and use it in GitHub Desktop.
Example of my colour map usage
@function colour($name){
@return map-get($colours, $name);
}
@function colour-darken($name, $percentage){
@return darken( map-get($colours, $name), $percentage );
}
@function colour-lighten($name, $percentage){
@return lighten( map-get($colours, $name), $percentage );
}
@function colour-adjust-hue($name, $percentage){
@return adjust-hue( map-get($colours, $name), $percentage );
}
@function colour-tint($name, $percentage){
@return tint( map-get($colours, $name), $percentage );
}
@function colour-shade($name, $percentage){
@return shade( map-get($colours, $name), $percentage );
}
@function colour-rgba($name, $value){
@return rgba( map-get($colours, $name), $value );
}
// http://www.google.com/design/spec/style/color.html#
@function colour-100($name){
@return colour-lighten($name, 20);
}
@function colour-200($name){
@return colour-lighten($name, 15);
}
@function colour-300($name){
@return colour-lighten($name, 10);
}
@function colour-400($name){
@return colour-lighten($name, 5);
}
@function colour-primary($name){
@return colour($name);
}
@function colour-600($name){
@return colour-darken($name, 5);
}
@function colour-700($name){
@return colour-darken($name, 10);
}
@function colour-800($name){
@return colour-darken($name, 15);
}
@function colour-900($name){
@return colour-darken($name, 20);
}
$colours: (
blue-grey: #607d8b,
grey: #9e9e9e,
brown: #795548,
deep-orange: #ff5722,
orange: #ff9800,
amber: #ffc107,
yellow: #ffeb3b,
lime: #cddc39,
light-green: #8bc34a,
green: #259b24,
teal: #009688,
cyan: #00bcd4,
light-blue: #03a9f4,
blue: #5677fc,
indigo: #3f51b5,
deep-purple: #673ab7,
purple: #9c27b0,
pink: #e91e63,
red: #e51c23
);
body {
color: colour(blue-grey);
background-color: colour-100(blue-grey);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment