_on-edit.scss 6.3 KB

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