Skip to content

Instantly share code, notes, and snippets.

@gandhiShepard
Last active August 29, 2015 14:12
Show Gist options
  • Save gandhiShepard/2886025787cddb326518 to your computer and use it in GitHub Desktop.
Save gandhiShepard/2886025787cddb326518 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
// Sass maps
// Map font weights for consistant usage across different fonts
$sans: (
face: 'source sans pro',
hairline: 200,
light: 300,
normal: 400,
semi: 600,
bold: 700,
heavy: 900
);
$serif: (
face: 'source serif pro',
hairline: thin,
light: light,
normal: normal,
semi: medium,
bold: bold,
heavy: black
);
//Just renaming for semantic use
@function font($typeface-map, $key) {
@if map-has-key($typeface-map, $key) {
@return map-get($typeface-map, $key);
}
@warn "The key #{$key} is not in the map '$typeface-map'";
@return null;
}
.headline {
font-family: font($sans, face);
font-weight: font($sans, light);
font-size: 4rem;
}
.subhead {
font-family: font($serif, face);
font-weight: font($serif, bold);
font-size: 4rem;
}
.headline {
font-family: "source sans pro";
font-weight: 300;
font-size: 4rem;
}
.subhead {
font-family: "source serif pro";
font-weight: bold;
font-size: 4rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment