UNPKG

3.08 kBSCSSView Raw
1//
2// Copyright IBM Corp. 2016, 2018
3//
4// This source code is licensed under the Apache-2.0 license found in the
5// LICENSE file in the root directory of this source tree.
6//
7
8$font-path: 'https://unpkg.com/carbon-components@latest/src/globals/fonts' !default;
9
10@import './vendor/@carbon/elements/scss/import-once/import-once';
11@import 'css--plex-core';
12@import 'helper-mixins';
13@import 'feature-flags';
14@import './vendor/@carbon/elements/scss/type/font-face/mono';
15@import './vendor/@carbon/elements/scss/type/font-face/sans';
16
17/// @access public
18/// @deprecated (For v10) Use `@include carbon--font-face-sans()`, `@include carbon--font-face-mono()`, etc.
19@mixin helvetica-font-face {
20 // Default font directory, `!default` flag allows user override.
21 // (font files are configured to be served as static assets from server.js)
22 @include deprecate('Usage of Helvetica font in `carbon-components` has been deprecated.') {
23 @include check-default-font-path {
24 @font-face {
25 font-family: 'IBM Helvetica';
26 font-style: normal;
27 font-weight: 300;
28 src: url('#{$font-path}/helvetica-neue-light.woff2') format('woff2'),
29 url('#{$font-path}/helvetica-neue-light.woff') format('woff');
30 }
31
32 @font-face {
33 font-family: 'IBM Helvetica';
34 font-style: italic;
35 font-weight: 300;
36 src: url('#{$font-path}/helvetica-neue-light-italic.woff2') format('woff2'),
37 url('#{$font-path}/helvetica-neue-light-italic.woff') format('woff');
38 }
39
40 @font-face {
41 font-family: 'IBM Helvetica';
42 font-style: normal;
43 font-weight: 400;
44 src: url('#{$font-path}/helvetica-neue-roman.woff2') format('woff2'),
45 url('#{$font-path}/helvetica-neue-roman.woff') format('woff');
46 }
47
48 @font-face {
49 font-family: 'IBM Helvetica';
50 font-style: italic;
51 font-weight: 400;
52 src: url('#{$font-path}/helvetica-neue-roman-italic.woff2') format('woff2'),
53 url('#{$font-path}/helvetica-neue-roman-italic.woff') format('woff');
54 }
55
56 @font-face {
57 font-family: 'IBM Helvetica';
58 font-style: normal;
59 font-weight: 700;
60 src: url('#{$font-path}/helvetica-neue-bold.woff2') format('woff2'),
61 url('#{$font-path}/helvetica-neue-bold.woff') format('woff');
62 }
63
64 @font-face {
65 font-family: 'IBM Helvetica';
66 font-style: italic;
67 font-weight: 700;
68 src: url('#{$font-path}/helvetica-neue-bold-italic.woff2') format('woff2'),
69 url('#{$font-path}/helvetica-neue-bold-italic.woff') format('woff');
70 }
71 }
72 }
73}
74
75@include exports('css--font-face') {
76 @if not global-variable-exists('css--font-face') or $css--font-face == true {
77 @if global-variable-exists('css--plex') and $css--plex == true {
78 @if feature-flag-enabled('components-x') {
79 @include carbon--font-face-mono();
80 @include carbon--font-face-sans();
81 } @else {
82 @include plex-font-face;
83 }
84 } @else {
85 @include helvetica-font-face;
86 }
87 }
88}