Created
March 24, 2021 03:08
-
-
Save 1000heads-luke/482efa90099fb6733708d1689f991876 to your computer and use it in GitHub Desktop.
LESS Toolkit
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-face() | |
Adds Webfont File (WOFF & WOFF2) | |
*/ | |
.font-face(@font-family, @font-name, @font-root: '/', @font-weight: normal, @font-style: normal ){ | |
@font-face { | |
font-family: @font-family; | |
src: url('@{font-root}@{font-name}.woff2') format('woff2'), | |
url('@{font-root}@{font-name}.woff') format('woff'); | |
font-weight: @font-weight; | |
font-style: @font-style; | |
} | |
} | |
/* | |
Examples | |
.font-face('Arial', 'Arial-Bold', '/css/fonts/', bold); | |
@font-face { | |
font-family: 'Arial'; | |
src: url('/css/fonts/Arial-Bold.woff2') format('woff2'), | |
url('/css/fonts/Arial-Bold.woff') format('woff'); | |
font-weight: bold; | |
font-style: normal; | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment