declare all opensans font variants

This commit is contained in:
Frédéric Péters 2018-11-17 19:40:05 +01:00
parent 8f5d3e1b2f
commit 9e1d35f4c2
1 changed files with 33 additions and 11 deletions

View File

@ -1,13 +1,35 @@
@font-face {
font-family: 'Open Sans';
src: url('../xstatic/fonts/Regular/OpenSans-Regular.eot?#iefix') format('embedded-opentype'), url('../xstatic/fonts/Regular/OpenSans-Regular.woff') format('woff'), url('../xstatic/fonts/Regular/OpenSans-Regular.ttf') format('truetype'), url('../xstatic/fonts/Regular/OpenSans-Regular.svg#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
$font-path: '../xstatic/fonts' !default;
@mixin font($type, $weight) {
@font-face {
font-family: 'Open Sans';
src: url('#{$font-path}/#{$type}/OpenSans-#{$type}.woff2') format('woff2'),
url('#{$font-path}/#{$type}/OpenSans-#{$type}.woff') format('woff'),
url('#{$font-path}/#{$type}/OpenSans-#{$type}.eot?#iefix') format('embedded-opentype'),
url('#{$font-path}/#{$type}/OpenSans-#{$type}.ttf?#iefix') format('truetype');
font-weight: $weight;
font-style: normal;
}
@font-face {
font-family: 'Open Sans';
@if $type == Regular { // not RegularItalic
src: url('#{$font-path}/Italic/OpenSans-Italic.woff2') format('woff2'),
url('#{$font-path}/Italic/OpenSans-Italic.woff') format('woff'),
url('#{$font-path}/Italic/OpenSans-Italic.eot?#iefix') format('embedded-opentype'),
url('#{$font-path}/Italic/OpenSans-Italic.ttf?#iefix') format('truetype');
} @else {
src: url('#{$font-path}/#{$type}Italic/OpenSans-#{$type}Italic.woff2') format('woff2'),
url('#{$font-path}/#{$type}Italic/OpenSans-#{$type}Italic.woff') format('woff'),
url('#{$font-path}/#{$type}Italic/OpenSans-#{$type}Italic.eot?#iefix') format('embedded-opentype'),
url('#{$font-path}/#{$type}Italic/OpenSans-#{$type}Italic.ttf?#iefix') format('truetype');
}
font-weight: $weight;
font-style: italic;
}
}
@font-face {
font-family: 'Open Sans';
src: url('../xstatic/fonts/Bold/OpenSans-Bold.eot?#iefix') format('embedded-opentype'), url('../xstatic/fonts/Bold/OpenSans-Bold.woff') format('woff'), url('../xstatic/fonts/Bold/OpenSans-Bold.ttf') format('truetype'), url('../xstatic/fonts/Bold/OpenSans-Bold.svg#fontawesomeregular') format('svg');
font-weight: bold;
font-style: normal;
}
@include font('Light', 300);
@include font('Regular', 400);
@include font('Semibold', 600);
@include font('Bold', 700);
@include font('ExtraBold', 800);