_wiki.scss 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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. pre {
  103. position: relative; // for absolute positioned .code-highlighted-title
  104. }
  105. .task-list {
  106. .task-list-item {
  107. margin: 0 0.2em 0.25em -1.6em;
  108. list-style-type: none;
  109. }
  110. .task-list-item > .task-list {
  111. margin-left: 30px;
  112. }
  113. // use awesome-bootstrap-checkbox
  114. .task-list-item .checkbox input[type='checkbox'] {
  115. // layout
  116. + label {
  117. padding-left: 0.3em;
  118. &:before {
  119. margin-top: 0.4em;
  120. }
  121. }
  122. // styles
  123. cursor: default;
  124. + label {
  125. cursor: default;
  126. opacity: 1;
  127. &:before,
  128. &:after {
  129. cursor: default;
  130. }
  131. }
  132. }
  133. }
  134. $ratio: 0.95;
  135. &.comment {
  136. font-size: 14px;
  137. line-height: 1.5em;
  138. h1,
  139. h2,
  140. h3,
  141. h4,
  142. h5,
  143. h6 {
  144. margin-top: 1.6em * $ratio;
  145. margin-bottom: 0.8em * $ratio;
  146. &:first-child {
  147. margin-top: 15px;
  148. }
  149. }
  150. h1 {
  151. padding-bottom: 0.3em * $ratio;
  152. margin-top: 2em * $ratio;
  153. font-size: 1.8em * $ratio;
  154. line-height: 1.1em * $ratio;
  155. }
  156. h2 {
  157. padding-bottom: 0.5em * $ratio;
  158. font-size: 1.4em * $ratio;
  159. line-height: 1.225 * $ratio;
  160. }
  161. h3 {
  162. font-size: 1.2em * $ratio;
  163. }
  164. blockquote {
  165. font-size: 0.9em * $ratio;
  166. }
  167. ul,
  168. ol {
  169. padding-left: 15px;
  170. margin: 10px 0;
  171. li {
  172. line-height: bs.$line-height-base;
  173. pre {
  174. line-height: bs.$line-height-base;
  175. }
  176. }
  177. }
  178. .revision-head {
  179. .revision-head-link,
  180. .revision-head-edit-button {
  181. margin-left: 0.5em * $ratio;
  182. font-size: 0.6em * $ratio;
  183. }
  184. }
  185. }
  186. .grw-keep {
  187. padding: 7%;
  188. padding-bottom: 3%;
  189. margin: 0 7%;
  190. background-color: rgba(200, 200, 200, 0.2);
  191. border-radius: 10px;
  192. .grw-keep-time {
  193. float: right;
  194. font-size: 0.8em;
  195. font-weight: normal;
  196. }
  197. }
  198. }
  199. // mobile
  200. .page-mobile .wiki .revision-head {
  201. .revision-head-link,
  202. .revision-head-edit-button {
  203. opacity: 0.3;
  204. }
  205. }
  206. @include bs.media-breakpoint-down(sm) {
  207. .main .wiki {
  208. img {
  209. max-width: 100%;
  210. }
  211. }
  212. }