Skip to content

@presencelearning/styles

Shared design tokens for Presence Learning frontends. Ships color, typography, spacing, border radius, and elevation tokens, plus a ready-to-use Angular Material theme config compatible with both v19 and v20.

Terminal window
npm install @presencelearning/styles

The package ships several domains. Import each via its own subpath:

SubpathWhat’s insideFlavors
@presencelearning/styles/colorsLegacy color tokens — $red-1, $blue-2, etc.SCSS · CSS · JS/CJS/TS
@presencelearning/styles/colors2New-theme primitive rampsSCSS · CSS · JS/CJS/TS
@presencelearning/styles/surfacesNon-ramp primitives (backgrounds, brand-red, etc.)SCSS · CSS · JS/CJS/TS
@presencelearning/styles/typographyType scale + mixins (CSS-free — safe to @use per component)SCSS · CSS · JS/CJS/TS
@presencelearning/styles/typography-fontsAvenir @font-face declarations — load once, globallySCSS · CSS only
@presencelearning/styles/spacingBase-8 spacing scaleSCSS · CSS · JS/CJS/TS
@presencelearning/styles/bordersBorder radiusSCSS · CSS · JS/CJS/TS
@presencelearning/styles/elevationM2 box-shadow tokensSCSS · CSS · JS/CJS/TS
@presencelearning/styles/materialAngular Material mat.theme() config (v19 + v20)SCSS only

The bare @presencelearning/styles root entry resolves to the legacy colors domain only (@use gets index.scss, which forwards colors; import/require get the colors JS). Prefer an explicit subpath.

Each domain with a JS flavor exports a frozen token map, a cssVar(token) helper, and Token/Value types — ColorToken for colors, otherwise named after the domain (Colors2Token, SpacingToken, BordersToken, ElevationToken, SurfacesToken, TypographyToken).

import { spacing, cssVar, SpacingToken } from '@presencelearning/styles/spacing';

For anything not covered by a named subpath, ./scss/* maps to the raw dist SCSS and ./fonts/* to the font files.

Since 0.5.1 the package also sets top-level main/module/types, so Angular libraries built with ng-packagr and consumers on moduleResolution: "node" can resolve it.

Use the sidebar to drill into each domain — every page renders live values straight from the SCSS sources.