Created
September 20, 2011 10:49
-
-
Save BBB/1228848 to your computer and use it in GitHub Desktop.
Less font example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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