_markdown.scss 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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. .symbol {
  33. border: 1px solid #ddd;
  34. border-radius: 4px;
  35. padding: 24px;
  36. margin: 24px 0 48px 0;
  37. background-color: #fafafa;
  38. > h1:first-of-type {
  39. text-transform: none;
  40. font-size: 1.875rem;
  41. line-height: 2.25rem;
  42. }
  43. }
  44. h1:not(:first-of-type) {
  45. margin-top: 48px;
  46. padding: 3px 12px;
  47. @include codelike;
  48. }
  49. h2 {
  50. margin-top: 60px;
  51. margin-bottom: 6px;
  52. font-size: 1.8em;
  53. font-weight: 400;
  54. }
  55. h3 {
  56. margin-top: 48px;
  57. font-size: 1.4em;
  58. }
  59. h3.member-title {
  60. margin-top: 6px;
  61. margin-left: 6px;
  62. padding: 2px 6px;
  63. @include codelike;
  64. }
  65. h4 {
  66. margin-top: 32px;
  67. }
  68. h1,
  69. h2,
  70. h3,
  71. h4,
  72. h5 {
  73. font-family: $brand-font-face;
  74. letter-spacing: -0.025em;
  75. line-height: 1.25;
  76. &[id]:target {
  77. scroll-margin-top: 60px;
  78. text-decoration: underline;
  79. }
  80. }
  81. p {
  82. margin: 16px 0;
  83. }
  84. b,
  85. optgroup,
  86. strong {
  87. font-weight: 700;
  88. }
  89. a {
  90. text-decoration: none;
  91. color: $color-link;
  92. &:hover,
  93. &:visited:hover {
  94. color: lighten($color-link, 10%);
  95. }
  96. &:visited {
  97. color: $color-visited-link;
  98. }
  99. }
  100. ul,
  101. ol:not(.breadcrumbs) {
  102. list-style-type: initial;
  103. padding-left: 40px;
  104. }
  105. ol:not(.breadcrumbs) {
  106. list-style-type: decimal;
  107. }
  108. li {
  109. margin-bottom: 6px;
  110. }
  111. li::marker {
  112. color: $gray-600;
  113. }
  114. code:not([data-lang]) {
  115. font-family: 'Source Code Pro', monospace;
  116. padding: 0 $padding-4;
  117. background: $gray-200;
  118. color: $gray-700;
  119. font-size: 0.9em;
  120. border-radius: $block-border-radius;
  121. border: 1px solid $gray-300;
  122. }
  123. a > code:not([data-lang]) {
  124. color: $color-link;
  125. }
  126. pre:not(.chroma) {
  127. padding: $padding-16;
  128. background: $color-code-bg;
  129. border-radius: $block-border-radius;
  130. font-size: $font-size-14;
  131. overflow-x: auto;
  132. code {
  133. color: $color-code-text;
  134. background: none;
  135. padding: none;
  136. }
  137. }
  138. blockquote {
  139. margin: 0;
  140. padding: $padding-16 $padding-16 * 2;
  141. position: relative;
  142. // font-size: 22px;
  143. color: $gray-700;
  144. border-left: 2px solid $gray-300;
  145. :first-child {
  146. margin-top: 0;
  147. }
  148. :last-child {
  149. margin-bottom: 0;
  150. }
  151. &::before {
  152. content: '“';
  153. position: absolute;
  154. font-family: Georgia, 'Times New Roman', Times, serif;
  155. font-size: 48px;
  156. top: 0px;
  157. left: 10px;
  158. color: $gray-500;
  159. }
  160. }
  161. table {
  162. width: 100%;
  163. th {
  164. text-align: left;
  165. }
  166. td,
  167. th {
  168. padding: $padding-4;
  169. }
  170. tr:nth-child(odd) td {
  171. background-color: $gray-100;
  172. }
  173. }
  174. figure {
  175. margin: $padding-16 0;
  176. display: flex;
  177. flex-direction: column;
  178. justify-content: center;
  179. img {
  180. box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  181. border-radius: 0.5rem;
  182. }
  183. &.flat {
  184. img {
  185. box-shadow: none;
  186. }
  187. }
  188. figcaption p,
  189. figcaption h4 {
  190. text-align: center;
  191. font-size: $font-size-base;
  192. margin-top: $padding-4;
  193. margin-bottom: $padding-4;
  194. font-style: italic;
  195. }
  196. }
  197. .highlight + .highlight {
  198. margin-top: 16px;
  199. }
  200. }