_on-edit.scss 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. @import 'editor-overlay';
  2. @import 'layout_variable';
  3. body:not(.on-edit) {
  4. // hide .page-editor-footer
  5. .page-editor-footer {
  6. display: none !important;
  7. border: none;
  8. }
  9. }
  10. body.on-edit {
  11. // calculate margin
  12. $editor-header-plus-footer: 42px // .nav-tabs height
  13. + 1px // .page-editor-footer border-top
  14. + 40px !default; // .page-editor-footer min-height
  15. @include expand-editor($editor-header-plus-footer);
  16. // for growi layout
  17. .main {
  18. .col.grw-page-content-container {
  19. padding: 0;
  20. }
  21. }
  22. // hide unnecessary elements
  23. header,
  24. .grw-subnav,
  25. .row.row-alerts,
  26. .row.page-list,
  27. .row.page-comments-row,
  28. .row.page-attachments-row,
  29. .row.not-found-message-row,
  30. .users-info,
  31. .user-page-content-container,
  32. .portal-form-button,
  33. .btn-like,
  34. .btn-bookmark,
  35. .btn-edit,
  36. .authors,
  37. .hide-on-edit,
  38. footer {
  39. display: none !important;
  40. }
  41. // hide unnecessary elements for growi layout
  42. .revision-toc-container {
  43. display: none !important;
  44. }
  45. // hide unnecessary elements for crowi layout
  46. #toggle-crowi-sidebar,
  47. .crowi-sidebar {
  48. display: none;
  49. }
  50. // show only either Edit button or HackMD button
  51. &.hackmd .nav-tab-edit {
  52. display: none;
  53. }
  54. &.hackmd .grw-nav-item-edit {
  55. display: none;
  56. }
  57. &.hackmd {
  58. #page-editor-options-selector {
  59. display: none !important;
  60. }
  61. }
  62. &:not(.hackmd) .nav-tab-hackmd {
  63. display: none;
  64. }
  65. // hide hackmd related alert
  66. &.hackmd #page-status-alert {
  67. .alert-hackmd-someone-editing,
  68. .alert-hackmd-draft-exists {
  69. display: none;
  70. }
  71. }
  72. // show revision path
  73. .grw-revision-path-for-edit {
  74. display: block !important;
  75. }
  76. /*****************
  77. * Expand Editor
  78. *****************/
  79. .container-fluid {
  80. padding-bottom: 0;
  81. }
  82. .row.grw-subnav {
  83. $left-margin: $grw-nav-main-left-tab-width * 2 + 25px; // width of .grw-nav-main-left-tab x 2 + some margin
  84. $right-margin: 128px + 94px + 46px; // width of all of grw-nav-main-right-tab
  85. position: absolute;
  86. left: $left-margin;
  87. z-index: 7; // forward than .CodeMirror-vscrollbar
  88. width: calc(100% - #{$left-margin} - #{$right-margin});
  89. padding-top: 3px;
  90. pointer-events: none; // disable pointer-events because it becomes an obstacle
  91. background: none;
  92. > .grw-subnav-container {
  93. width: 100%; // for crowi layout
  94. padding: 0; // for crowi layout
  95. pointer-events: initial; // enable pointer-events
  96. }
  97. h1#revision-path {
  98. @include variable-font-size(20px);
  99. line-height: 1em;
  100. // nowrap even if the path is too long
  101. .d-flex {
  102. flex-wrap: nowrap;
  103. }
  104. .path-segment {
  105. white-space: nowrap;
  106. }
  107. }
  108. .tag-labels.new-page {
  109. display: block;
  110. }
  111. }
  112. .page-editor-footer {
  113. width: 100%;
  114. min-height: 40px;
  115. padding: 3px;
  116. margin: 0;
  117. border-top: solid 1px transparent;
  118. .grw-grant-selector {
  119. .dropdown-toggle {
  120. min-width: 150px;
  121. // caret
  122. &::after {
  123. margin-left: 1em;
  124. }
  125. }
  126. }
  127. .btn-submit {
  128. width: 100px;
  129. }
  130. }
  131. &.builtin-editor {
  132. /*****************
  133. * Editor styles
  134. *****************/
  135. .page-editor-editor-container {
  136. border-right: 1px solid transparent;
  137. // override CodeMirror styles
  138. .CodeMirror {
  139. .cm-matchhighlight {
  140. background-color: cyan;
  141. }
  142. .CodeMirror-selection-highlight-scrollbar {
  143. background-color: darkcyan;
  144. }
  145. }
  146. // add icon on cursor
  147. .markdown-table-activated .CodeMirror-cursor {
  148. &:after {
  149. position: relative;
  150. top: -1.1em;
  151. left: 0.3em;
  152. display: block;
  153. width: 1em;
  154. height: 1em;
  155. content: ' ';
  156. background-image: url(/images/icons/editor/table.svg);
  157. background-repeat: no-repeat;
  158. background-size: 1em;
  159. }
  160. }
  161. .textarea-editor {
  162. font-family: monospace;
  163. border: none;
  164. }
  165. }
  166. .page-editor-preview-container {
  167. }
  168. .page-editor-preview-body {
  169. padding-top: 18px;
  170. padding-right: 15px;
  171. padding-left: 15px;
  172. overflow-y: scroll;
  173. }
  174. #page-editor-options-selector {
  175. .grw-editor-configuration-dropdown {
  176. .icon-container {
  177. display: inline-block;
  178. width: 20px;
  179. }
  180. .dropdown-menu > li > a {
  181. display: flex;
  182. align-items: center;
  183. justify-content: space-between;
  184. .menuitem-label {
  185. flex: 1;
  186. margin-right: 10px;
  187. }
  188. }
  189. }
  190. }
  191. #page-grant-selector {
  192. .btn-group {
  193. min-width: 150px;
  194. }
  195. }
  196. #page-grant-selector {
  197. .btn-group {
  198. min-width: 150px;
  199. }
  200. }
  201. }
  202. // .builtin-editor .tab-pane#edit
  203. &.hackmd {
  204. #page-editor-options-selector {
  205. display: none;
  206. }
  207. .hackmd-preinit,
  208. #iframe-hackmd-container > iframe {
  209. border: none;
  210. }
  211. .hackmd-error {
  212. top: 0;
  213. background-color: rgba($gray-800, 0.8);
  214. }
  215. .hackmd-status-label {
  216. font-size: 3em;
  217. color: $muted;
  218. }
  219. .hackmd-resume-button-container,
  220. .hackmd-discard-button-container {
  221. .btn-text {
  222. display: inline-block;
  223. min-width: 230px;
  224. }
  225. }
  226. .btn-view-outdated-draft {
  227. text-decoration: underline;
  228. vertical-align: unset;
  229. }
  230. }
  231. }
  232. /*
  233. * for creating portal
  234. */
  235. .nav-tabs-create-portal {
  236. display: none;
  237. }
  238. .on-edit .nav-tabs-create-portal {
  239. display: block;
  240. }
  241. // overwrite .CodeMirror pre
  242. .CodeMirror pre.CodeMirror-line {
  243. font-family: $font-family-monospace;
  244. }
  245. // overwrite .CodeMirror-hints
  246. .CodeMirror-hints {
  247. max-height: 30em !important;
  248. .CodeMirror-hint.crowi-emoji-autocomplete {
  249. font-family: $font-family-monospace-not-strictly;
  250. line-height: 1.6em;
  251. .img-container {
  252. display: inline-block;
  253. width: 30px;
  254. }
  255. }
  256. // active line
  257. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  258. .img-container {
  259. padding-top: 0.3em;
  260. padding-bottom: 0.3em;
  261. font-size: 15px; // adjust to .wiki
  262. }
  263. }
  264. }
  265. // overwrite .CodeMirror-placeholder
  266. .CodeMirror pre.CodeMirror-placeholder {
  267. color: $text-muted;
  268. }
  269. #tag-edit-button-tooltip {
  270. .tooltip-inner {
  271. color: #000;
  272. background-color: #fff;
  273. border: 1px solid #ccc;
  274. }
  275. .tooltip-arrow {
  276. border-bottom: 5px solid #ccc;
  277. }
  278. }