Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OP-148] Alternate Font Pattern #214

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/stories/Tokens/Typography/FontFamily.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,19 @@ If you want to change the font used by default, you can add a new font import to
--op-font-family: 'Tilt Neon', sans-serif;
}
```

## Alternate or Multiple Fonts

Often an application will need multiple fonts. Your headers may use a different font than your body text. Optics provides a single font family token, but you can easily add your own font tokens by following the pattern.

```css
@import 'https://fonts.googleapis.com/css2?family=Tilt+Neon&display=swap';
@import 'https://fonts.googleapis.com/css2?family=Roboto&display=swap';

:root {
--op-font-family: 'Tilt Neon', sans-serif;
--ya-font-family-alt: 'Roboto', serif; // Your App prefix. Could stick with --op if you want
// or
--ya-font-family-body: 'Roboto', serif;
}
```
Loading