-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(headings): Edits and cleanup to the DisplayHeading and Heading docs
- Loading branch information
1 parent
4830b2b
commit ccd8a2e
Showing
10 changed files
with
43 additions
and
78 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
### Minimal usage | ||
Use as an overlay on Hero, Promo or Headline blocks. | ||
|
||
``` | ||
<DisplayHeading>Great Deals</DisplayHeading> | ||
<DisplayHeading>Smartphones</DisplayHeading> | ||
``` | ||
|
||
#### Usage criteria | ||
|
||
- Display Heading outputs an `h1` tag. | ||
- Use as an overlay on hero, promo or headline blocks. |
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
8 changes: 3 additions & 5 deletions
8
src/components/Typography/DisplayHeading/DisplayHeadingSup/DisplayHeadingSup.md
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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
### Usage | ||
|
||
The Display Heading Sup component wraps text in a `<sup>` tag. It assures proper font sizes are rendered depending on the parent font size. | ||
|
||
``` | ||
<DisplayHeading>Great Deals<DisplayHeading.Sup>1</DisplayHeading.Sup></DisplayHeading> | ||
<DisplayHeading> | ||
TELUS Optik TV<DisplayHeading.Sup>®</DisplayHeading.Sup> | ||
</DisplayHeading> | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,15 @@ | ||
### Minimal Usage | ||
|
||
The Heading component outputs an `h1` tag by default. | ||
|
||
``` | ||
<Heading>Great Deals</Heading> | ||
<div> | ||
<Heading level="h1">Heading level 1</Heading> | ||
<Heading level="h2">Heading level 2</Heading> | ||
<Heading level="h3">Heading level 3</Heading> | ||
<Heading level="h4">Heading level 4</Heading> | ||
</div> | ||
``` | ||
|
||
#### Usage criteria | ||
|
||
- Be mindful of SEO and accessibility. | ||
- Be sure to organise headers in a nested order: h1, then h2, then h3. | ||
- Organise headers in a nested order: h1, then h2, then h3. | ||
- Do **not** skip levels: h1, then h3. | ||
- For hero overlays, headlines, or promo blocks, use [Display Heading](#displayheading). | ||
|
||
### Defining level | ||
|
||
``` | ||
<div> | ||
<Heading level="h1">Great Deals</Heading> | ||
<Heading level="h2">Great Deals</Heading> | ||
<Heading level="h3">Great Deals</Heading> | ||
<Heading level="h4">Great Deals</Heading> | ||
</div> | ||
``` | ||
|
||
### Invert on dark colours | ||
|
||
``` | ||
const PurpleBlock = require('../../__docs__/PurpleBlock').default; | ||
<PurpleBlock> | ||
<Heading invert>Great Deals</Heading> | ||
</PurpleBlock> | ||
``` | ||
- For Hero overlays, Headlines, or Promo blocks, use [`DisplayHeading`](#displayheading). |
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
23 changes: 4 additions & 19 deletions
23
src/components/Typography/Heading/HeadingSup/HeadingSup.md
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 |
---|---|---|
@@ -1,23 +1,8 @@ | ||
### Usage | ||
|
||
The Heading Sup component wraps text in a `<sup>` tag. It assures proper font sizes are rendered depending on the parent font size. | ||
|
||
**Note: do not use Heading Sup within a Display Heading component. Use [DisplayHeading.Sup](#displayheadingsup) instead.** | ||
|
||
|
||
``` | ||
<div> | ||
<div> | ||
<Heading level="h1">Optik TV<Heading.Sup>®</Heading.Sup></Heading> | ||
<Heading level="h2">Optik TV<Heading.Sup>®</Heading.Sup></Heading> | ||
<Heading level="h3">Optik TV<Heading.Sup>®</Heading.Sup></Heading> | ||
<Heading level="h4">Optik TV<Heading.Sup>®</Heading.Sup></Heading> | ||
</div> | ||
<div> | ||
<Heading level="h1">TELUS Pik TV<Heading.Sup>™</Heading.Sup></Heading> | ||
<Heading level="h2">TELUS Pik TV<Heading.Sup>™</Heading.Sup></Heading> | ||
<Heading level="h3">TELUS Pik TV<Heading.Sup>™</Heading.Sup></Heading> | ||
<Heading level="h4">TELUS Pik TV<Heading.Sup>™</Heading.Sup></Heading> | ||
</div> | ||
<Heading level="h1">TELUS Pik TV<Heading.Sup>™</Heading.Sup></Heading> | ||
<Heading level="h2">TELUS Pik TV<Heading.Sup>™</Heading.Sup></Heading> | ||
<Heading level="h3">TELUS Pik TV<Heading.Sup>™</Heading.Sup></Heading> | ||
<Heading level="h4">TELUS Pik TV<Heading.Sup>™</Heading.Sup></Heading> | ||
</div> | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
Typography components replace standard HTML dom (preferring `<Small></Small>` over `<small></small>`) in order to provide maintainable font sizes and styles. | ||
Typography components replace standard HTML dom (`<Paragraph>` instead of `<p>`) in order to provide maintainable | ||
font styles. | ||
|
||
## Spacing system | ||
|
||
As of v0.22.0, Typography components **do not** have built-in styles for spacing (padding or margin). For the interim, designers are strongly advised to follow TDS Sketch assets for spacing rules in order for developers to properly apply the correct spacing between related components. | ||
As of v0.22.0, Typography components **do not** have built-in padding or margin. For the interim, designers are strongly | ||
advised to follow TDS Sketch assets for spacing rules in order for developers to properly apply the correct spacing between | ||
related components. | ||
|
||
For example, a `<Paragraph />` component immediately following a `<Heading />` component would require `1rem` spacing between them. For this case, we recommend: | ||
For example, a `<Paragraph>` component immediately following a `<Heading>` component would require `1rem` spacing between | ||
them. For this case, we recommend: | ||
|
||
``` | ||
<div> | ||
<Heading>Great Deals</Heading> | ||
<Heading level="h2">Great Deals</Heading> | ||
<div style={{paddingTop: '1rem'}}> | ||
<Paragraph>See how this great deal can benefit you and your shared lines.</Paragraph> | ||
<Paragraph> | ||
See how this great deal can benefit you and your shared lines. | ||
</Paragraph> | ||
</div> | ||
</div> | ||
``` |