-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add editorial typography previews (#1736)
- Loading branch information
Showing
21 changed files
with
377 additions
and
438 deletions.
There are no files selected for viewing
156 changes: 7 additions & 149 deletions
156
apps/for-everyone-website/src/components/editorial-typography/BodyStyles.astro
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,154 +1,12 @@ | ||
--- | ||
import { | ||
TopicTag, | ||
StandFirst, | ||
Caption, | ||
} from '@financial-times/o3-editorial-typography/esm'; | ||
import FigmaSbLinks from '../utils/FigmaSbLinks.astro'; | ||
const {brand} = Astro.props; | ||
const storybookIdBody = `${brand}-o3-editorial-typography--body`; | ||
const storybookIdTopicTag = `${brand}-o3-editorial-typography--topic-tag`; | ||
const storybookIdStandFirst = `${brand}-o3-editorial-typography--standfirst`; | ||
const storybookIdCaption = `${brand}-o3-editorial-typography--caption`; | ||
const storybookIdByline = `${brand}-o3-editorial-typography--byline`; | ||
--- | ||
|
||
<h4>Body</h4> | ||
<p>Use for body text, paragraphs and lists</p> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Viewport</th> | ||
<th>Style Preview</th> | ||
<th>Links</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>S</td> | ||
<td class="body-s">body</td> | ||
<td> | ||
<FigmaSbLinks storybookId={storybookIdBody} /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>L</td> | ||
<td class="body-l">body</td> | ||
<td> | ||
<FigmaSbLinks storybookId={storybookIdBody} /> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<h4>Details</h4> | ||
<p> | ||
The following styles have the same values across all screen sizes, mobile, | ||
tablet, desktop. | ||
</p> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Style Preview</th> | ||
<th>Usage</th> | ||
<th>Links</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td class="not-content"> | ||
<TopicTag>Topic Tag</TopicTag> | ||
</td> | ||
<td | ||
>Also called display tag, are category labels in the FT. Used in teasers | ||
(article cards) to indicate the category of a post.</td | ||
> | ||
<td> | ||
<FigmaSbLinks storybookId={storybookIdTopicTag} /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="not-content"> | ||
<StandFirst>Standfirst</StandFirst> | ||
</td> | ||
<td | ||
>Short intro below the headline that provides context about a post. Used | ||
in combination with a header in the topper component.</td | ||
> | ||
<td> | ||
<FigmaSbLinks storybookId={storybookIdStandFirst} /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="not-content"> | ||
<Caption>Caption</Caption> | ||
</td> | ||
<td | ||
>For additional information about a piece or image that should be less | ||
prominent.</td | ||
> | ||
<td><FigmaSbLinks storybookId={storybookIdCaption} /></td> | ||
</tr> | ||
<tr> | ||
<td class="o3-editorial-typography-byline-author not-content"> | ||
Byline Author</td | ||
> | ||
<td> | ||
Shows Author name as part of a page author details in the byline | ||
component | ||
</td> | ||
<td> | ||
<FigmaSbLinks storybookId={storybookIdByline} /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="o3-editorial-typography-byline-location not-content" | ||
>Byline Location</td | ||
> | ||
<td | ||
>Shows Author location as part of a page author details in the byline | ||
component</td | ||
> | ||
<td> | ||
<FigmaSbLinks storybookId={storybookIdByline} /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="o3-editorial-typography-byline-timestamp not-content" | ||
>Byline Timestamp</td | ||
> | ||
<td | ||
>Shows article timestamp as part of a page author details the byline | ||
component</td | ||
> | ||
<td> | ||
<FigmaSbLinks storybookId={storybookIdByline} /> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
import Preview from '../utils/Preview.astro'; | ||
import * as Body from './preview/Body'; | ||
<style> | ||
tr > td:first-child { | ||
text-align: center; | ||
} | ||
[class^='body-'] { | ||
font-family: var(--_o3-editorial-typography-body-l-font-family); | ||
font-weight: var(--_o3-editorial-typography-body-l-font-weight); | ||
} | ||
const brand = Astro.props.brand || 'core'; | ||
.body-s { | ||
font-size: var(--_o3-editorial-typography-body-s-font-size); | ||
line-height: var(--_o3-editorial-typography-body-s-line-height); | ||
} | ||
|
||
.body-l { | ||
font-size: var(--_o3-editorial-typography-body-l-font-size); | ||
line-height: var(--_o3-editorial-typography-body-l-line-height); | ||
} | ||
const storybookIdBody = `${brand}-o3-editorial-typography--body`; | ||
--- | ||
|
||
.not-content.o3-editorial-typography-blockquote__source, | ||
.not-content.o3-editorial-typography-blockquote__author { | ||
display: revert; | ||
} | ||
</style> | ||
<Preview component={Body} /> | ||
<FigmaSbLinks storybookId={storybookIdBody} /> |
11 changes: 11 additions & 0 deletions
11
apps/for-everyone-website/src/components/editorial-typography/Caption.astro
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,11 @@ | ||
--- | ||
import FigmaSbLinks from '../utils/FigmaSbLinks.astro'; | ||
import Preview from '../utils/Preview.astro'; | ||
import * as CaptionPreview from './preview/Caption'; | ||
const brand = Astro.props.brand || 'core'; | ||
const storybookIdCaption = `${brand}-o3-editorial-typography--caption`; | ||
--- | ||
|
||
<Preview component={CaptionPreview} /> | ||
<FigmaSbLinks storybookId={storybookIdCaption} /> |
Oops, something went wrong.