Skip to content

Instantly share code, notes, and snippets.

@BBB
Created September 20, 2011 10:49
Show Gist options
  • Save BBB/1228848 to your computer and use it in GitHub Desktop.
Save BBB/1228848 to your computer and use it in GitHub Desktop.
Less font example
#font {
@helvetica-stack: "Helvetica Neue", Arial, sans-serif;
@helvetica-heavy-stack: @helvetica-stack;
@helvetica-light-stack: "HelveticaNeueW01-Thin", @helvetica-stack;
@helvetica-italic-stack: "HelveticaNeue-Italic", @helvetica-stack;
// sizes
@base-font-size: 14px;
.big() {
font-size: 4 * @base-font-size;
}
.medium() {
font-size: 3 * @base-font-size;
}
.normal() {
font-size: @base-font-size;
}
.small() {
font-size: .75 * @base-font-size;
}
// weights
.heavy() {
font-weight: bold;
font-family: @helvetica-heavy-stack;
}
.medium() {
font-weight: medium;
font-family: @helvetica-stack;
}
.light() {
font-weight: 200;
font-family: @helvetica-light-stack;
}
// styles
.italic() {
font-style: italic;
font-family: @helvetica-italic-stack;
}
}
h1 {
#font .big;
#font .heavy;
// except when it's inside an article...
article & {
#font .medium;
}
}
h2 {
#font .medium;
#font .light;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment