_wiki.scss 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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. position: absolute;
  149. width: 1px;
  150. height: 1px;
  151. padding: 0;
  152. overflow: hidden;
  153. clip: rect(0, 0, 0, 0);
  154. word-wrap: normal;
  155. border: 0;
  156. }
  157. }
  158. /* Place `[` and `]` around footnote references. */
  159. [data-footnote-ref]::before {
  160. content: '[';
  161. }
  162. [data-footnote-ref]::after {
  163. content: ']';
  164. }
  165. $ratio: 0.95;
  166. &.comment {
  167. font-size: 14px;
  168. line-height: 1.5em;
  169. h1,
  170. h2,
  171. h3,
  172. h4,
  173. h5,
  174. h6 {
  175. margin-top: 1.6em * $ratio;
  176. margin-bottom: 0.8em * $ratio;
  177. &:first-child {
  178. margin-top: 15px;
  179. }
  180. }
  181. h1 {
  182. padding-bottom: 0.3em * $ratio;
  183. margin-top: 2em * $ratio;
  184. font-size: 1.8em * $ratio;
  185. line-height: 1.1em * $ratio;
  186. }
  187. h2 {
  188. padding-bottom: 0.5em * $ratio;
  189. font-size: 1.4em * $ratio;
  190. line-height: 1.225 * $ratio;
  191. }
  192. h3 {
  193. font-size: 1.2em * $ratio;
  194. }
  195. blockquote {
  196. font-size: 0.9em * $ratio;
  197. }
  198. ul,
  199. ol {
  200. padding-left: 15px;
  201. margin: 10px 0;
  202. li {
  203. line-height: bs.$line-height-base;
  204. pre {
  205. line-height: bs.$line-height-base;
  206. }
  207. }
  208. }
  209. .revision-head {
  210. .revision-head-link,
  211. .revision-head-edit-button {
  212. margin-left: 0.5em * $ratio;
  213. font-size: 0.6em * $ratio;
  214. }
  215. }
  216. }
  217. .grw-keep {
  218. padding: 7%;
  219. padding-bottom: 3%;
  220. margin: 0 7%;
  221. background-color: rgba(200, 200, 200, 0.2);
  222. border-radius: 10px;
  223. .grw-keep-time {
  224. float: right;
  225. font-size: 0.8em;
  226. font-weight: normal;
  227. }
  228. }
  229. }
  230. // mobile
  231. .page-mobile .wiki .revision-head {
  232. .revision-head-link,
  233. .revision-head-edit-button {
  234. opacity: 0.3;
  235. }
  236. }
  237. @include bs.media-breakpoint-down(sm) {
  238. .main .wiki {
  239. img {
  240. max-width: 100%;
  241. }
  242. }
  243. }
  244. // == Colors
  245. .wiki {
  246. a:not(.alert-link) {
  247. @extend .link-underline-opacity-25;
  248. @extend .link-underline-opacity-100-hover;
  249. $color-rgb: var(--grw-wiki-link-color-rgb, var(--bs-link-color-rgb));
  250. color: rgba($color-rgb, var(--bs-link-opacity, 1));
  251. text-decoration-color: rgba($color-rgb, var(--bs-link-underline-opacity, 1));
  252. &:hover {
  253. color: rgba(
  254. var(--grw-wiki-link-hover-color-rgb, var(--bs-link-hover-color-rgb)),
  255. var(--bs-link-opacity, 1)
  256. );
  257. }
  258. }
  259. }
  260. @include bs.color-mode(light) {
  261. .wiki {
  262. --bs-border-color: var(--bs-gray-300);
  263. }
  264. }
  265. @include bs.color-mode(dark) {
  266. .wiki {
  267. --bs-border-color: var(--bs-gray-700);
  268. }
  269. }