_editor.scss 5.2 KB

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