-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
1a2d80f
commit 698c234
Showing
1 changed file
with
10 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,62 @@ | ||
$font-path: 'https://unpkg.com/[email protected]/src/globals/fonts/' !default; | ||
|
||
@import 'import-once'; | ||
|
||
@mixin font-face-css($path) { | ||
@mixin font-face-css { | ||
// Default font directory, `!default` flag allows user override. | ||
// (font files are configured to be served as static assets from server.js) | ||
$font-path: '#{$path}' !default; | ||
|
||
@font-face { | ||
font-family: 'IBM Helvetica'; | ||
font-style: normal; | ||
font-weight: 200; | ||
src: url('#{$font-path}/helvetica-neue-light.woff2') format('woff2'), | ||
url('#{$font-path}/helvetica-neue-light.woff') format('woff') | ||
} | ||
|
||
@font-face { | ||
font-family: 'IBM Helvetica'; | ||
font-style: italic; | ||
font-weight: 200; | ||
src: url('#{$font-path}/helvetica-neue-light-italic.woff2') format('woff2'), | ||
url('#{$font-path}/helvetica-neue-light-italic.woff') format('woff') | ||
} | ||
|
||
@font-face { | ||
font-family: 'IBM Helvetica'; | ||
font-style: normal; | ||
font-weight: 300; | ||
src: url('#{$font-path}/helvetica-neue-light.woff2') format('woff2'), | ||
url('#{$font-path}/helvetica-neue-light.woff') format('woff') | ||
url('#{$font-path}/helvetica-neue-light.woff') format('woff'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'IBM Helvetica'; | ||
font-style: italic; | ||
font-weight: 300; | ||
src: url('#{$font-path}/helvetica-neue-light-italic.woff2') format('woff2'), | ||
url('#{$font-path}/helvetica-neue-light-italic.woff') format('woff') | ||
url('#{$font-path}/helvetica-neue-light-italic.woff') format('woff'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'IBM Helvetica'; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: url('#{$font-path}/helvetica-neue-roman.woff2') format('woff2'), | ||
url('#{$font-path}/helvetica-neue-roman.woff') format('woff') | ||
url('#{$font-path}/helvetica-neue-roman.woff') format('woff'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'IBM Helvetica'; | ||
font-style: italic; | ||
font-weight: 400; | ||
src: url('#{$font-path}/helvetica-neue-roman-italic.woff2') format('woff2'), | ||
url('#{$font-path}/helvetica-neue-roman-italic.woff') format('woff') | ||
url('#{$font-path}/helvetica-neue-roman-italic.woff') format('woff'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'IBM Helvetica'; | ||
font-style: normal; | ||
font-weight: 700; | ||
src: url('#{$font-path}/helvetica-neue-bold.woff2') format('woff2'), | ||
url('#{$font-path}/helvetica-neue-bold.woff') format('woff') | ||
url('#{$font-path}/helvetica-neue-bold.woff') format('woff'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'IBM Helvetica'; | ||
font-style: italic; | ||
font-weight: 700; | ||
src: url('#{$font-path}/helvetica-neue-bold-italic.woff2') format('woff2'), | ||
url('#{$font-path}/helvetica-neue-bold-italic.woff') format('woff') | ||
url('#{$font-path}/helvetica-neue-bold-italic.woff') format('woff'); | ||
} | ||
} | ||
|
||
@include exports('css--font-face') { | ||
@if global-variable-exists('css--font-face') and $css--font-face == true { | ||
@include font-face-css('https://unpkg.com/[email protected]/src/globals/fonts/'); | ||
@include font-face-css; | ||
} | ||
} |