Skip to content

Commit

Permalink
Merge pull request #10346 from department-of-veterans-affairs/doc-jw-…
Browse files Browse the repository at this point in the history
…design-system-typography

Add typography documentation to doc site
  • Loading branch information
jessicawoodin authored Dec 10, 2024
2 parents 1be9464 + 4fa6846 commit 55ed60e
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ Snackbars provide feedback regarding API interactions at the bottom of the scree
- If a screen has bottom navigation, the snackbar should open above the navigation.
- There should only ever be one snackbar on the screen. Opening a new snackbar will close the previous snackbar.

### Related
## Related
* [Snackbar - Material Design](https://m3.material.io/components/snackbar/overview)
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Allows users to select one or more items from a list. Checkboxes are an easily u
* Refer to the [VA Design System for accessibility considerations](https://design.va.gov/components/form/checkbox#accessibility-considerations)
* Screenreaders should announce the name, role, and state of each checkbox.

### Related
## Related
* [Checkbox - VA Design System](https://design.va.gov/components/form/checkbox)
* [Checkbox - USWDS](https://designsystem.digital.gov/components/checkbox/)
* [Checkbox - Material Design](https://m3.material.io/components/checkbox/overview)
44 changes: 44 additions & 0 deletions VAMobile/documentation/design/Components/Typography/Text.md
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)
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.
3 changes: 3 additions & 0 deletions VAMobile/documentation/design/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ A system to help you write, design, and build digital services on the VA Mobile
### Selection and input
- [Checkbox](/va-mobile-app/design/Components/Selection%20and%20input/Checkbox)

### Typography
- [Text](/va-mobile-app/design/Components/Typography/Text)

-----

## Design system team
Expand Down

0 comments on commit 55ed60e

Please sign in to comment.