Skip to content

Commit

Permalink
feat(styles): export font weights and font family (#11473)
Browse files Browse the repository at this point in the history
* feat(styles): export font weights and font family

* fix(styles): add tests for new exports

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
abbeyhrt and kodiakhq[bot] authored May 24, 2022
1 parent 6f9f209 commit 0904046
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/styles/scss/__tests__/type-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,27 @@ describe('@carbon/styles/scss/type', () => {
reset: meta.mixin-exists('reset', 'type'),
type-style: meta.mixin-exists('type-style', 'type'),
font-family: meta.mixin-exists('font-family', 'type'),
font-weight: meta.mixin-exists('font-family', 'type'),
default-type: meta.mixin-exists('default-type', 'type'),
type-classes: meta.mixin-exists('type-classes', 'type'),
),
functions: (
font-weight: meta.function-exists('font-family', 'type'),
),
));
`);

const { value: api } = get('api');
expect(api.functions).toEqual({
'font-weight': true,
});
expect(api.mixins).toEqual({
reset: true,
'type-style': true,
'font-family': true,
'default-type': true,
'type-classes': true,
'font-weight': true,
});
expect(api.variables).toMatchInlineSnapshot(`
Array [
Expand Down Expand Up @@ -73,6 +81,8 @@ describe('@carbon/styles/scss/type', () => {
"display-02",
"display-03",
"display-04",
"font-families",
"font-weights",
"tokens",
]
`);
Expand Down
3 changes: 3 additions & 0 deletions packages/styles/scss/type/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
font-family,
default-type,
type-classes,
font-weight,

// Variables
$caption-01,
Expand Down Expand Up @@ -46,6 +47,8 @@
$display-02,
$display-03,
$display-04,
$font-families,
$font-weights,
$tokens;

@use '@carbon/type';
Expand Down

0 comments on commit 0904046

Please sign in to comment.