Using Less I am defining font-families as follows:
@georgia: georgia, times, \'times new roman\', \'nimbus roman no9 l\', serif;
Then I ha
I like to structure my fonts on folders, like this:
/fonts/OpenSans-Bold/OpenSans-Bold.eot
/fonts/OpenSans-Bold/OpenSans-Bold.svg
/fonts/OpenSans-Bold/OpenSans-Bold.ttf
/fonts/OpenSans-Bold/OpenSans-Bold.woff
And i use this LESS MIXIN for font-face:
.font-face(@fontName: sans-serif; @fontWeight: normal; @fontStyle: normal) {
@font-face {
font-family: @fontName;
src: url('@{pTheme}/fonts/@{fontName}/@{fontName}.eot');
src: url('@{pTheme}/fonts/@{fontName}/@{fontName}.eot?#iefix') format('embedded-opentype'),
url('@{pTheme}/fonts/@{fontName}/@{fontName}.woff') format('woff'),
url('@{pTheme}/fonts/@{fontName}/@{fontName}.ttf') format('truetype'),
url('@{pTheme}/fonts/@{fontName}/@{fontName}.svg#@{fontName}') format('svg');
font-weight: @fontWeight;
font-style: @fontStyle;
}
}
Where:
@pTheme: "../../themes/[THEME NAME]";
Mixin call example:
.font-face('OpenSans-Bold');
I've made the @pTheme variable so i can use it also on background images, like this:
background: url("@{pTheme}/images/logo.png") no-repeat;