typography.scss 2.8 KB

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