Answer the question
In order to leave comments, you need to log in
How to include fonts in LESS?
https://gist.github.com/zhdanovartur/6121601
I googled such a procedure, but somehow I didn’t figure it out, and I don’t think that the developers do not provide for connecting non-standard fonts.
Answer the question
In order to leave comments, you need to log in
I made a mix for this:
.font(@fontName; @urlName: @fontName; @weight: normal; @style: normal) {
font-family: '@{fontName}';
src: url('/fonts/@{urlName}/@{urlName}.eot');
src: url('/fonts/@{urlName}/@{urlName}.eot#iefix') format('embedded-opentype'),
url('/fonts/@{urlName}/@{urlName}.woff') format('woff'),
url('/fonts/@{urlName}/@{urlName}.ttf') format('truetype'),
url('/fonts/@{urlName}/@{urlName}.svg') format('svg');
font-weight: @weight;
font-style: @style;
}
@font-face {
.font(@fontRegular);
}
@font-face {
.font(@fontRegular; @fontBold; bold);
}
@fontRegular: 'OpenSans';
@fontBold: '@{fontRegular}-Bold';
@font-face {
font-family: 'OpenSans';
src: url('/fonts/OpenSans/OpenSans.eot');
src: url('/fonts/OpenSans/OpenSans.eot#iefix') format('embedded-opentype'),
url('/fonts/OpenSans/OpenSans.woff') format('woff'),
url('/fonts/OpenSans/OpenSans.ttf') format('truetype'),
url('/fonts/OpenSans/OpenSans.svg') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'OpenSans';
src: url('/fonts/OpenSans-Bold/OpenSans-Bold.eot');
src: url('/fonts/OpenSans-Bold/OpenSans-Bold.eot#iefix') format('embedded-opentype'),
url('/fonts/OpenSans-Bold/OpenSans-Bold.woff') format('woff'),
url('/fonts/OpenSans-Bold/OpenSans-Bold.ttf') format('truetype'),
url('/fonts/OpenSans-Bold/OpenSans-Bold.svg') format('svg');
font-weight: bold;
font-style: normal;
}
And they shouldn't have provided for it, it's just plain css, write it as it is.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question