-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
📝 Typography documentation #2247
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5d921dd
📝 Add docs file
martalalik 69ef0f8
📝 Add Introduction
martalalik 1435a9b
🎨 Update Introduction
martalalik 8c355a2
📝 Update argTab description
martalalik 8a703c0
🎨 Add Usage
martalalik 49e8fc0
🎨 Add Examples
martalalik 75dbc0f
📝 Add Overview
martalalik a467d4b
✏️ fix docs
martalalik 9aedb6f
📝 Update example
martalalik 9e0617d
🔥 Reverse typo fix in Dialog
martalalik a76a24a
Update packages/eds-core-react/src/components/Typography/Typography.d…
martalalik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
packages/eds-core-react/src/components/Typography/Typography.docs.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
import { Links, PropsTable, Story, Stack, TypographyGroups } from './../../../.storybook/components' | ||
import { Typography } from '.' | ||
|
||
# Typography | ||
|
||
Presents hierarchy and organises information as clearly and efficiently as possible, <br /> | ||
therefore text sizes and styles were developed to balance content density and reading comfort. | ||
|
||
<Links | ||
figmaUrl="https://www.figma.com/file/0TbIXrrObWj80Cf7KucKYFL0/Design-Tokens?node-id=2%3A4" | ||
documentationUrl="https://eds.equinor.com/0b0c666ab/p/721544-typography/b/32c137" | ||
sourceUrl="https://github.com/equinor/design-system/blob/develop/packages/eds-core-react/src/components/Typography/Typography.tsx" | ||
npmUrl="https://www.npmjs.com/package/@equinor/eds-core-react" | ||
></Links> | ||
|
||
<Story id="typography-typography--introduction" /> | ||
<PropsTable /> | ||
|
||
## Usage | ||
|
||
**Typeface** | ||
|
||
The `Equinor` typeface is not included in `EDS` by default. It is available from the EDS CDN. | ||
|
||
<ul> | ||
<li>All the fonts:</li> | ||
</ul> | ||
|
||
```tsx | ||
<link rel="stylesheet" href="https://eds-static.equinor.com/font/equinor-font.css" /> | ||
``` | ||
|
||
<ul> | ||
<li>Individual font:</li> | ||
</ul> | ||
|
||
```tsx | ||
<link rel="stylesheet" href="https://eds-static.equinor.com/font/equinor-regular.css" /> | ||
``` | ||
|
||
The `Equinor` typeface is the primary typeface and is available in four weights: | ||
|
||
<ul> | ||
<li><code>light</code>,</li> | ||
<li><code>regular</code>,</li> | ||
<li><code>medium</code>,</li> | ||
<li><code>bold</code>,</li> | ||
<li>with accompanying <code>italics</code>.</li> | ||
</ul> | ||
|
||
Please do not use <code>light</code> in digital interfaces except in special cases where the font size is over <code>48px</code>. | ||
|
||
**Paragraph** | ||
|
||
<ul> | ||
<li>Paragraph length is the number of characters in a line of text, this includes spaces.</li> | ||
<li>To ensure readability, line length should be 55-80 characters.</li> | ||
</ul> | ||
|
||
**Component** | ||
|
||
```tsx | ||
import { Typography } from '@equinor/eds-core-react' | ||
|
||
<Typography>Sample text</Typography> | ||
``` | ||
|
||
## Overview | ||
|
||
Typography groups with included varints: | ||
|
||
Example: `<Typography group="input" variant="label"></Typography>`. <br /> | ||
Variants under `heading` and `paragraph` don’t require the group parameter. | ||
|
||
<Story id="typography-typography--groups-overview" /> | ||
|
||
## Examples | ||
|
||
### Colors | ||
|
||
<Story id="typography-typography--colors" /> | ||
|
||
### Token property | ||
|
||
The `token` property allows manipulate the appearance of the typography. <br /> | ||
Properties: | ||
martalalik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```tsx | ||
const myToken = { | ||
textAlign, | ||
textDecoration, | ||
textTransform, | ||
fontFamily, | ||
fontSize, | ||
fontStyle, | ||
fontWeight, | ||
fontFeature, | ||
color, | ||
lineHeight, | ||
letterSpacing, | ||
} | ||
``` | ||
|
||
<Story id="typography-typography--token-property" /> | ||
|
||
### Lines | ||
|
||
<Story id="typography-typography--lines" /> | ||
|
||
### Link | ||
Link used in body of text. | ||
|
||
<Story id="typography-typography--link" /> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a note about how the equinor font is not included in eds by default and has to be added (and how)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done