typography.scss 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // This file provides CSS variables for font size and line height, plus Sass variables for base text size for Bootstrap
  2. :root {
  3. --font-sans: 'Noto Sans', sans-serif;
  4. --font-size-01: 0.75rem; // 12px
  5. --font-size-02: 0.875rem; // 14px
  6. --font-size-03: 1rem; // 16px
  7. --font-size-04: 1.125rem; // 18px
  8. --font-size-05: 1.25rem; // 20px
  9. --font-size-06: 1.5rem; // 24px
  10. --font-size-07: 1.875rem; // 30px
  11. --font-size-08: 2.25rem; // 36px
  12. --font-size-09: 3rem; // 48px
  13. --font-size-10: 3.25rem; // 52px
  14. --font-size-11: 3.75rem; // 60px
  15. --font-size-12: 4.5rem; // 72px
  16. --font-size-13: 6em; // 96px
  17. --line-height-01: 1rem; // 16px
  18. --line-height-02: 1.25rem; // 20px
  19. --line-height-03: 1.5rem; // 24px
  20. --line-height-04: 1.75rem; // 28px
  21. --line-height-05: 2rem; // 32px
  22. --line-height-06: 2.5rem; // 40px
  23. --line-height-07: 3rem; // 48px
  24. --line-height-08: 4rem; // 64px
  25. --line-height-09: 4.25rem; // 68px
  26. --line-height-10: 5rem; // 80px
  27. --line-height-11: 6rem; // 96px
  28. --line-height-12: 8rem; // 128px
  29. }
  30. // Semantic styles, as Sass mixins
  31. @mixin display-lg {
  32. font-size: var(--font-size-13);
  33. line-height: var(--line-height-12);
  34. }
  35. @mixin display-md {
  36. font-size: var(--font-size-12);
  37. line-height: var(--line-height-11);
  38. }
  39. @mixin display-sm {
  40. font-size: var(--font-size-11);
  41. line-height: var(--line-height-10);
  42. }
  43. @mixin display-xs {
  44. font-size: var(--font-size-10);
  45. line-height: var(--line-height-09);
  46. }
  47. @mixin heading-2xl {
  48. font-size: var(--font-size-09);
  49. line-height: var(--line-height-08);
  50. }
  51. @mixin heading-xl {
  52. font-size: var(--font-size-08);
  53. line-height: var(--line-height-07);
  54. }
  55. @mixin heading-lg {
  56. font-size: var(--font-size-07);
  57. line-height: var(--line-height-06);
  58. }
  59. @mixin heading-md {
  60. font-size: var(--font-size-06);
  61. line-height: var(--line-height-05);
  62. }
  63. @mixin heading-sm {
  64. font-size: var(--font-size-05);
  65. line-height: var(--line-height-04);
  66. }
  67. @mixin heading-xs {
  68. font-size: var(--font-size-04);
  69. line-height: var(--line-height-03);
  70. }
  71. @mixin body-lg {
  72. font-size: var(--font-size-04);
  73. line-height: var(--line-height-03);
  74. }
  75. @mixin body-base {
  76. font-size: var(--font-size-03);
  77. line-height: var(--line-height-03);
  78. }
  79. @mixin body-sm {
  80. font-size: var(--font-size-02);
  81. line-height: var(--line-height-02);
  82. }
  83. @mixin body-xs {
  84. font-size: var(--font-size-01);
  85. line-height: var(--line-height-01);
  86. }
  87. @mixin font-mono {
  88. font-family: 'DM Mono', monospace;
  89. // We're using the "ss05" (stylistic set 5) version of the DM Mono, by setting the `font-feature-settings` rule
  90. // https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings
  91. // We use the ss05 specifically to remove the "squiggle" below the f letter.
  92. // You can try removing the `font-feature-settings` rule and check what happens to the letter "f",
  93. // as it's quite hard to describe it with sentences alone
  94. font-feature-settings: 'ss05';
  95. }