_on-edit.scss 6.4 KB

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