_on-edit.scss 6.5 KB

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