_wiki.scss 5.5 KB

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