_wiki.scss 3.9 KB

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