_wiki.scss 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. @use '../variables' as var;
  2. @use '../bootstrap/init' as bs;
  3. .wiki {
  4. @mixin add-left-border($width) {
  5. &:before {
  6. margin-right: 0.4em;
  7. content: '';
  8. border-left: $width solid;
  9. opacity: 0.2;
  10. }
  11. }
  12. font-size: 15px;
  13. // @extend .text-break;
  14. // https://github.com/twbs/bootstrap/blob/v4.6.1/scss/utilities/_text.scss#L65-L68
  15. word-break: break-word !important; // Deprecated, but avoids issues with flex containers
  16. word-wrap: break-word !important; // Used instead of `overflow-wrap` for IE & Edge Legacy
  17. h1,
  18. h2,
  19. h3,
  20. h4,
  21. h5,
  22. h6 {
  23. margin-top: 1.6em;
  24. margin-bottom: 0.8em;
  25. &:first-child {
  26. margin-top: 0;
  27. }
  28. }
  29. h1 {
  30. padding: 0.5em 0;
  31. margin-top: 2em;
  32. font-size: 1.9em;
  33. line-height: 1.1em;
  34. // style
  35. border-bottom: solid 1px transparent;
  36. }
  37. h2 {
  38. padding-bottom: 0.3em;
  39. font-size: 1.6em;
  40. font-weight: bold;
  41. line-height: 1.225;
  42. // style
  43. border-bottom: solid 1px transparent;
  44. }
  45. h3 {
  46. font-size: 1.4em;
  47. font-weight: bold;
  48. }
  49. h4 {
  50. font-size: 1.35em;
  51. font-weight: normal;
  52. // style
  53. @include add-left-border(6px);
  54. }
  55. h5 {
  56. font-size: 1.25em;
  57. font-weight: normal;
  58. // style
  59. @include add-left-border(4px);
  60. }
  61. h6 {
  62. font-size: 1.2em;
  63. font-weight: normal;
  64. // style
  65. @include add-left-border(2px);
  66. }
  67. p {
  68. margin: 15px 0;
  69. font-weight: normal;
  70. }
  71. blockquote {
  72. padding: 0 20px;
  73. margin: 0 0 30px 0;
  74. font-size: 0.9em;
  75. color: lighten(bs.$gray-800, 35%);
  76. border-left: 0.3rem solid #ddd;
  77. }
  78. img {
  79. max-width: 100%;
  80. margin: 5px 0;
  81. }
  82. ul,
  83. ol {
  84. padding-left: 30px;
  85. margin: 20px 0;
  86. li {
  87. margin: 5px 0;
  88. line-height: 1.8em;
  89. pre {
  90. line-height: bs.$line-height-base;
  91. }
  92. }
  93. ul,
  94. ol {
  95. margin: 0;
  96. }
  97. }
  98. pre {
  99. position: relative; // for absolute positioned .code-highlighted-title
  100. }
  101. .contains-task-list {
  102. .task-list-item {
  103. margin: 0 0.2em 0.25em -1.6em;
  104. list-style-type: none;
  105. }
  106. .task-list-item > .contains-task-list {
  107. margin-left: 30px;
  108. }
  109. // use awesome-bootstrap-checkbox
  110. .task-list-item .checkbox input[type='checkbox'] {
  111. // layout
  112. +label {
  113. padding-left: 0.3em;
  114. &:before {
  115. margin-top: 0.4em;
  116. }
  117. }
  118. // styles
  119. cursor: default;
  120. +label {
  121. cursor: default;
  122. opacity: 1;
  123. &:before,
  124. &:after {
  125. cursor: default;
  126. }
  127. }
  128. }
  129. }
  130. $ratio: 0.95;
  131. &.comment {
  132. font-size: 14px;
  133. line-height: 1.5em;
  134. h1,
  135. h2,
  136. h3,
  137. h4,
  138. h5,
  139. h6 {
  140. margin-top: 1.6em * $ratio;
  141. margin-bottom: 0.8em * $ratio;
  142. &:first-child {
  143. margin-top: 15px;
  144. }
  145. }
  146. h1 {
  147. padding-bottom: 0.3em * $ratio;
  148. margin-top: 2em * $ratio;
  149. font-size: 1.8em * $ratio;
  150. line-height: 1.1em * $ratio;
  151. }
  152. h2 {
  153. padding-bottom: 0.5em * $ratio;
  154. font-size: 1.4em * $ratio;
  155. line-height: 1.225 * $ratio;
  156. }
  157. h3 {
  158. font-size: 1.2em * $ratio;
  159. }
  160. blockquote {
  161. font-size: 0.9em * $ratio;
  162. }
  163. ul,
  164. ol {
  165. padding-left: 15px;
  166. margin: 10px 0;
  167. li {
  168. line-height: bs.$line-height-base;
  169. pre {
  170. line-height: bs.$line-height-base;
  171. }
  172. }
  173. }
  174. .revision-head {
  175. .revision-head-link,
  176. .revision-head-edit-button {
  177. margin-left: 0.5em * $ratio;
  178. font-size: 0.6em * $ratio;
  179. }
  180. }
  181. }
  182. .grw-keep {
  183. padding: 7%;
  184. padding-bottom: 3%;
  185. margin: 0 7%;
  186. background-color: rgba(200, 200, 200, 0.2);
  187. border-radius: 10px;
  188. .grw-keep-time {
  189. float: right;
  190. font-size: 0.8em;
  191. font-weight: normal;
  192. }
  193. }
  194. }
  195. // mobile
  196. .page-mobile .wiki .revision-head {
  197. .revision-head-link,
  198. .revision-head-edit-button {
  199. opacity: 0.3;
  200. }
  201. }
  202. @include bs.media-breakpoint-down(sm) {
  203. .main .wiki {
  204. img {
  205. max-width: 100%;
  206. }
  207. }
  208. }