_wiki.scss 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. @use '@growi/core/scss/bootstrap/utilities' as bs;
  2. @use '../variables' as var;
  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: 16px;
  13. a {
  14. @extend .link-offset-2;
  15. text-decoration-line: underline;
  16. }
  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. scroll-margin-top: var.$grw-scroll-margin-top-in-view;
  33. }
  34. h1 {
  35. padding: 0.5em 0;
  36. margin-top: 2em;
  37. font-size: 1.9em;
  38. line-height: 1.1em;
  39. // style
  40. border-bottom: solid 1px transparent;
  41. }
  42. h2 {
  43. padding-bottom: 0.3em;
  44. font-size: 1.6em;
  45. font-weight: bold;
  46. line-height: 1.225;
  47. // style
  48. border-bottom: solid 1px transparent;
  49. }
  50. h3 {
  51. font-size: 1.4em;
  52. font-weight: bold;
  53. }
  54. h4 {
  55. font-size: 1.35em;
  56. font-weight: normal;
  57. // style
  58. @include add-left-border(6px);
  59. }
  60. h5 {
  61. font-size: 1.25em;
  62. font-weight: normal;
  63. // style
  64. @include add-left-border(4px);
  65. }
  66. h6 {
  67. font-size: 1.2em;
  68. font-weight: normal;
  69. // style
  70. @include add-left-border(2px);
  71. }
  72. p {
  73. margin: 15px 0;
  74. font-weight: normal;
  75. }
  76. table {
  77. font-size: 0.95em;
  78. }
  79. blockquote {
  80. padding: 0 20px;
  81. margin: 0 0 30px 0;
  82. font-size: 0.9em;
  83. color: lighten(bs.$gray-800, 35%);
  84. border-left: 0.3rem solid #ddd;
  85. }
  86. img {
  87. max-width: 100%;
  88. margin: 5px 0;
  89. }
  90. ul,
  91. ol {
  92. padding-left: 30px;
  93. margin: 20px 0;
  94. li {
  95. margin: 5px 0;
  96. line-height: 1.8em;
  97. pre {
  98. line-height: bs.$line-height-base;
  99. }
  100. }
  101. ul,
  102. ol {
  103. margin: 0;
  104. }
  105. }
  106. pre {
  107. position: relative; // for absolute positioned .code-highlighted-title
  108. }
  109. .contains-task-list {
  110. .task-list-item {
  111. margin: 0 0.2em 0.25em -1.6em;
  112. list-style-type: none;
  113. }
  114. .task-list-item > .contains-task-list {
  115. margin-left: 30px;
  116. }
  117. // use awesome-bootstrap-checkbox
  118. .task-list-item .checkbox input[type='checkbox'] {
  119. // layout
  120. +label {
  121. padding-left: 0.3em;
  122. &:before {
  123. margin-top: 0.4em;
  124. }
  125. }
  126. // styles
  127. cursor: default;
  128. +label {
  129. cursor: default;
  130. opacity: 1;
  131. &:before,
  132. &:after {
  133. cursor: default;
  134. }
  135. }
  136. }
  137. }
  138. // see: https://github.com/micromark/micromark-extension-gfm-footnote#css
  139. /* Style the footnotes section. */
  140. .footnotes {
  141. font-size: smaller;
  142. color: bs.$text-muted;
  143. border-top: 1px solid bs.$border-color;
  144. /* Hide the section label for visual users. */
  145. #footnote-label {
  146. position: absolute;
  147. width: 1px;
  148. height: 1px;
  149. padding: 0;
  150. overflow: hidden;
  151. clip: rect(0, 0, 0, 0);
  152. word-wrap: normal;
  153. border: 0;
  154. }
  155. }
  156. /* Place `[` and `]` around footnote references. */
  157. [data-footnote-ref]::before {
  158. content: '[';
  159. }
  160. [data-footnote-ref]::after {
  161. content: ']';
  162. }
  163. $ratio: 0.95;
  164. &.comment {
  165. font-size: 14px;
  166. line-height: 1.5em;
  167. h1,
  168. h2,
  169. h3,
  170. h4,
  171. h5,
  172. h6 {
  173. margin-top: 1.6em * $ratio;
  174. margin-bottom: 0.8em * $ratio;
  175. &:first-child {
  176. margin-top: 15px;
  177. }
  178. }
  179. h1 {
  180. padding-bottom: 0.3em * $ratio;
  181. margin-top: 2em * $ratio;
  182. font-size: 1.8em * $ratio;
  183. line-height: 1.1em * $ratio;
  184. }
  185. h2 {
  186. padding-bottom: 0.5em * $ratio;
  187. font-size: 1.4em * $ratio;
  188. line-height: 1.225 * $ratio;
  189. }
  190. h3 {
  191. font-size: 1.2em * $ratio;
  192. }
  193. blockquote {
  194. font-size: 0.9em * $ratio;
  195. }
  196. ul,
  197. ol {
  198. padding-left: 15px;
  199. margin: 10px 0;
  200. li {
  201. line-height: bs.$line-height-base;
  202. pre {
  203. line-height: bs.$line-height-base;
  204. }
  205. }
  206. }
  207. .revision-head {
  208. .revision-head-link,
  209. .revision-head-edit-button {
  210. margin-left: 0.5em * $ratio;
  211. font-size: 0.6em * $ratio;
  212. }
  213. }
  214. }
  215. .grw-keep {
  216. padding: 7%;
  217. padding-bottom: 3%;
  218. margin: 0 7%;
  219. background-color: rgba(200, 200, 200, 0.2);
  220. border-radius: 10px;
  221. .grw-keep-time {
  222. float: right;
  223. font-size: 0.8em;
  224. font-weight: normal;
  225. }
  226. }
  227. }
  228. // mobile
  229. .page-mobile .wiki .revision-head {
  230. .revision-head-link,
  231. .revision-head-edit-button {
  232. opacity: 0.3;
  233. }
  234. }
  235. @include bs.media-breakpoint-down(sm) {
  236. .main .wiki {
  237. img {
  238. max-width: 100%;
  239. }
  240. }
  241. }
  242. // == Colors
  243. .wiki {
  244. a:not(.alert-link) {
  245. @extend .link-underline-opacity-25;
  246. @extend .link-underline-opacity-100-hover;
  247. $color-rgb: var(--grw-wiki-link-color-rgb, var(--bs-link-color-rgb));
  248. color: rgba($color-rgb, var(--bs-link-opacity, 1));
  249. text-decoration-color: rgba($color-rgb, var(--bs-link-underline-opacity, 1));
  250. &:hover {
  251. color: rgba(
  252. var(--grw-wiki-link-hover-color-rgb, var(--bs-link-hover-color-rgb)),
  253. var(--bs-link-opacity, 1)
  254. );
  255. }
  256. }
  257. }