variables-typography.pcss.css

Same filename and directory in other branches
  1. 11.x core/themes/default_admin/css/_variables/variables-typography.pcss.css

Typography custom properties — the canonical `--admin-font-*` token API.

Consolidated from the former Claro `--font-*` and Gin `--gin-font-*` systems The two scales agreed on the body sizes (2xs/xs/s/m) and the weights, so those merged 1:1. Where they rendered different sizes under the same name on different elements, the canonical value is what those elements render:

  • heading scale h1–h6 = the generic <h1>–<h6> sizes (a Claro/Gin mix), rounded to whole px. The old values were a rounded 1.125-ratio modular scale, so this drops sub-pixel fractions (e.g. h1 was 2.027rem ≈ 32.43px → 32px);
  • --admin-font-size-2xl (36px) = the old Claro --font-size-xl display size;
  • --admin-font-size-page-title = Gin's responsive H1 (distinct from the generic h1), used by the page title only.

(The Claro modular-scale h3 at 1.602rem is install/maintenance-only and off the admin scale, so it stays an inline literal in those two files.)

Sizes are authored in px; the build's px-to-rem step converts them.

File

core/themes/default_admin/css/_variables/variables-typography.pcss.css

View source
  1. /* cspell:ignore blinkmacsystemfont, ginter */
  2. /**
  3. * @file
  4. * Typography custom properties — the canonical `--admin-font-*` token API.
  5. *
  6. * Consolidated from the former Claro `--font-*` and Gin `--gin-font-*` systems
  7. * The two scales agreed on the body sizes (2xs/xs/s/m) and the
  8. * weights, so those merged 1:1. Where they rendered different sizes under the same
  9. * name on different elements, the canonical value is what those elements render:
  10. * - heading scale h1–h6 = the generic

    sizes (a Claro/Gin mix), rounded
  11. * to whole px. The old values were a rounded 1.125-ratio modular scale, so this
  12. * drops sub-pixel fractions (e.g. h1 was 2.027rem ≈ 32.43px → 32px);
  13. * - --admin-font-size-2xl (36px) = the old Claro --font-size-xl display size;
  14. * - --admin-font-size-page-title = Gin's responsive H1 (distinct from the generic
  15. * h1), used by the page title only.
  16. * (The Claro modular-scale h3 at 1.602rem is install/maintenance-only and off the
  17. * admin scale, so it stays an inline literal in those two files.)
  18. *
  19. * Sizes are authored in px; the build's px-to-rem step converts them.
  20. */
  21. @import "../base/media-queries.pcss.css";
  22. :root {
  23. /* Font families. */
  24. --admin-font-family: ginter, inter, "Helvetica Neue", blinkmacsystemfont, -apple-system, "Segoe UI", roboto, oxygen-sans, ubuntu, cantarell, sans-serif;
  25. --admin-font-family-serif: "Times New Roman", times, serif;
  26. /* Line heights. (Unitless ratios are not lengths; -label is a fixed 18px.) */
  27. --admin-line-height: 1.5;
  28. --admin-line-height-heading: 1.3;
  29. --admin-line-height-label: 18px;
  30. /*
  31. * Font sizes — body scale (2xs…2xl), element-mapped heading scale (h1…h6), plus
  32. * the page-title and quote sizes.
  33. */
  34. --admin-font-size-2xs: 12px;
  35. --admin-font-size-xs: 13px;
  36. --admin-font-size-s: 14px;
  37. --admin-font-size-m: 16px; /* base */
  38. --admin-font-size-l: 18px;
  39. --admin-font-size-xl: 20px;
  40. --admin-font-size-2xl: 36px; /* display (install/maintenance site name) */
  41. --admin-font-size-label: var(--admin-font-size-s);
  42. --admin-font-size-h1: 32px;
  43. --admin-font-size-h2: 28px;
  44. --admin-font-size-h3: 24px;
  45. --admin-font-size-h4: 23px;
  46. --admin-font-size-h5: 20px;
  47. --admin-font-size-h6: var(--admin-font-size-l);
  48. /* Page title - distinct from the generic h1 above. */
  49. --admin-font-size-page-title: 26px;
  50. --admin-font-size-quote: 1.1em;
  51. /* Font weights (values tuned for Inter). */
  52. --admin-font-weight-normal: 400;
  53. --admin-font-weight-semibold: 525;
  54. --admin-font-weight-bold: 575;
  55. --admin-font-weight-heavy: 625;
  56. @media (--admin-medium) {
  57. --admin-font-size-page-title: 29px;
  58. --admin-font-size-quote: 1.2em;
  59. }
  60. @media (--admin-widest) {
  61. --admin-font-size-page-title: 34px;
  62. }
  63. }

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.