@carbon/type 10.1.1 → 10.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -178,7 +178,7 @@
178
178
  APPENDIX: How to apply the Apache License to your work.
179
179
 
180
180
  To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
182
  replaced with your own identifying information. (Don't include
183
183
  the brackets!) The text should be enclosed in the appropriate
184
184
  comment syntax for the file format. We also recommend that a
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2018 IBM Corp.
189
+ Copyright 2015 IBM Corp.
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -1,19 +1,18 @@
1
1
  # @carbon/type
2
2
 
3
- > Typography for digital and software products using the Carbon Design
4
- > System
3
+ > Typography for digital and software products using the Carbon Design System
5
4
 
6
5
  ## Getting started
7
6
 
8
- To install `@carbon/type` in your project, you will need to run the
9
- following command using [npm](https://www.npmjs.com/):
7
+ To install `@carbon/type` in your project, you will need to run the following
8
+ command using [npm](https://www.npmjs.com/):
10
9
 
11
10
  ```bash
12
11
  npm install -S @carbon/type
13
12
  ```
14
13
 
15
- If you prefer [Yarn](https://yarnpkg.com/en/), use the following
16
- command instead:
14
+ If you prefer [Yarn](https://yarnpkg.com/en/), use the following command
15
+ instead:
17
16
 
18
17
  ```bash
19
18
  yarn add @carbon/type
@@ -21,9 +20,9 @@ yarn add @carbon/type
21
20
 
22
21
  ## Usage
23
22
 
24
- `@carbon/type` provides a variety of ways to work with typography from
25
- the IBM Design Language. You can use all of these features either in
26
- JavaScript or Sass. These features include:
23
+ `@carbon/type` provides a variety of ways to work with typography from the IBM
24
+ Design Language. You can use all of these features either in JavaScript or Sass.
25
+ These features include:
27
26
 
28
27
  | Feature | Description |
29
28
  | ----------------------------- | ------------------------------------------------------------------------------------------------------------ |
@@ -34,8 +33,8 @@ JavaScript or Sass. These features include:
34
33
  | [Scale](#type-scale) | Provides the type scale. Can access the size at any given step (step 1, 2, 3, etc) |
35
34
  | [Styles](#type-styles) | Provides type styles for your application (heading-01, body-long-01, etc) |
36
35
 
37
- To include `@carbon/type` in your project, you can write the following
38
- in your Sass file:
36
+ To include `@carbon/type` in your project, you can write the following in your
37
+ Sass file:
39
38
 
40
39
  ```scss
41
40
  @import '@carbon/type/scss/type';
@@ -47,9 +46,9 @@ in your Sass file:
47
46
  @include carbon--font-face-sans();
48
47
  ```
49
48
 
50
- This should include the default type reset from the project, in
51
- addition to font-face definitions for IBM Plex Mono and IBM Plex Sans
52
- that come from Google Fonts.
49
+ This should include the default type reset from the project, in addition to
50
+ font-face definitions for IBM Plex Mono and IBM Plex Sans that come from Google
51
+ Fonts.
53
52
 
54
53
  If you are using `@carbon/elements`, the import paths become:
55
54
 
@@ -63,12 +62,12 @@ For example:
63
62
  @import '@carbon/elements/scss/type/styles';
64
63
  ```
65
64
 
66
- In addition, you will need to setup `node-sass` so that `node_modules`
67
- is included in the `includePaths` option. Often times, the tool that
68
- you are using to build Sass files in your project should expose this
69
- option for you to set.
65
+ In addition, you will need to setup `node-sass` so that `node_modules` is
66
+ included in the `includePaths` option. Often times, the tool that you are using
67
+ to build Sass files in your project should expose this option for you to set.
70
68
 
71
- For example, if you are using Webpack you would use `node-sass` and `sass-loader` with the following configuration for `includePaths`:
69
+ For example, if you are using Webpack you would use `node-sass` and
70
+ `sass-loader` with the following configuration for `includePaths`:
72
71
 
73
72
  ```js
74
73
  {
@@ -81,13 +80,12 @@ For example, if you are using Webpack you would use `node-sass` and `sass-loader
81
80
 
82
81
  ### Type styles
83
82
 
84
- Instead of using a type scale, `@carbon/type` provides tokens that
85
- represent what we call type styles. These tokens have a variety of
86
- properties for styling how text is rendered on a page.
83
+ Instead of using a type scale, `@carbon/type` provides tokens that represent
84
+ what we call type styles. These tokens have a variety of properties for styling
85
+ how text is rendered on a page.
87
86
 
88
87
  You can find a full reference of the type styles that are available
89
- [here](https://next.carbondesignsystem.com/guidelines/typography/productive)
90
- .
88
+ [here](https://next.carbondesignsystem.com/guidelines/typography/productive) .
91
89
 
92
90
  You can include a token in your Sass file by writing:
93
91
 
@@ -97,9 +95,9 @@ You can include a token in your Sass file by writing:
97
95
  @include carbon--type-style('token-name');
98
96
  ```
99
97
 
100
- In addition, if the type style you are using has a fluid style then
101
- you can pass in `true` as the second argument to `carbon--type-style`
102
- to enable fluid styles. For example:
98
+ In addition, if the type style you are using has a fluid style then you can pass
99
+ in `true` as the second argument to `carbon--type-style` to enable fluid styles.
100
+ For example:
103
101
 
104
102
  ```scss
105
103
  @import '@carbon/type/scss/styles';
@@ -109,28 +107,25 @@ to enable fluid styles. For example:
109
107
 
110
108
  ### Font-face
111
109
 
112
- `@carbon/type` supports three font-face definitions that you can use to
113
- add IBM Plex to your project. These font-face definitions include
114
- support for:
110
+ `@carbon/type` supports three font-face definitions that you can use to add IBM
111
+ Plex to your project. These font-face definitions include support for:
115
112
 
116
113
  - IBM Plex Mono
117
114
  - IBM Plex Sans
118
115
  - IBM Plex Serif
119
116
 
120
- For most projects, only IBM Plex Mono and IBM Plex Sans is necessary.
121
- We also provide IBM Plex Serif if you are building an editorial or
122
- marketing project.
117
+ For most projects, only IBM Plex Mono and IBM Plex Sans is necessary. We also
118
+ provide IBM Plex Serif if you are building an editorial or marketing project.
123
119
 
124
- These font-face definitions are pulling the above fonts from Google
125
- Fonts. As a result, they are not intended to be used as a production
126
- asset for your project. While you can depend on these for
127
- bootstrapping your project, we highly recommend using the fonts from
128
- the `@ibm/plex` package and hosting them on a global CDN.
120
+ These font-face definitions are pulling the above fonts from Google Fonts. As a
121
+ result, they are not intended to be used as a production asset for your project.
122
+ While you can depend on these for bootstrapping your project, we highly
123
+ recommend using the fonts from the `@ibm/plex` package and hosting them on a
124
+ global CDN.
129
125
 
130
- You can include each font-face definition by including the
131
- corresponding file and calling its mixin. For example, if you wanted
132
- to include IBM Plex Mono in your project you would write the following
133
- in your Sass file:
126
+ You can include each font-face definition by including the corresponding file
127
+ and calling its mixin. For example, if you wanted to include IBM Plex Mono in
128
+ your project you would write the following in your Sass file:
134
129
 
135
130
  ```scss
136
131
  @import '@carbon/type/scss/font-face/mono';
@@ -138,8 +133,7 @@ in your Sass file:
138
133
  @include carbon--font-face-mono();
139
134
  ```
140
135
 
141
- Similarly, you can include IBM Plex Sans and IBM Plex Serif by
142
- writing:
136
+ Similarly, you can include IBM Plex Sans and IBM Plex Serif by writing:
143
137
 
144
138
  ```scss
145
139
  @import '@carbon/type/scss/font-face/mono';
@@ -153,13 +147,12 @@ writing:
153
147
 
154
148
  ### Type classes
155
149
 
156
- The recommended way to style your application will be to use our [type
157
- styles](#type-styles). However, we also offer helper CSS classes for
158
- specific use-cases. These are also helpful when quickly prototyping a
159
- project.
150
+ The recommended way to style your application will be to use our
151
+ [type styles](#type-styles). However, we also offer helper CSS classes for
152
+ specific use-cases. These are also helpful when quickly prototyping a project.
160
153
 
161
- You can include type classes in your project by writing the following
162
- in your Sass file:
154
+ You can include type classes in your project by writing the following in your
155
+ Sass file:
163
156
 
164
157
  ```scss
165
158
  @import '@carbon/type/scss/classes';
@@ -178,16 +171,17 @@ in your Sass file:
178
171
 
179
172
  ### Font family
180
173
 
181
- `@carbon/type` provides the font stacks for all the IBM Plex fonts
182
- available. You can access the font family information by including the
183
- following import in your Sass file:
174
+ `@carbon/type` provides the font stacks for all the IBM Plex fonts available.
175
+ You can access the font family information by including the following import in
176
+ your Sass file:
184
177
 
185
178
  ```scss
186
179
  @import '@carbon/type/scss/font-family';
187
180
  ```
188
181
 
189
- The font stacks are available under the `$carbon--font-families`
190
- variable. You can also access a specific font family by using the `carbon--font-family` function by doing:
182
+ The font stacks are available under the `$carbon--font-families` variable. You
183
+ can also access a specific font family by using the `carbon--font-family`
184
+ function by doing:
191
185
 
192
186
  ```scss
193
187
  .my-selector {
@@ -195,8 +189,8 @@ variable. You can also access a specific font family by using the `carbon--font-
195
189
  }
196
190
  ```
197
191
 
198
- You can also use the `carbon--font-family` mixin to automatically set
199
- the `font-family` property for you:
192
+ You can also use the `carbon--font-family` mixin to automatically set the
193
+ `font-family` property for you:
200
194
 
201
195
  ```scss
202
196
  .my-selector {
@@ -204,14 +198,12 @@ the `font-family` property for you:
204
198
  }
205
199
  ```
206
200
 
207
- You can see all the available font families in `$carbon--font-families`
208
- .
201
+ You can see all the available font families in `$carbon--font-families` .
209
202
 
210
203
  ### Reset
211
204
 
212
- An optional type reset is provided under the `carbon--type-reset`
213
- mixin. You can include this mixin by writing the following in your
214
- Sass file:
205
+ An optional type reset is provided under the `carbon--type-reset` mixin. You can
206
+ include this mixin by writing the following in your Sass file:
215
207
 
216
208
  ```scss
217
209
  @import '@carbon/type/scss/reset';
@@ -220,25 +212,24 @@ Sass file:
220
212
  ```
221
213
 
222
214
  This reset sets some top-level properties on `html` and `body`, namely
223
- `font-size`, `font-family`, and some `text-rendering` options. We also
224
- map the `strong` tag to the semibold font weight.
215
+ `font-size`, `font-family`, and some `text-rendering` options. We also map the
216
+ `strong` tag to the semibold font weight.
225
217
 
226
218
  ### Type scale
227
219
 
228
- A type scale is provided through the `$carbon--type-scale` variable
229
- and corresponding `carbon--type-scale` function and mixin. However,
230
- for specifying type styles, the recommendation is to use [type styles](#type-styles)
231
- .
220
+ A type scale is provided through the `$carbon--type-scale` variable and
221
+ corresponding `carbon--type-scale` function and mixin. However, for specifying
222
+ type styles, the recommendation is to use [type styles](#type-styles) .
232
223
 
233
- If you are looking to use the type scale, you can include all the
234
- scale-related utilities and variables by writing the following in your
235
- Sass file:
224
+ If you are looking to use the type scale, you can include all the scale-related
225
+ utilities and variables by writing the following in your Sass file:
236
226
 
237
227
  ```scss
238
228
  @import '@carbon/type/scss/scale';
239
229
  ```
240
230
 
241
- You can access a specific step in the type scale by using the `carbon--type-scale` function:
231
+ You can access a specific step in the type scale by using the
232
+ `carbon--type-scale` function:
242
233
 
243
234
  ```scss
244
235
  @import '@carbon/type/scss/scale';
@@ -248,8 +239,7 @@ You can access a specific step in the type scale by using the `carbon--type-scal
248
239
  }
249
240
  ```
250
241
 
251
- There is also a `type-scale` mixin that will set `font-size` for your
252
- directly:
242
+ There is also a `type-scale` mixin that will set `font-size` for your directly:
253
243
 
254
244
  ```scss
255
245
  @import '@carbon/type/scss/scale';
@@ -267,17 +257,16 @@ If you're looking for `@carbon/type` API documentation, check out:
267
257
 
268
258
  ## 📚 Examples
269
259
 
270
- If you're looking for more examples on how to use `@carbon/type`, we
271
- have some examples that you can check out:
260
+ If you're looking for more examples on how to use `@carbon/type`, we have some
261
+ examples that you can check out:
272
262
 
273
263
  - [Styled-components](./examples/styled-components)
274
264
 
275
265
  ## 🙌 Contributing
276
266
 
277
- We're always looking for contributors to help us fix bugs, build new
278
- features, or help us improve the project documentation. If you're
279
- interested, definitely check out our [Contributing Guide](/.github/CONTRIBUTING.md)
280
- ! 👀
267
+ We're always looking for contributors to help us fix bugs, build new features,
268
+ or help us improve the project documentation. If you're interested, definitely
269
+ check out our [Contributing Guide](/.github/CONTRIBUTING.md) ! 👀
281
270
 
282
271
  ## 📝 License
283
272
 
package/es/index.js CHANGED
@@ -359,12 +359,14 @@ var heading01 = {
359
359
  lineHeight: rem(18),
360
360
  letterSpacing: px(0.16)
361
361
  };
362
+ var productiveHeading01 = heading01;
362
363
  var heading02 = {
363
364
  fontSize: rem(scale[2]),
364
365
  fontWeight: fontWeights.semibold,
365
366
  lineHeight: rem(22),
366
367
  letterSpacing: 0
367
368
  };
369
+ var productiveHeading02 = heading02;
368
370
  var productiveHeading03 = {
369
371
  fontSize: rem(scale[4]),
370
372
  fontWeight: fontWeights.regular,
@@ -383,6 +385,20 @@ var productiveHeading05 = {
383
385
  lineHeight: rem(40),
384
386
  letterSpacing: 0
385
387
  };
388
+ var productiveHeading06 = {
389
+ fontSize: rem(scale[9]),
390
+ fontWeight: fontWeights.light,
391
+ lineHeight: rem(50),
392
+ letterSpacing: 0
393
+ };
394
+ var productiveHeading07 = {
395
+ fontSize: rem(scale[11]),
396
+ fontWeight: fontWeights.light,
397
+ lineHeight: rem(64),
398
+ letterSpacing: 0
399
+ };
400
+ var expressiveHeading01 = heading01;
401
+ var expressiveHeading02 = heading02;
386
402
  var expressiveHeading03 = fluid({
387
403
  fontSize: rem(scale[4]),
388
404
  fontWeight: fontWeights.regular,
@@ -654,10 +670,16 @@ var styles = /*#__PURE__*/Object.freeze({
654
670
  code01: code01,
655
671
  code02: code02,
656
672
  heading01: heading01,
673
+ productiveHeading01: productiveHeading01,
657
674
  heading02: heading02,
675
+ productiveHeading02: productiveHeading02,
658
676
  productiveHeading03: productiveHeading03,
659
677
  productiveHeading04: productiveHeading04,
660
678
  productiveHeading05: productiveHeading05,
679
+ productiveHeading06: productiveHeading06,
680
+ productiveHeading07: productiveHeading07,
681
+ expressiveHeading01: expressiveHeading01,
682
+ expressiveHeading02: expressiveHeading02,
661
683
  expressiveHeading03: expressiveHeading03,
662
684
  expressiveHeading04: expressiveHeading04,
663
685
  expressiveHeading05: expressiveHeading05,
@@ -678,4 +700,4 @@ var styles = /*#__PURE__*/Object.freeze({
678
700
  * LICENSE file in the root directory of this source tree.
679
701
  */
680
702
 
681
- export { fontFamilies, fontFamily, fontWeights, fontWeight, print, reset, getTypeSize, scale, styles, caption01, label01, helperText01, bodyShort01, bodyLong01, bodyShort02, bodyLong02, code01, code02, heading01, heading02, productiveHeading03, productiveHeading04, productiveHeading05, expressiveHeading03, expressiveHeading04, expressiveHeading05, expressiveHeading06, expressiveParagraph01, quotation01, quotation02, display01, display02, display03, display04 };
703
+ export { fontFamilies, fontFamily, fontWeights, fontWeight, print, reset, getTypeSize, scale, styles, caption01, label01, helperText01, bodyShort01, bodyLong01, bodyShort02, bodyLong02, code01, code02, heading01, productiveHeading01, heading02, productiveHeading02, productiveHeading03, productiveHeading04, productiveHeading05, productiveHeading06, productiveHeading07, expressiveHeading01, expressiveHeading02, expressiveHeading03, expressiveHeading04, expressiveHeading05, expressiveHeading06, expressiveParagraph01, quotation01, quotation02, display01, display02, display03, display04 };
package/lib/index.js CHANGED
@@ -363,12 +363,14 @@ var heading01 = {
363
363
  lineHeight: layout.rem(18),
364
364
  letterSpacing: layout.px(0.16)
365
365
  };
366
+ var productiveHeading01 = heading01;
366
367
  var heading02 = {
367
368
  fontSize: layout.rem(scale[2]),
368
369
  fontWeight: fontWeights.semibold,
369
370
  lineHeight: layout.rem(22),
370
371
  letterSpacing: 0
371
372
  };
373
+ var productiveHeading02 = heading02;
372
374
  var productiveHeading03 = {
373
375
  fontSize: layout.rem(scale[4]),
374
376
  fontWeight: fontWeights.regular,
@@ -387,6 +389,20 @@ var productiveHeading05 = {
387
389
  lineHeight: layout.rem(40),
388
390
  letterSpacing: 0
389
391
  };
392
+ var productiveHeading06 = {
393
+ fontSize: layout.rem(scale[9]),
394
+ fontWeight: fontWeights.light,
395
+ lineHeight: layout.rem(50),
396
+ letterSpacing: 0
397
+ };
398
+ var productiveHeading07 = {
399
+ fontSize: layout.rem(scale[11]),
400
+ fontWeight: fontWeights.light,
401
+ lineHeight: layout.rem(64),
402
+ letterSpacing: 0
403
+ };
404
+ var expressiveHeading01 = heading01;
405
+ var expressiveHeading02 = heading02;
390
406
  var expressiveHeading03 = fluid({
391
407
  fontSize: layout.rem(scale[4]),
392
408
  fontWeight: fontWeights.regular,
@@ -658,10 +674,16 @@ var styles = /*#__PURE__*/Object.freeze({
658
674
  code01: code01,
659
675
  code02: code02,
660
676
  heading01: heading01,
677
+ productiveHeading01: productiveHeading01,
661
678
  heading02: heading02,
679
+ productiveHeading02: productiveHeading02,
662
680
  productiveHeading03: productiveHeading03,
663
681
  productiveHeading04: productiveHeading04,
664
682
  productiveHeading05: productiveHeading05,
683
+ productiveHeading06: productiveHeading06,
684
+ productiveHeading07: productiveHeading07,
685
+ expressiveHeading01: expressiveHeading01,
686
+ expressiveHeading02: expressiveHeading02,
665
687
  expressiveHeading03: expressiveHeading03,
666
688
  expressiveHeading04: expressiveHeading04,
667
689
  expressiveHeading05: expressiveHeading05,
@@ -701,10 +723,16 @@ exports.bodyLong02 = bodyLong02;
701
723
  exports.code01 = code01;
702
724
  exports.code02 = code02;
703
725
  exports.heading01 = heading01;
726
+ exports.productiveHeading01 = productiveHeading01;
704
727
  exports.heading02 = heading02;
728
+ exports.productiveHeading02 = productiveHeading02;
705
729
  exports.productiveHeading03 = productiveHeading03;
706
730
  exports.productiveHeading04 = productiveHeading04;
707
731
  exports.productiveHeading05 = productiveHeading05;
732
+ exports.productiveHeading06 = productiveHeading06;
733
+ exports.productiveHeading07 = productiveHeading07;
734
+ exports.expressiveHeading01 = expressiveHeading01;
735
+ exports.expressiveHeading02 = expressiveHeading02;
708
736
  exports.expressiveHeading03 = expressiveHeading03;
709
737
  exports.expressiveHeading04 = expressiveHeading04;
710
738
  exports.expressiveHeading05 = expressiveHeading05;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/type",
3
3
  "description": "Typography for digital and software products using the Carbon Design System",
4
- "version": "10.1.1",
4
+ "version": "10.2.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -26,15 +26,15 @@
26
26
  "access": "public"
27
27
  },
28
28
  "scripts": {
29
- "build": "yarn clean && bundler bundle src/index.js --name CarbonType && bundler sassdoc 'scss'",
30
- "clean": "rimraf css es lib umd"
29
+ "build": "yarn clean && bundler bundle src/index.js --name CarbonType && bundler sassdoc 'scss/**/*.scss' -i '**/{_inlined,vendor}**' && bundler inline && bundler check 'scss/*.scss'",
30
+ "clean": "rimraf css es lib umd scss/_inlined scss/vendor"
31
31
  },
32
32
  "dependencies": {
33
- "@carbon/import-once": "10.1.0",
34
- "@carbon/layout": "10.1.1"
33
+ "@carbon/import-once": "10.2.0",
34
+ "@carbon/layout": "10.2.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@carbon/bundler": "10.1.1",
37
+ "@carbon/bundler": "10.2.0",
38
38
  "rimraf": "^2.6.2"
39
39
  },
40
40
  "eyeglass": {
@@ -43,5 +43,5 @@
43
43
  "sassDir": "scss",
44
44
  "needs": "^1.3.0"
45
45
  },
46
- "gitHead": "0931cfcf4a7636d6e3f5aff3ab8d7d7f2d4ecb99"
46
+ "gitHead": "e71825a0cf44f6f41fee7d2b0dd9c57d7bda126a"
47
47
  }
@@ -0,0 +1,41 @@
1
+ //
2
+ // Copyright IBM Corp. 2018, 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
+ @import 'prefix';
9
+ @import 'styles';
10
+ @import 'font-family';
11
+
12
+ /// Create type classes for font families, weights, styles
13
+ /// @access public
14
+ /// @group @carbon/type
15
+ @mixin carbon--type-classes {
16
+ // Font families
17
+ @each $name, $value in $carbon--font-families {
18
+ .#{$prefix}--type-#{$name} {
19
+ font-family: $value;
20
+ }
21
+ }
22
+
23
+ // Font weights
24
+ @each $name, $value in $carbon--font-weights {
25
+ .#{$prefix}--type-#{$name} {
26
+ font-weight: $value;
27
+ }
28
+ }
29
+
30
+ // Font styles
31
+ .#{$prefix}--type-italic {
32
+ font-style: italic;
33
+ }
34
+
35
+ // Type styles
36
+ @each $name, $value in $tokens {
37
+ .#{$prefix}--type-#{$name} {
38
+ @include carbon--type-style($name, map-has-key($value, breakpoints));
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,70 @@
1
+ //
2
+ // Copyright IBM Corp. 2018, 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 family fallbacks for: IBM Plex Mono, IBM Plex Sans, IBM Plex Sans
9
+ /// Condensed, IBM Plex Sans Hebrew, and IBM Plex Serif
10
+ /// @type Map
11
+ /// @access public
12
+ /// @group @carbon/type
13
+ $carbon--font-families: (
14
+ 'mono':
15
+ unquote(
16
+ "'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace"
17
+ ),
18
+ 'sans': unquote("'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif"),
19
+ 'sans-condensed':
20
+ unquote("'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif"),
21
+ 'sans-hebrew':
22
+ unquote(
23
+ "'IBM Plex Sans Hebrew', 'Helvetica Hebrew', 'Arial Hebrew', sans-serif"
24
+ ),
25
+ 'serif': unquote("'IBM Plex Serif', 'Georgia', Times, serif"),
26
+ );
27
+
28
+ /// Get the font-family for an IBM Plex font
29
+ /// @param {String} $name
30
+ /// @return {String}
31
+ /// @access public
32
+ /// @group @carbon/type
33
+ @function carbon--font-family($name) {
34
+ @return map-get($carbon--font-families, $name);
35
+ }
36
+
37
+ /// Include the `font-family` definition for the given name in your selector
38
+ /// @param {String} $name
39
+ /// @access public
40
+ /// @group @carbon/type
41
+ @mixin carbon--font-family($name) {
42
+ font-family: carbon--font-family($name);
43
+ }
44
+
45
+ /// Suggested font weights to be used in product
46
+ /// @type Map
47
+ /// @access public
48
+ /// @group @carbon/type
49
+ $carbon--font-weights: (
50
+ 'light': 300,
51
+ 'regular': 400,
52
+ 'semibold': 600,
53
+ );
54
+
55
+ /// Retrieve the font-weight value for a given name
56
+ /// @param {String} $weight
57
+ /// @return {Number}
58
+ /// @access public
59
+ /// @group @carbon/type
60
+ @function carbon--font-weight($weight) {
61
+ @return map-get($carbon--font-weights, $weight);
62
+ }
63
+
64
+ /// Set the `font-weight` property with the value for a given name
65
+ /// @param {String} $weight
66
+ /// @access public
67
+ /// @group @carbon/type
68
+ @mixin carbon--font-weight($weight) {
69
+ font-weight: carbon--font-weight($weight);
70
+ }
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright IBM Corp. 2018, 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
+ /// @type String
9
+ /// @access public
10
+ /// @group @carbon/type
11
+ $prefix: 'bx' !default;
@@ -0,0 +1,43 @@
1
+ //
2
+ // Copyright IBM Corp. 2018, 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
+ @import '../vendor/@carbon/layout/convert';
9
+ @import 'font-family';
10
+
11
+ /// Include a type reset for a given body and mono font family
12
+ /// @param {Number} $base-font-size [$carbon--base-font-size] - The base font size for your document
13
+ /// @param {String} $body-font-family [carbon--font-family('sans')] - The font family used on the `<body>` element
14
+ /// @param {String} $mono-font-family [carbon--font-family('mono')] - The font family used on elements that require mono fonts, like the `<code>` element
15
+ /// @access public
16
+ /// @group @carbon/type
17
+ @mixin carbon--type-reset(
18
+ $base-font-size: $carbon--base-font-size,
19
+ $body-font-family: carbon--font-family('sans'),
20
+ $mono-font-family: carbon--font-family('mono')
21
+ ) {
22
+ html {
23
+ font-size: $base-font-size;
24
+ }
25
+
26
+ body {
27
+ font-family: $body-font-family;
28
+ font-weight: 400;
29
+ text-rendering: optimizeLegibility;
30
+ -webkit-font-smoothing: antialiased;
31
+ -moz-osx-font-smoothing: grayscale;
32
+ }
33
+
34
+ // IBM Plex uses semibold instead of bold, as a result we need to map
35
+ // tags that use `font-weight: bold` to the semibold value
36
+ strong {
37
+ font-weight: 600;
38
+ }
39
+
40
+ code {
41
+ font-family: $mono-font-family;
42
+ }
43
+ }