_markdown.scss 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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.4;
  12. @media all and (min-width: $sm-breakpoint) {
  13. margin-left: 12px;
  14. }
  15. h1:first-of-type {
  16. text-transform: capitalize;
  17. font-weight: 500;
  18. margin-top: 0;
  19. margin-bottom: 0;
  20. font-size: 2.8em;
  21. @media all and (max-width: $sm-breakpoint){
  22. font-size: 2em;
  23. }
  24. }
  25. h1:not(:first-of-type) {
  26. margin-top: 48px;
  27. margin-left: -12px;
  28. padding: 3px 12px;
  29. @include codelike;
  30. }
  31. h2 {
  32. margin-top: 60px;
  33. margin-bottom: 6px;
  34. font-size: 1.8em;
  35. }
  36. h3 {
  37. margin-top: 48px;
  38. font-size: 1.4em;
  39. }
  40. h3.member-title {
  41. margin-top: 6px;
  42. margin-left: 6px;
  43. padding: 2px 6px;
  44. @include codelike;
  45. }
  46. h4 {
  47. margin-top: 32px;
  48. }
  49. h1, h2, h3, h4, h5 {
  50. font-family: $brand-font-face;
  51. font-weight: 400;
  52. line-height: 1.25;
  53. &[id]:target:before {
  54. display: block;
  55. content: " ";
  56. margin-top: -75px; // Set the Appropriate Height
  57. height: 75px; // Set the Appropriate Height
  58. visibility: hidden;
  59. }
  60. &[id]:target {
  61. text-decoration: underline;
  62. }
  63. }
  64. b, optgroup, strong {
  65. font-weight: 700;
  66. }
  67. a {
  68. text-decoration: none;
  69. &:hover {
  70. text-decoration: underline;
  71. }
  72. }
  73. li {
  74. margin-bottom: 6px;
  75. }
  76. code:not([data-lang]) {
  77. font-family: 'Source Code Pro', monospace;
  78. padding: 0 $padding-4;
  79. background: $gray-200;
  80. color: $gray-700;
  81. font-size: 0.9em;
  82. border-radius: $block-border-radius;
  83. border: 1px solid $gray-300;
  84. }
  85. a > code:not([data-lang]) {
  86. color: $color-link;
  87. }
  88. pre:not(.chroma) {
  89. padding: $padding-16;
  90. background: $color-code-bg;
  91. border-radius: $block-border-radius;
  92. font-size: $font-size-14;
  93. overflow-x: auto;
  94. code {
  95. color: $color-code-text;
  96. background: none;
  97. padding: none;
  98. }
  99. }
  100. blockquote {
  101. margin: 0;
  102. padding: $padding-16 $padding-16 * 2;
  103. position: relative;
  104. // font-size: 22px;
  105. color: $gray-700;
  106. border-left: 2px solid $gray-300;
  107. :first-child { margin-top: 0; }
  108. :last-child { margin-bottom: 0; }
  109. ::before {
  110. content: '“';
  111. position: absolute;
  112. font-family: Georgia, 'Times New Roman', Times, serif;
  113. font-size: 48px;
  114. top: 0px;
  115. left: 10px;
  116. color: $gray-500;
  117. }
  118. }
  119. table {
  120. width: 100%;
  121. th {
  122. text-align: left;
  123. }
  124. td, th {
  125. padding: $padding-4;
  126. }
  127. tr:nth-child(odd) td {
  128. background-color: $gray-100;
  129. }
  130. }
  131. figure {
  132. margin: $padding-16 0;
  133. figcaption p {
  134. text-align: center;
  135. font-size: $font-size-12;
  136. margin-top: $padding-4;
  137. }
  138. }
  139. }