|
| 1 | +$font-path: 'https://unpkg.com/[email protected]/src/globals/fonts/' !default; |
| 2 | + |
1 | 3 | @import 'import-once'; |
2 | 4 |
|
3 | | -@mixin font-face-css($path) { |
| 5 | +@mixin font-face-css { |
4 | 6 | // Default font directory, `!default` flag allows user override. |
5 | 7 | // (font files are configured to be served as static assets from server.js) |
6 | | - $font-path: '#{$path}' !default; |
7 | | - |
8 | | - @font-face { |
9 | | - font-family: 'IBM Helvetica'; |
10 | | - font-style: normal; |
11 | | - font-weight: 200; |
12 | | - src: url('#{$font-path}/helvetica-neue-light.woff2') format('woff2'), |
13 | | - url('#{$font-path}/helvetica-neue-light.woff') format('woff') |
14 | | - } |
15 | | - |
16 | | - @font-face { |
17 | | - font-family: 'IBM Helvetica'; |
18 | | - font-style: italic; |
19 | | - font-weight: 200; |
20 | | - src: url('#{$font-path}/helvetica-neue-light-italic.woff2') format('woff2'), |
21 | | - url('#{$font-path}/helvetica-neue-light-italic.woff') format('woff') |
22 | | - } |
23 | 8 |
|
24 | 9 | @font-face { |
25 | 10 | font-family: 'IBM Helvetica'; |
26 | 11 | font-style: normal; |
27 | 12 | font-weight: 300; |
28 | 13 | src: url('#{$font-path}/helvetica-neue-light.woff2') format('woff2'), |
29 | | - url('#{$font-path}/helvetica-neue-light.woff') format('woff') |
| 14 | + url('#{$font-path}/helvetica-neue-light.woff') format('woff'); |
30 | 15 | } |
31 | 16 |
|
32 | 17 | @font-face { |
33 | 18 | font-family: 'IBM Helvetica'; |
34 | 19 | font-style: italic; |
35 | 20 | font-weight: 300; |
36 | 21 | src: url('#{$font-path}/helvetica-neue-light-italic.woff2') format('woff2'), |
37 | | - url('#{$font-path}/helvetica-neue-light-italic.woff') format('woff') |
| 22 | + url('#{$font-path}/helvetica-neue-light-italic.woff') format('woff'); |
38 | 23 | } |
39 | 24 |
|
40 | 25 | @font-face { |
41 | 26 | font-family: 'IBM Helvetica'; |
42 | 27 | font-style: normal; |
43 | 28 | font-weight: 400; |
44 | 29 | src: url('#{$font-path}/helvetica-neue-roman.woff2') format('woff2'), |
45 | | - url('#{$font-path}/helvetica-neue-roman.woff') format('woff') |
| 30 | + url('#{$font-path}/helvetica-neue-roman.woff') format('woff'); |
46 | 31 | } |
47 | 32 |
|
48 | 33 | @font-face { |
49 | 34 | font-family: 'IBM Helvetica'; |
50 | 35 | font-style: italic; |
51 | 36 | font-weight: 400; |
52 | 37 | src: url('#{$font-path}/helvetica-neue-roman-italic.woff2') format('woff2'), |
53 | | - url('#{$font-path}/helvetica-neue-roman-italic.woff') format('woff') |
| 38 | + url('#{$font-path}/helvetica-neue-roman-italic.woff') format('woff'); |
54 | 39 | } |
55 | 40 |
|
56 | 41 | @font-face { |
57 | 42 | font-family: 'IBM Helvetica'; |
58 | 43 | font-style: normal; |
59 | 44 | font-weight: 700; |
60 | 45 | src: url('#{$font-path}/helvetica-neue-bold.woff2') format('woff2'), |
61 | | - url('#{$font-path}/helvetica-neue-bold.woff') format('woff') |
| 46 | + url('#{$font-path}/helvetica-neue-bold.woff') format('woff'); |
62 | 47 | } |
63 | 48 |
|
64 | 49 | @font-face { |
65 | 50 | font-family: 'IBM Helvetica'; |
66 | 51 | font-style: italic; |
67 | 52 | font-weight: 700; |
68 | 53 | src: url('#{$font-path}/helvetica-neue-bold-italic.woff2') format('woff2'), |
69 | | - url('#{$font-path}/helvetica-neue-bold-italic.woff') format('woff') |
| 54 | + url('#{$font-path}/helvetica-neue-bold-italic.woff') format('woff'); |
70 | 55 | } |
71 | 56 | } |
72 | 57 |
|
73 | 58 | @include exports('css--font-face') { |
74 | 59 | @if global-variable-exists('css--font-face') and $css--font-face == true { |
75 | | - @include font-face-css('https://unpkg.com/[email protected]/src/globals/fonts/'); |
| 60 | + @include font-face-css; |
76 | 61 | } |
77 | 62 | } |
0 commit comments