_on-edit.scss 7.6 KB

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