Skip to content

Commit

Permalink
docs: Add editorial typography previews (#1736)
Browse files Browse the repository at this point in the history
  • Loading branch information
frshwtr authored Aug 9, 2024
1 parent 67ecb09 commit 62da89d
Show file tree
Hide file tree
Showing 21 changed files with 377 additions and 438 deletions.
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} />
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} />
Loading

0 comments on commit 62da89d

Please sign in to comment.