_editor.scss 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. @use '@growi/core/scss/bootstrap/init' as bs;
  2. @use './variables' as var;
  3. @import './mixins' ;
  4. @import './organisms/wiki-custom-sidebar';
  5. // global imported
  6. .layout-root.editing {
  7. overflow-y: hidden !important;
  8. .grw-navbar {
  9. position: fixed !important;
  10. width: 100vw;
  11. }
  12. // restrict height of subnav
  13. .grw-subnav {
  14. height: var.$grw-subnav-height-on-edit;
  15. min-height: unset;
  16. padding-top: 0;
  17. padding-right: 15px;
  18. padding-left: 15px;
  19. @include bs.media-breakpoint-up(lg) {
  20. height: var.$grw-subnav-height-lg-on-edit;
  21. }
  22. }
  23. // calculate margin
  24. $editor-margin-top: var.$grw-subnav-height-on-edit;
  25. @include expand-editor($editor-margin-top);
  26. @include bs.media-breakpoint-up(lg) {
  27. // calculate margin
  28. $editor-margin-top: var.$grw-subnav-height-lg-on-edit;
  29. @include expand-editor($editor-margin-top);
  30. }
  31. // show
  32. .d-edit-block {
  33. display: block !important;
  34. }
  35. // hide unnecessary elements
  36. .d-edit-none {
  37. display: none !important;
  38. }
  39. // hide when HackMD view
  40. &.hackmd .d-hackmd-none {
  41. display: none;
  42. }
  43. // show only either Edit button or HackMD button
  44. &.hackmd .nav-tab-edit {
  45. display: none;
  46. }
  47. &.hackmd .grw-nav-item-edit {
  48. display: none;
  49. }
  50. &:not(.hackmd) .nav-tab-hackmd {
  51. display: none;
  52. }
  53. /*****************
  54. * Expand Editor
  55. *****************/
  56. .grw-editor-navbar-bottom {
  57. height: var.$grw-editor-navbar-bottom-height;
  58. .grw-grant-selector {
  59. @include bs.media-breakpoint-down(sm) {
  60. .btn .label {
  61. display: none;
  62. }
  63. }
  64. @include bs.media-breakpoint-up(md) {
  65. .dropdown-toggle {
  66. min-width: 100px;
  67. // caret
  68. &::after {
  69. margin-left: 1em;
  70. }
  71. }
  72. }
  73. }
  74. .btn-submit {
  75. width: 100px;
  76. }
  77. .btn-expand {
  78. // rotate icon
  79. i {
  80. display: inline-block;
  81. transition: transform 200ms;
  82. }
  83. &.expand i {
  84. transform: rotate(-180deg);
  85. }
  86. }
  87. }
  88. /*********************
  89. * Navigation styles
  90. */
  91. .grw-subnav {
  92. padding-bottom: 0;
  93. h1 {
  94. font-size: 16px;
  95. }
  96. .grw-drawer-toggler {
  97. width: 38px;
  98. height: 38px;
  99. font-size: 18px;
  100. }
  101. .grw-taglabels-container {
  102. margin-bottom: 0;
  103. // To scroll tags horizontally
  104. .grw-tag-labels.form-inline {
  105. flex-flow: row nowrap;
  106. width: 100%;
  107. overflow-x: auto;
  108. overflow-y: hidden;
  109. scrollbar-width: thin;
  110. }
  111. }
  112. }
  113. // ellipsis .grw-page-path-hierarchical-link
  114. .grw-subnav-left-side {
  115. overflow: hidden;
  116. .grw-path-nav-container {
  117. margin-right: 1rem;
  118. overflow: hidden;
  119. .grw-page-path-nav {
  120. white-space: nowrap;
  121. .grw-page-path-hierarchical-link {
  122. width: 100%;
  123. overflow: hidden;
  124. text-overflow: ellipsis;
  125. }
  126. h1 {
  127. overflow: hidden;
  128. }
  129. }
  130. }
  131. }
  132. .grw-copy-dropdown {
  133. .btn-copy {
  134. padding: 3px !important; // overwrite padding
  135. }
  136. }
  137. &.builtin-editor {
  138. /*****************
  139. * Editor styles
  140. *****************/
  141. .page-editor-editor-container {
  142. border-right: 1px solid transparent;
  143. // add icon on cursor
  144. .markdown-table-activated,
  145. .markdown-link-activated {
  146. .CodeMirror-cursor {
  147. &:after {
  148. position: relative;
  149. top: -1.1em;
  150. left: 0.3em;
  151. display: block;
  152. width: 1em;
  153. height: 1em;
  154. content: ' ';
  155. background-repeat: no-repeat;
  156. background-size: 1em;
  157. }
  158. }
  159. }
  160. .markdown-table-activated .CodeMirror-cursor {
  161. &:after {
  162. background-image: url(/images/icons/editor/table.svg);
  163. }
  164. }
  165. .markdown-link-activated .CodeMirror-cursor {
  166. &:after {
  167. background-image: url(/images/icons/editor/link.svg);
  168. }
  169. }
  170. .textarea-editor {
  171. font-family: var(--font-family-monospace);
  172. border: none;
  173. }
  174. }
  175. .page-editor-preview-container {
  176. }
  177. .page-editor-preview-body {
  178. padding: 18px 15px 0;
  179. overflow-y: scroll;
  180. }
  181. // editing /Sidebar
  182. .page-editor-preview-body.preview-sidebar {
  183. width: 320px;
  184. margin-right: auto;
  185. margin-left: auto;
  186. .wiki {
  187. @extend %grw-custom-sidebar-content;
  188. }
  189. }
  190. .grw-editor-configuration-dropdown {
  191. .icon-container {
  192. width: 20px;
  193. }
  194. .menuitem-label {
  195. min-width: 130px;
  196. }
  197. }
  198. }
  199. // .builtin-editor .tab-pane#edit
  200. &.hackmd {
  201. .hackmd-preinit,
  202. #iframe-hackmd-container > iframe {
  203. border: none;
  204. }
  205. .hackmd-error {
  206. top: 0;
  207. background-color: rgba(bs.$gray-800, 0.8);
  208. }
  209. .hackmd-status-label {
  210. font-size: 3em;
  211. }
  212. .hackmd-resume-button-container,
  213. .hackmd-discard-button-container {
  214. .btn-text {
  215. display: inline-block;
  216. min-width: 230px;
  217. }
  218. }
  219. .btn-view-outdated-draft {
  220. text-decoration: underline;
  221. vertical-align: unset;
  222. }
  223. }
  224. /*****************
  225. * Toastr
  226. *****************/
  227. .Toastify .Toastify__toast-container {
  228. top: 4.5em;
  229. }
  230. }
  231. .layout-root.editing {
  232. &:not(.growi-layout-fluid) .page-editor-preview-body {
  233. .wiki {
  234. max-width: 980px;
  235. margin: 0 auto;
  236. }
  237. }
  238. &.growi-layout-fluid .page-editor-preview-body {
  239. .wiki {
  240. margin: 0 auto;
  241. }
  242. }
  243. }
  244. // TODO: Never used this id class
  245. #tag-edit-button-tooltip {
  246. .tooltip-inner {
  247. color: black;
  248. background-color: white;
  249. border: 1px solid bs.$gray-300;
  250. }
  251. .tooltip-arrow {
  252. border-bottom: 5px solid bs.$gray-300;
  253. }
  254. }