diff --git a/src/globals/scss/_css--font-face.scss b/src/globals/scss/_css--font-face.scss index 6333c0fb727b..e66869593823 100644 --- a/src/globals/scss/_css--font-face.scss +++ b/src/globals/scss/_css--font-face.scss @@ -1,32 +1,17 @@ +$font-path: 'https://unpkg.com/carbon-components@7.0.0/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 { @@ -34,7 +19,7 @@ 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 { @@ -42,7 +27,7 @@ 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 { @@ -50,7 +35,7 @@ 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 { @@ -58,7 +43,7 @@ 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 { @@ -66,12 +51,12 @@ 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/carbon-components@7.0.0/src/globals/fonts/'); + @include font-face-css; } }