@wmcadigital/ui-font
v0.1.0-alpha.2
Published
Fonts for the design system
Readme
# Font
Fonts for the design system.
## Usage
Include the font styles in your build or import the compiled CSS from the package.
## Contributing
Add fonts and test across platforms; PRs welcome.
# @wmcadigital/ui-font
This package provides webfont declarations used across the design system. It exposes `dist/styles/main.css` (and the SCSS source) which includes `@font-face` rules for the project’s chosen typeface.
## Install
pnpm add @wmcadigital/ui-font
## What this package provides
- `@font-face` declarations for "Noto Sans Display" regular and bold weights.
- A compiled stylesheet at `dist/styles/main.css` (see the `style` field in `package.json`).
The `@font-face` rules point to the project CDN by default and use `font-display: swap` so text remains visible while webfonts load.
## Usage
Import the package stylesheet in your global styles or build pipeline:
```css
@import '@wmcadigital/ui-font/dist/styles/main.css';
```Or, if your bundler supports package style resolution, include the package and the stylesheet will be available via the package style field.
Notes and recommendations
- The shipped
@font-facerules reference CDN-hosted font files (woff/woff2). You can override thesesrcURLs if you self-host fonts or want to use different versions. font-display: swapis enabled to reduce invisible text during font loading.- If you care about reducing layout shift when switching from fallback fonts to the webfont, consider adding font-metric overrides (as suggested in the SCSS comments). Those values require measurement or tooling to tune properly.
Accessibility
- Use sensible font-size and contrast with the typeface. The package only provides the font files and declarations — accessibility choices (sizes, line-height, contrast) remain the responsibility of consuming projects.
Development
- SCSS source:
src/styles/main.scss(contains the@font-facedeclarations and helpful comments about metric overrides). - When developing locally, the package build outputs compiled CSS to
dist/— runpnpm -w -r run buildfrom the monorepo root to regenerate artifacts.
