diff --git a/lib/components/src/typography/typography.stories.mdx b/lib/components/src/typography/typography.stories.mdx new file mode 100644 index 000000000000..8077be5509e9 --- /dev/null +++ b/lib/components/src/typography/typography.stories.mdx @@ -0,0 +1,75 @@ +import { typography } from '@storybook/theming'; +import { Meta, Typeset } from '@storybook/addon-docs'; + +export const fontSizes = ['l3', 'l2', 'l1', 'm3', 'm2', 'm1', 's3', 's2', 's1'].map( + (size) => `${typography.size[size]}px` +); + +export const sampleText = + 'Storybook is an open source tool for building UI components and pages in isolation. It streamlines UI development, testing, and documentation.'; + + + +## Sans-serif + +``` +font-family: + "Nunito Sans", + -apple-system, + ".SFNSText-Regular", + "San Francisco", + BlinkMacSystemFont, + "Segoe UI", + "Helvetica Neue", + Helvetica, + Arial, + sans-serif; +``` + + + + + +## Monospace + +``` +font-family: + ui-monospace, + Menlo, + Monaco, + "Roboto Mono", + "Oxygen Mono", + "Ubuntu Monospace", + "Source Code Pro", + "Droid Sans Mono", + "Courier New", + monospace; +``` + + + diff --git a/lib/components/src/typography/typography.stories.tsx b/lib/components/src/typography/typography.stories.tsx deleted file mode 100644 index 6429be56dbaf..000000000000 --- a/lib/components/src/typography/typography.stories.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import React from 'react'; -import { styled } from '@storybook/theming'; -import { storiesOf } from '@storybook/react'; - -const Info = styled.div({ - marginBottom: '3rem', -}); - -const Heading1 = styled.div(({ theme }) => ({ - fontSize: theme.typography.size.l3, -})); -const Heading2 = styled.div(({ theme }) => ({ - fontSize: theme.typography.size.l2, -})); -const Heading3 = styled.div(({ theme }) => ({ - fontSize: theme.typography.size.l1, -})); -const Heading4 = styled.div(({ theme }) => ({ - fontSize: theme.typography.size.m3, -})); -const Heading5 = styled.div(({ theme }) => ({ - fontSize: theme.typography.size.m3, -})); -const Heading6 = styled.div(({ theme }) => ({ - fontSize: theme.typography.size.m1, -})); -const Heading7 = styled.div(({ theme }) => ({ - fontSize: theme.typography.size.s3, -})); -const Heading8 = styled.div(({ theme }) => ({ - fontSize: theme.typography.size.s2, -})); -const Heading9 = styled.div(({ theme }) => ({ - fontSize: theme.typography.size.s1, -})); - -const HeadingWrapper = styled.div(({ theme }) => ({ - fontWeight: theme.typography.weight.black, - '> *': { - marginBottom: '1rem', - }, -})); - -const Type1 = styled.div(({ theme }) => ({ - fontSize: theme.typography.size.s3, -})); -const Type2 = styled.div(({ theme }) => ({ - fontSize: theme.typography.size.s2, -})); -const Type3 = styled.div(({ theme }) => ({ - fontSize: theme.typography.size.s1, -})); - -const TypeWrapper = styled.div({ - '> *': { - marginBottom: '1rem', - }, -}); - -const Wrapper = styled.div({ - display: 'flex', - flexDirection: 'row', - '> *': { - flex: 1, - paddingRight: 40, - }, -}); - -const Page = styled.div({ - padding: '3rem', -}); - -storiesOf('Basics/typography', module).add('all', () => ( - - -
- Font-family: "Nunito sans", Apple system font ... sans-serif -
-
- UI text size: 13px -
-
- Document/Markdown text size: 14px -
-
- Code font: Operator Mono, Fira Code, Consolas ... monospace -
-
- Weights: 400(normal), 600(bold), 900(black) -
-
- - - 48 heading - 40 heading - 32 heading - 28 heading - 24 heading - 20 heading - 16 heading - 14 heading - 12 heading - - - 16 The quick brown fox jumps over the lazy dog - 14 The quick brown fox jumps over the lazy dog - 12 The quick brown fox jumps over the lazy dog - - -
-)); diff --git a/lib/theming/src/base.ts b/lib/theming/src/base.ts index 7414922d9380..51d1643e5826 100644 --- a/lib/theming/src/base.ts +++ b/lib/theming/src/base.ts @@ -66,14 +66,15 @@ export const typography = { 'sans-serif', ].join(', '), mono: [ - '"Operator Mono"', - '"Fira Code Retina"', - '"Fira Code"', - '"FiraCode-Retina"', - '"Andale Mono"', - '"Lucida Console"', - 'Consolas', + 'ui-monospace', + 'Menlo', 'Monaco', + '"Roboto Mono"', + '"Oxygen Mono"', + '"Ubuntu Monospace"', + '"Source Code Pro"', + '"Droid Sans Mono"', + '"Courier New"', 'monospace', ].join(', '), },