Skip to content

Instantly share code, notes, and snippets.

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 patrickmarabeas/5328379 to your computer and use it in GitHub Desktop.
Save patrickmarabeas/5328379 to your computer and use it in GitHub Desktop.
Using a LESS mixin for font-size allows us to have font-family determined dynamically based on font-size
.fontSize (@a) when (@a >= 100) {
font-family: Impact, Charcoal, sans-serif;
}
.fontSize (@a) when (@a < 100) {
font-family: "Comic Sans MS", cursive, sans-serif;
}
.fontSize (@a) {
font-size: @a;
}
.myClass1 {
.fontSize(50px)
}
.myClass2 {
.fontSize(110px)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment