1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | $font-path: 'https://unpkg.com/carbon-components@latest/src/globals/fonts' !default;
|
9 |
|
10 | @import 'functions';
|
11 | @import 'helper-mixins';
|
12 | @import './vendor/@carbon/elements/scss/import-once/import-once';
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | $unicodes: (
|
20 | Pi:
|
21 | 'U+03C0, U+0E3F, U+2070, U+2074-2079, U+2080-2089, U+2113, U+2116, U+2126, U+212E, U+2150-2151, U+2153-215E, U+2190-2199, U+21A9-21AA, U+21B0-21B3, U+21B6-21B7, U+21BA-21BB, U+21C4, U+21C6, U+2202, U+2206, U+220F, U+2211, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25CA, U+2713, U+274C, U+2B0E-2B11, U+EBE1, U+EBE3-EBE4, U+EBE6-EBE7, U+ECE0, U+EFCC',
|
22 | Latin3: 'U+0102-0103, U+1EA0-1EF9, U+20AB',
|
23 | Latin2: 'U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF, U+FB01-FB02',
|
24 | Latin1: 'U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FB01-FB02',
|
25 | );
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | $families: (
|
33 | 'Mono': unquote("'ibm-plex-mono'"),
|
34 | 'Sans': unquote("'ibm-plex-sans'"),
|
35 | );
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | $fallbacks: (
|
43 | 'Mono': unquote("'ibm-plex-mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace"),
|
44 | 'Sans': unquote("'ibm-plex-sans', 'Helvetica Neue', Arial, sans-serif"),
|
45 | );
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 | $weights: (
|
53 | 'Light': (
|
54 | font-style: normal,
|
55 | font-weight: 300,
|
56 | ),
|
57 | 'Regular': (
|
58 | font-style: normal,
|
59 | font-weight: 400,
|
60 | ),
|
61 | 'SemiBold': (
|
62 | font-style: normal,
|
63 | font-weight: 600,
|
64 | ),
|
65 | ) !default;
|
66 |
|
67 |
|
68 | @mixin check-default-font-path {
|
69 | @if (str-index($font-path, 'https://unpkg.com/') == 1) {
|
70 | @warn 'The default font path (#{$font-path}) should be used only for demonstration/evaluation purposes. For production applications, please host fonts in your own CDN and change `$font-path` accordingly.';
|
71 | @content;
|
72 | } @else {
|
73 | @content;
|
74 | }
|
75 | }
|
76 |
|
77 |
|
78 | @mixin plex-font-face {
|
79 | @include deprecate(
|
80 | '`@include plex-font-face` has been removed. ' +
|
81 | 'Use `@include carbon--font-face-sans()`, `@include carbon--font-face-mono()`, etc. instead.',
|
82 | feature-flag-enabled('components-x'),
|
83 | true
|
84 | ) {
|
85 | @include check-default-font-path {
|
86 | @each $family, $name in $families {
|
87 | @each $weight, $styles in $weights {
|
88 | @font-face {
|
89 | font-family: $name;
|
90 | font-style: map-get($styles, 'font-style');
|
91 | font-weight: map-get($styles, 'font-weight');
|
92 | src: url('#{$font-path}/IBMPlex#{$family}-#{$weight}.woff') format('woff');
|
93 | }
|
94 |
|
95 | @each $unicode, $range in $unicodes {
|
96 | @font-face {
|
97 | font-family: $name;
|
98 | font-style: map-get($styles, 'font-style');
|
99 | font-weight: map-get($styles, 'font-weight');
|
100 | src: url('#{$font-path}/IBMPlex#{$family}-#{$weight}-#{$unicode}.woff2') format('woff2');
|
101 | unicode-range: map-get($unicodes, $unicode);
|
102 | }
|
103 | }
|
104 | }
|
105 | }
|
106 | }
|
107 | }
|
108 | }
|