Skip to content

Commit 698c234

Browse files
hellobrianchrisdhanaraj
authored andcommitted
fix(font-path-var): allow font-path default to be overwritten (#172)
* fix(font-path-var): allow font-path default to be overwritten * refactor(font-face): remove font-weight 200 and param * fix(font-face): re-add font-path param Error for wrong number of args * fix(font-face): nvm! remove font-path param again
1 parent 1a2d80f commit 698c234

File tree

1 file changed

+10
-25
lines changed

1 file changed

+10
-25
lines changed
Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,62 @@
1+
$font-path: 'https://unpkg.com/[email protected]/src/globals/fonts/' !default;
2+
13
@import 'import-once';
24

3-
@mixin font-face-css($path) {
5+
@mixin font-face-css {
46
// Default font directory, `!default` flag allows user override.
57
// (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-
}
238

249
@font-face {
2510
font-family: 'IBM Helvetica';
2611
font-style: normal;
2712
font-weight: 300;
2813
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');
3015
}
3116

3217
@font-face {
3318
font-family: 'IBM Helvetica';
3419
font-style: italic;
3520
font-weight: 300;
3621
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');
3823
}
3924

4025
@font-face {
4126
font-family: 'IBM Helvetica';
4227
font-style: normal;
4328
font-weight: 400;
4429
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');
4631
}
4732

4833
@font-face {
4934
font-family: 'IBM Helvetica';
5035
font-style: italic;
5136
font-weight: 400;
5237
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');
5439
}
5540

5641
@font-face {
5742
font-family: 'IBM Helvetica';
5843
font-style: normal;
5944
font-weight: 700;
6045
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');
6247
}
6348

6449
@font-face {
6550
font-family: 'IBM Helvetica';
6651
font-style: italic;
6752
font-weight: 700;
6853
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');
7055
}
7156
}
7257

7358
@include exports('css--font-face') {
7459
@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;
7661
}
7762
}

0 commit comments

Comments
 (0)