_wiki.scss 5.8 KB

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