Skip to content

Commit

Permalink
feat: use document component as wrapper for all stories
Browse files Browse the repository at this point in the history
Inline components such as Link and Form Label don't declare a font-family,
usually only block level components do so. This changes fixes the font rendering
for all inline components that don't declare a custom font family.
  • Loading branch information
Robbert committed Jun 27, 2021
1 parent 14f362b commit 8b48e02
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions components/document/bem.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @license EUPL-1.2
* Copyright (c) 2021 Robbert Broersma
*/

.utrecht-document {
background-color: var(--utrecht-document-background-color, inherit);
color: var(--utrecht-document-color, inherit);
font-family: var(--utrecht-document-font-family, inherit);
font-size: var(--utrecht-document-font-size, inherit);
line-height: var(--utrecht-document-line-height, inherit);
}
5 changes: 5 additions & 0 deletions packages/storybook/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import '@utrecht/design-tokens/dist/index.css';
import '@utrecht/design-tokens/dist/custom.css';
import '../../../components/document/bem.css';

import React from 'react';

const tokenContext = require.context('!!raw-loader!../src', true, /.\.(css|less|scss|svg)$/);

Expand Down Expand Up @@ -48,3 +51,5 @@ export const parameters = {
},
},
};

export const decorators = [(story) => `<div class="utrecht-document">${story()}</div>`];

0 comments on commit 8b48e02

Please sign in to comment.