_on-edit.scss 6.4 KB

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