diff --git a/.storybook/preview.js b/.storybook/preview.js index a61f075f..5fdf905a 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -51,7 +51,7 @@ export const parameters = { 'SCSS', ['Intro', '*'], 'Typography', - ['Intro', '*'], + ['Intro', 'How to use', ['Text styles', '*'], '*'], 'Actions', ['Intro', '*'], 'Contributing', diff --git a/src/docs/typography/customising.stories.mdx b/src/docs/typography/customising.stories.mdx new file mode 100644 index 00000000..16acd595 --- /dev/null +++ b/src/docs/typography/customising.stories.mdx @@ -0,0 +1,12 @@ +import { Meta } from '@storybook/addon-docs'; +import { parameters } from '$docs/utils/docsPage.js'; + +import Typeset from './typeset.png'; +import TypeGuides from './type-guides.png' + + + +![](https://graphics.thomsonreuters.com/style-assets/images/logos/reuters-graphics-logo/svg/graphics-logo-color-dark.svg) + +# Customising typographic styles + diff --git a/src/docs/typography/docs/FaceDemo.svelte b/src/docs/typography/docs/FaceDemo.svelte new file mode 100644 index 00000000..f9666653 --- /dev/null +++ b/src/docs/typography/docs/FaceDemo.svelte @@ -0,0 +1,20 @@ + + +
+ As mass-printing technologies like the printing press spread, newspapers were + established to provide increasingly literate audiences with the news. The + first references to privately owned newspaper publishers in China date to the + late Ming dynasty in 1582. Johann Carolus's Relation aller Fürnemmen und + gedenckwürdigen Historien, published in 1605 in Strasbourg, is often + recognized as the first newspaper in Europe. +
+ + diff --git a/src/docs/typography/docs/SizeDemo.svelte b/src/docs/typography/docs/SizeDemo.svelte new file mode 100644 index 00000000..af2476f6 --- /dev/null +++ b/src/docs/typography/docs/SizeDemo.svelte @@ -0,0 +1,20 @@ + + +
+ As mass-printing technologies like the printing press spread, newspapers were + established to provide increasingly literate audiences with the news. The + first references to privately owned newspaper publishers in China date to the + late Ming dynasty in 1582. Johann Carolus's Relation aller Fürnemmen und + gedenckwürdigen Historien, published in 1605 in Strasbourg, is often + recognized as the first newspaper in Europe. +
+ + diff --git a/src/docs/typography/docs/StyleDemo.svelte b/src/docs/typography/docs/StyleDemo.svelte new file mode 100644 index 00000000..d08742e3 --- /dev/null +++ b/src/docs/typography/docs/StyleDemo.svelte @@ -0,0 +1,17 @@ + + +
+ The agency was established in London in 1851 by the German-born Paul Julius + Reuter. It was acquired by the Thomson Corporation of Canada in 2008 and now + makes up the media division of Thomson Reuters. +
+ + diff --git a/src/docs/typography/docs/face.md b/src/docs/typography/docs/face.md new file mode 100644 index 00000000..aeef00cd --- /dev/null +++ b/src/docs/typography/docs/face.md @@ -0,0 +1,25 @@ +There are four font families provided via the `Theme`, which feeds into all the text styles. If you need to specifically apply font family styles to your HTML elements, you can use the following methods. + +## With CSS classes + +Add the `typeface-` class to any element for the classes to take effect. Check out the available classes and their associated sizes in the example below. + +```svelte +
...your text here
+``` + +## With SCSS mixins + +Include the mixins in your stylesheets as shown below. + +```svelte +
...your text here
+ + +``` diff --git a/src/docs/typography/docs/size.md b/src/docs/typography/docs/size.md new file mode 100644 index 00000000..369fdef1 --- /dev/null +++ b/src/docs/typography/docs/size.md @@ -0,0 +1,31 @@ +The font sizes are used to style the various elements on the page, including margins and padding utilities. This is to ensure the harmonic rhythm of the page set by the system. + +You may need to use the sizes from this scale in situations like - + +- Adding sizes in your custom svelte component +- Sizing chart elemnents in D3 +- Defining bespoke style beyond what is provided by the `text-styles` + +## With CSS classes + +Add the `font-size-*` class to any element for the classes to take effect, where `*` = 1 to 6. Check out the available classes and their associated sizes in the example below. + +```svelte +
...your text here
+``` + +## With SCSS mixins + +Include the mixins in your stylesheets as shown below. + +```svelte +
...your text here
+ + +``` diff --git a/src/docs/typography/docs/style.md b/src/docs/typography/docs/style.md new file mode 100644 index 00000000..0442231d --- /dev/null +++ b/src/docs/typography/docs/style.md @@ -0,0 +1,32 @@ +The styles are automatically applied to native HTML elements like the `H` and `p` tags, as well as `GraphicsKit` components. For more details, check out the `Type system` section in the `Intro`. + +```svelte +
+

Here's a section title

+

and some text to go with it...

+
+``` + +## With CSS classes + +Add the `font-` class to any element for the classes to take effect. Check out the available classes and their associated styles in the example below. + +```svelte +
...your text here
+``` + +## With SCSS mixins + +Include the mixins in your stylesheets as shown below. + +```svelte +
...your text here
+ + +``` diff --git a/src/docs/typography/intro.stories.mdx b/src/docs/typography/intro.stories.mdx index bb36c3e9..d94ee936 100644 --- a/src/docs/typography/intro.stories.mdx +++ b/src/docs/typography/intro.stories.mdx @@ -14,6 +14,8 @@ Our design system includes a typographic scale based on the scale of fifths to c The typographic scale is set using the CSS variable in the theme component. You can customise them if you need a bespoke typesetting for your project. + + ## The type system +## Default usage + +In your projects, you will use the typographic styles as per the function – +- Page title, subheads and section titles +- Body copy +- Graphic descriptions, captions and other notes + +The styles are also applied to native HTML elements like the `H` and `p` tags. + +> For Graphics Kit users, the typographic styles are already imported and applied to the individual components. So, if you want to customise them, check the next `Customising text styles` section. + ## How it works Somthing about the base sizes and derived scale coupled with other styles \ No newline at end of file diff --git a/src/docs/typography/using-faces.stories.svelte b/src/docs/typography/using-faces.stories.svelte new file mode 100644 index 00000000..87e64eae --- /dev/null +++ b/src/docs/typography/using-faces.stories.svelte @@ -0,0 +1,36 @@ + + + + + + + diff --git a/src/docs/typography/using-sizes.stories.svelte b/src/docs/typography/using-sizes.stories.svelte new file mode 100644 index 00000000..61742f44 --- /dev/null +++ b/src/docs/typography/using-sizes.stories.svelte @@ -0,0 +1,38 @@ + + + + + + + diff --git a/src/docs/typography/using-styles.stories.mdx b/src/docs/typography/using-styles.stories.mdx deleted file mode 100644 index 1c2a127f..00000000 --- a/src/docs/typography/using-styles.stories.mdx +++ /dev/null @@ -1,14 +0,0 @@ -import { Meta } from '@storybook/addon-docs'; -import { parameters } from '$docs/utils/docsPage.js'; - - - - -![](https://graphics.thomsonreuters.com/style-assets/images/logos/reuters-graphics-logo/svg/graphics-logo-color-dark.svg) - -# Applying typographic styles - -In your projects, you will use the typographic as per the function – -- Page title, subheads and section titles -- Body copy -- Graphic descriptions, captions and other notes \ No newline at end of file diff --git a/src/docs/typography/using-styles.stories.svelte b/src/docs/typography/using-styles.stories.svelte new file mode 100644 index 00000000..8e0184f4 --- /dev/null +++ b/src/docs/typography/using-styles.stories.svelte @@ -0,0 +1,40 @@ + + + + + + +