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