_fonts.scss 1.87 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$font-path: '../../raw/fonts';

$light: 300, normal;
$lightItalic: 300, italic;
$regular: normal, normal;
$italic: normal, italic;
$bold: 700, bold;

$opensans: (
    OpenSansLight: $light,
    OpenSansLightItalic: $lightItalic,
    OpenSansRegular: $regular,
    OpenSansItalic: $italic,
    OpenSansBold: $bold
);

$robotoslab: (
    robotoslab-light: $light,
    robotoslab-regular: $regular,
    robotoslab-bold: $bold
);


@each $fontname, $style in $opensans {
    @font-face {
        font-family: 'Open Sans';
        src: url('#{$font-path}/opensans/#{$fontname}.eot');
        src: url('#{$font-path}/opensans/#{$fontname}.eot?#iefix') format('embedded-opentype'),
             url('#{$font-path}/opensans/#{$fontname}.woff2') format('woff2'),
             url('#{$font-path}/opensans/#{$fontname}.svg##{$fontname}') format('svg'),
             url('#{$font-path}/opensans/#{$fontname}.otf') format('opentype'),
             url('#{$font-path}/opensans/#{$fontname}.ttf') format('truetype'),
             url('#{$font-path}/opensans/#{$fontname}.woff') format('woff');
        font-weight: nth($style, 1);
        font-style:  nth($style, 2);
    }
}

@each $fontname, $style in $robotoslab {
    @font-face {
        font-family: 'Roboto Slab';
        src: url('#{$font-path}/robotoslab/#{$fontname}.eot');
        src: url('#{$font-path}/robotoslab/#{$fontname}.eot?#iefix') format('embedded-opentype'),
             url('#{$font-path}/robotoslab/#{$fontname}.woff2') format('woff2'),
             url('#{$font-path}/robotoslab/#{$fontname}.svg##{$fontname}') format('svg'),
             url('#{$font-path}/robotoslab/#{$fontname}.otf') format('opentype'),
             url('#{$font-path}/robotoslab/#{$fontname}.ttf') format('truetype'),
             url('#{$font-path}/robotoslab/#{$fontname}.woff') format('woff');
        font-weight: nth($style, 1);
        font-style:  nth($style, 2);
    }
}