-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10346 from department-of-veterans-affairs/doc-jw-…
…design-system-typography Add typography documentation to doc site
- Loading branch information
Showing
5 changed files
with
95 additions
and
2 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
44 changes: 44 additions & 0 deletions
44
VAMobile/documentation/design/Components/Typography/Text.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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: Text | ||
--- | ||
|
||
Text is a typography component for headings, body copy, and display text. | ||
|
||
## Examples | ||
|
||
### Headings | ||
**Open in**: [Storybook](https://department-of-veterans-affairs.github.io/va-mobile-library/?path=/docs/text--heading) | [Figma](https://www.figma.com/design/Zzt8z60hCtdEzXx2GFWghH/%F0%9F%93%90-Component-Library---Design-System---VA-Mobile?node-id=7101-3675&t=iL0TKvx4LGQO6STF-4) | ||
<iframe width="620" height="200" title="Image of component in Storybook" src="https://department-of-veterans-affairs.github.io/va-mobile-library/?path=/story/text--heading&full=1&shortcuts=false&singleStory=true" allowfullscreen></iframe> | ||
|
||
### Body | ||
**Open in**: [Storybook](https://department-of-veterans-affairs.github.io/va-mobile-library/?path=/docs/text--body) | [Figma](https://www.figma.com/design/Zzt8z60hCtdEzXx2GFWghH/%F0%9F%93%90-Component-Library---Design-System---VA-Mobile?node-id=7101-3675&t=iL0TKvx4LGQO6STF-4) | ||
<iframe width="620" height="400" title="Image of component in Storybook" src="https://department-of-veterans-affairs.github.io/va-mobile-library/?path=/story/text--body&full=1&shortcuts=false&singleStory=true" allowfullscreen></iframe> | ||
|
||
### Display | ||
**Open in**: [Storybook](https://department-of-veterans-affairs.github.io/va-mobile-library/?path=/docs/text--display) | [Figma](https://www.figma.com/design/Zzt8z60hCtdEzXx2GFWghH/%F0%9F%93%90-Component-Library---Design-System---VA-Mobile?node-id=7101-3675&t=iL0TKvx4LGQO6STF-4) | ||
<iframe width="620" height="200" title="Image of component in Storybook" src="https://department-of-veterans-affairs.github.io/va-mobile-library/?path=/story/text--display&full=1&shortcuts=false&singleStory=true" allowfullscreen></iframe> | ||
|
||
## Usage | ||
|
||
### When to use Text | ||
- To add content to a screen. | ||
|
||
### When to consider something else | ||
- For bulleted or numbered lists, use the Text list component (coming soon). | ||
- For smaller Navigation copy (such as the bottom tab bar), apply the Navigation text style directly to a text box. | ||
|
||
### How this component works | ||
- This component is built using the [composite typography tokens](/va-mobile-app/design/Foundation/Design%20tokens/Typography#text-styles). | ||
- Paragraph spacing is set to the minimum recommended values to align with accessibility guidelines ([WCAG SC 1.4.12](https://www.w3.org/WAI/WCAG22/Understanding/text-spacing.html)). While you can increase the amount of paragraph spacing, you should not decrease without consulting an accessibility specialist. | ||
|
||
### Choosing between variations | ||
There are 9 variations of the Text component. | ||
- Use a Heading variation (large, medium, small, x-small) for headings. | ||
- Use a Body variation (large, medium, small, x-small) for body copy. | ||
- Use the Display variation for larger display text. | ||
|
||
## Code usage | ||
[Open Storybook](https://department-of-veterans-affairs.github.io/va-mobile-library/?path=/docs/text--docs) | ||
|
||
## Related | ||
- Text list (coming soon) |
46 changes: 46 additions & 0 deletions
46
VAMobile/documentation/design/Foundation/Design tokens/Typography.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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: Typography | ||
sidebar_position: 4 | ||
--- | ||
|
||
# Typography | ||
|
||
Typographical selections intended to meet the highest standards of usability and accessibility, while setting a consistent look and feel in order to convey credibility. | ||
|
||
## Typography tokens | ||
|
||
Typography tokens define each property of a text style. They include font family, style, size, line height, and letter spacing. Math is used to calculate values for size and line height. | ||
|
||
- The base font size is 16. Additional sizes are created using a scale of 1.125 | ||
- The default line height is set to 1.5x the font size. For headings, the line height is set to 1.2x. Line heights follow [accessibility best practices](https://department-of-veterans-affairs.github.io/va-mobile-app/docs/QA/QualityAssuranceProcess/Accessibility/a11y-checklist-ux-designers) and should not be decreased without consulting an accessibility specialist. | ||
|
||
### Primitive | ||
<iframe width="800" height="800" title="Image of design tokens in Figma" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com/design/rdLIEaC9rVwX70QbIGkMvG/%F0%9F%93%90-Design-Tokens-Library---Design-System---VA-Mobile?node-id=2318-2705&t=CwihCLOelO0fGAMq-4" allowfullscreen></iframe> | ||
|
||
### Semantic | ||
<iframe width="800" height="1200" title="Image of design tokens in Figma" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com/design/rdLIEaC9rVwX70QbIGkMvG/%F0%9F%93%90-Design-Tokens-Library---Design-System---VA-Mobile?node-id=2321-2924&t=CwihCLOelO0fGAMq-4" allowfullscreen></iframe> | ||
|
||
## Text styles | ||
|
||
Text styles (also known as composite tokens) combine each individual typography token into a defined style. They include styles for headings, body copy, and more. All properties are set using typography tokens, except for paragraph spacing. In the mobile app, spacing tokens are used to define paragraph spacing in a text style. | ||
|
||
### Headings | ||
<iframe width="800" height="800" title="Image of design tokens in Figma" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com/design/rdLIEaC9rVwX70QbIGkMvG/%F0%9F%93%90-Design-Tokens-Library---Design-System---VA-Mobile?node-id=2321-2925&t=CwihCLOelO0fGAMq-4" allowfullscreen></iframe> | ||
|
||
### Body | ||
<iframe width="800" height="800" title="Image of design tokens in Figma" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com/design/rdLIEaC9rVwX70QbIGkMvG/%F0%9F%93%90-Design-Tokens-Library---Design-System---VA-Mobile?node-id=2321-2926&t=CwihCLOelO0fGAMq-4" allowfullscreen></iframe> | ||
|
||
### Other | ||
<iframe width="800" height="500" title="Image of design tokens in Figma" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com/design/rdLIEaC9rVwX70QbIGkMvG/%F0%9F%93%90-Design-Tokens-Library---Design-System---VA-Mobile?node-id=2321-2927&t=CwihCLOelO0fGAMq-4" allowfullscreen></iframe> | ||
|
||
## How to use typography tokens | ||
|
||
Designers and engineers are encouraged to use typography tokens to ensure a consistent look and feel throughout the app. Multiple typography tokens are combined to create composite tokens (aka text styles). To use typography tokens and text styles in the app, we recommend a few different approaches: | ||
|
||
- For Headings and Body copy, use the [Text component](/va-mobile-app/design/Components/Typography/Text). | ||
- For larger Display copy, use the [Text component](/va-mobile-app/design/Components/Typography/Text). | ||
- For smaller Navigation copy (such as the bottom tab bar), apply the Navigation text style directly to a text box. | ||
|
||
**Coming soon** | ||
- For bulleted/numbered lists, there will be a separate component in the future. | ||
- For inline links and styling (bold, italics, etc.), there will be a separate component in the future. |
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