_markdown.scss 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. @import 'variables';
  2. $block-border-radius: 4px;
  3. @mixin codelike {
  4. display: inline-block;
  5. border-radius: 3px;
  6. font-family: 'Source Code Pro', monospace;
  7. background-color: $gray-100;
  8. border: 1px solid $gray-200;
  9. }
  10. .markdown {
  11. line-height: 1.8;
  12. color: $body-font-color;
  13. background: $body-background;
  14. font-family: 'Inter', sans-serif;
  15. font-weight: $body-font-weight;
  16. @media all and (min-width: $sm-breakpoint) {
  17. margin-left: 12px;
  18. }
  19. h1 {
  20. font-size: 1.875rem;
  21. line-height: 2.25rem;
  22. }
  23. h1:first-of-type {
  24. text-transform: capitalize;
  25. margin-top: 0;
  26. margin-bottom: 0;
  27. font-size: 2.8em;
  28. @media all and (max-width: $sm-breakpoint){
  29. font-size: 2em;
  30. }
  31. }
  32. h1:not(:first-of-type) {
  33. margin-top: 48px;
  34. padding: 3px 12px;
  35. @include codelike;
  36. }
  37. h2 {
  38. margin-top: 60px;
  39. margin-bottom: 6px;
  40. font-size: 1.8em;
  41. font-weight: 400;
  42. }
  43. h3 {
  44. margin-top: 48px;
  45. font-size: 1.4em;
  46. }
  47. h3.member-title {
  48. margin-top: 6px;
  49. margin-left: 6px;
  50. padding: 2px 6px;
  51. @include codelike;
  52. }
  53. h4 {
  54. margin-top: 32px;
  55. }
  56. h1, h2, h3, h4, h5 {
  57. font-family: $brand-font-face;
  58. letter-spacing: -0.025em;
  59. line-height: 1.25;
  60. &[id]:target {
  61. scroll-margin-top: 60px;
  62. text-decoration: underline;
  63. }
  64. }
  65. p {
  66. margin: 16px 0;
  67. }
  68. b, optgroup, strong {
  69. font-weight: 700;
  70. }
  71. a {
  72. text-decoration: none;
  73. color: $color-link;
  74. &:hover, &:visited:hover {
  75. color: lighten($color-link, 10%);
  76. }
  77. &:visited {
  78. color: $color-visited-link;
  79. }
  80. }
  81. ul, ol:not(.breadcrumbs) {
  82. list-style-type: initial;
  83. padding-left: 40px;
  84. }
  85. ol:not(.breadcrumbs) {
  86. list-style-type: decimal;
  87. }
  88. li {
  89. margin-bottom: 6px;
  90. }
  91. li::marker {
  92. color: $gray-600;
  93. }
  94. code:not([data-lang]) {
  95. font-family: 'Source Code Pro', monospace;
  96. padding: 0 $padding-4;
  97. background: $gray-200;
  98. color: $gray-700;
  99. font-size: 0.9em;
  100. border-radius: $block-border-radius;
  101. border: 1px solid $gray-300;
  102. }
  103. a > code:not([data-lang]) {
  104. color: $color-link;
  105. }
  106. pre:not(.chroma) {
  107. padding: $padding-16;
  108. background: $color-code-bg;
  109. border-radius: $block-border-radius;
  110. font-size: $font-size-14;
  111. overflow-x: auto;
  112. code {
  113. color: $color-code-text;
  114. background: none;
  115. padding: none;
  116. }
  117. }
  118. blockquote {
  119. margin: 0;
  120. padding: $padding-16 $padding-16 * 2;
  121. position: relative;
  122. // font-size: 22px;
  123. color: $gray-700;
  124. border-left: 2px solid $gray-300;
  125. :first-child { margin-top: 0; }
  126. :last-child { margin-bottom: 0; }
  127. &::before {
  128. content: '“';
  129. position: absolute;
  130. font-family: Georgia, 'Times New Roman', Times, serif;
  131. font-size: 48px;
  132. top: 0px;
  133. left: 10px;
  134. color: $gray-500;
  135. }
  136. }
  137. table {
  138. width: 100%;
  139. th {
  140. text-align: left;
  141. }
  142. td, th {
  143. padding: $padding-4;
  144. }
  145. tr:nth-child(odd) td {
  146. background-color: $gray-100;
  147. }
  148. }
  149. figure {
  150. margin: $padding-16 0;
  151. display: flex;
  152. flex-direction: column;
  153. justify-content: center;
  154. img {
  155. box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  156. border-radius: 0.5rem;
  157. }
  158. &.flat {
  159. img {
  160. box-shadow: none;
  161. }
  162. }
  163. figcaption p, figcaption h4 {
  164. text-align: center;
  165. font-size: $font-size-base;
  166. margin-top: $padding-4;
  167. margin-bottom: $padding-4;
  168. font-style: italic;
  169. }
  170. }
  171. }