Foundations
The @paperstack/foundations package provides the lowest-level stylesheet layer:
a CSS reset, sensible element defaults, the prose system for long-form content, and accessibility
helpers.
CSS Reset
The reset is an opinionated modern reset that normalises box-sizing, removes default margins and padding, and sets sensible typographic defaults. It deliberately avoids overriding properties that conflict with the token system.
@use "@paperstack/foundations/src/reset/index.scss"; What the reset does:
- Sets
box-sizing: border-boxon all elements - Removes default
marginandpaddingfrom block elements - Sets
font-family: inheritandline-height: inherit -
Normalises media elements (
img,video) todisplay: block - Respects
prefers-reduced-motionfor animations
Base Styles
Base styles apply token values to plain HTML elements so that unstyled semantic HTML looks correct out of the box.
@use "@paperstack/foundations/src/base/index.scss"; body— background, text color, font-family from tokensh1–h6— size, weight, line-height from type scalea— color, underline style, focus ringcode,pre— mono font, background tint- Form elements — basic font inheritance
Prose
The prose system wraps long-form content with optimal reading typography. Apply the
.ps-prose class to any container to enable it.
@use "@paperstack/foundations/src/prose/index.scss"; <article class="ps-prose">
<h1>Article Title</h1>
<p>Paragraph text flows at the reading width...</p>
<ul><li>List items</li></ul>
</article>
Prose sets max-width to --content-width-reading (720px), uses the reading font
stack, and applies generous line-height for legibility.
Accessibility
Accessibility helpers include focus ring styles, skip link styles, live region helpers, and screen-reader utility classes.
@use "@paperstack/foundations/src/accessibility/index.scss"; - Focus rings — All interactive elements get a visible, high-contrast focus
ring using
:focus-visible. The ring color uses--color-focus-ring. - Skip links —
.ps-skip-linkis visually hidden until focused, then appears at the top of the viewport. - Screen-reader text —
.ps-sr-only/.ps-visually-hiddenhide content visually without removing it from the accessibility tree. - Reduced motion — A global
prefers-reduced-motionoverride collapses all--duration-*tokens to 1ms.
Globals Entry
The recommended import is the single globals.scss entry point, which combines reset,
base, prose, and accessibility into one import:
@use "@paperstack/foundations/src/globals.scss"; This is the only import most projects need from foundations.