# Design system

The tokens, the layout slots, the accessibility contracts every component keeps and what the lint checks. To see the colours, type scale and spacing drawn in both themes, with their contrast ratios, open [Design tokens, visually](https://docs.mapcairn.com/design/visual-tokens.md).

This page is built from [DESIGN.md](https://github.com/MapCairn/mapcairn/blob/main/DESIGN.md) in the repository, which is where it is edited.

## At a glance

The document is long, so the site gives each section its own page. A section that is still long is cut into numbered parts.

- <span id="how-the-css-ships"></span>[How the CSS ships](https://docs.mapcairn.com/design/how-the-css-ships.md)
- <span id="living-style-guide"></span>[Living style guide](https://docs.mapcairn.com/design/living-style-guide.md): A developer page in the reference host that draws every token and primitive from the real code.
- <span id="principles"></span>[Principles](https://docs.mapcairn.com/design/principles.md): The rules every part of the interface follows.
- <span id="tokens"></span>[Tokens](https://docs.mapcairn.com/design/tokens.md): The colours, type, spacing and other values the interface is built from.
- <span id="layout-and-slots"></span>[Layout and slots](https://docs.mapcairn.com/design/layout-and-slots.md): Where each control sits on the screen, and which part of the code owns its place.
- <span id="components-and-accessibility-contracts"></span>[Components and accessibility contracts](https://docs.mapcairn.com/design/components-and-accessibility-contracts-part-1.md): What each component must do for names, roles, focus and keyboard use.
  - In 6 parts: [1](https://docs.mapcairn.com/design/components-and-accessibility-contracts-part-1.md), [2](https://docs.mapcairn.com/design/components-and-accessibility-contracts-part-2.md), [3](https://docs.mapcairn.com/design/components-and-accessibility-contracts-part-3.md), [4](https://docs.mapcairn.com/design/components-and-accessibility-contracts-part-4.md), [5](https://docs.mapcairn.com/design/components-and-accessibility-contracts-part-5.md), [6](https://docs.mapcairn.com/design/components-and-accessibility-contracts-part-6.md)
- <span id="the-product-page"></span>[The product page](https://docs.mapcairn.com/design/the-product-page.md): How the reference site's front page is written and laid out.
- <span id="exempt-surfaces"></span>[Exempt surfaces](https://docs.mapcairn.com/design/exempt-surfaces.md): The few places that may hold raw values instead of tokens.
- <span id="what-the-lint-checks-and-where"></span>[What the lint checks, and where](https://docs.mapcairn.com/design/what-the-lint-checks-and-where.md): The design rules the lint enforces, and where each check lives.

## About this document

The map is the hero and the chrome recedes. MapCairn is calm, neutral and precise, with grouped controls, a floating search pill and a bottom sheet, in the way people already expect from a good maps app. Light and dark are equally polished. The target is WCAG 2.2 AA, built in from the first component.

Tokens live in `packages/theme/src/tokens.css.ts`. Components may only use tokens, so an off-scale value fails typecheck, and a lint test is the backstop for raw literals.
