ShtukbaseStandard
package page→ /design/scales.md

pages/design/scales.md

43 lines, 3.0 KB. As a page.

  1. ---
  2. type: Page
  3. title: "Scales"
  4. description: "Spacing, font sizes, radii, shadows and line length come from short sets. What is counted, where the idea comes from, check settings."
  5. icon: "📏"
  6. spacingBase: 4
  7. spacingFine: 2
  8. spacingFineBelow: 16
  9. typeScale: [11, 12, 14, 16, 18, 20, 22, 24, 28, 30, 32, 36, 45, 48, 57, 60, 72, 96, 128]
  10. maxFontSizes: 10
  11. radii: [0, 2, 4, 6, 8, 10, 12, 16, 20, 24, 32]
  12. maxRadii: 6
  13. maxShadows: 6
  14. measure: [45, 75]
  15. ---
  16. # Scales
  17. An interface looks put together when sizes are taken not "by eye" but from short lists. Then neighboring values differ noticeably, and there is no need to decide each time between 13 and 14 px.
  18. | Norm | What | Who holds it |
  19. |---|---|---|
  20. | [SCL-R01](/norms/rules/design-scales/SCL-R01.md) | Spacing is a multiple of 4 px (2 px below 16 px) | the `spacing` check |
  21. | [SCL-R02](/norms/rules/design-scales/SCL-R02.md) | Font sizes from the scale, no more than 10 different ones | the `type` check |
  22. | [SCL-R03](/norms/rules/design-scales/SCL-R03.md) | Radii from the set, shadows from the theme | the `shape` check |
  23. | [SCL-R04](/norms/rules/design-scales/SCL-R04.md) | A line of text is 45–75 characters | judge and the `measure` sensor |
  24. ## Where the ideas come from (in our own words)
  25. - **Refactoring UI** (Adam Wathan and Steve Schoger, [refactoringui.com](https://www.refactoringui.com/)). A system is worth setting in advance: spacing, font sizes, shadows as short lists in which neighboring values differ by at least a quarter. Choosing from five options is faster and more even than inventing a number. Five shadows are enough, from barely noticeable to the highest; each means "how far the element is above the page".
  26. - **The Material 3 type scale** ([m3.material.io](https://m3.material.io/styles/typography/type-scale-tokens)). Fifteen text roles (display, headlines, titles, body, labels) in three sizes; each role has its own size, line height and weight. A role is named by purpose, not by number.
  27. - **Every Layout** (Heydon Pickering and Andy Bell, [every-layout.dev](https://every-layout.dev/rudiments/axioms/)). Text width is set in `ch`, the width of a character, and kept at about 60 characters; this rule is declared at the level of the whole project, not of each block. Spacing is derived from one step by multiplying it.
  28. - **A line length of 45–75 characters** is a rule of book typesetting (Robert Bringhurst, "The Elements of Typographic Style").
  29. ## Settings
  30. - `spacingBase` is the spacing step, px (4). `spacingFine` and `spacingFineBelow` are the fine step (2) for values below 16 px.
  31. - `typeScale` is the allowed font sizes, px. `maxFontSizes` is how many different sizes a project may have.
  32. - `radii` is the allowed radii, px; a "pill" (999 px and more) and percentages are always allowed. `maxRadii` is how many different radii.
  33. - `maxShadows` is how many shadows a theme may have.
  34. - `measure` is the limits of line length in characters.
  35. Which files the checks look at is on the page [Which files the design checks look at](/design/design-checks.md).