_on-edit.scss 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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-info,
  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. @media (min-width: $screen-md) {
  97. padding-right: 0;
  98. }
  99. }
  100. }
  101. #page-editor-with-hackmd {
  102. &,
  103. .hackmd-preinit, #iframe-hackmd-container > iframe {
  104. width: 100vw;
  105. min-height: calc(100vh - #{$header-plus-footer}); // for IE11
  106. height: calc(100vh - #{$header-plus-footer});
  107. }
  108. }
  109. }
  110. }
  111. .row.bg-title {
  112. $left-margin: $nav-main-left-tab-width * 2 + 25px; // width of .nav-main-left-tab x 2 + some margin
  113. $right-margin: 128px + 94px + 46px; // width of all of nav-main-right-tab
  114. position: absolute;
  115. z-index: 1;
  116. left: $left-margin;
  117. width: calc(100% - #{$left-margin} - #{$right-margin});
  118. // for crowi layout
  119. > .col-md-9, .col-xs-12 {
  120. padding: 0;
  121. width: 100%;
  122. }
  123. background: none;
  124. .header-wrap {
  125. overflow-x: hidden;
  126. }
  127. h1#revision-path {
  128. @include variable-font-size(20px);
  129. line-height: 1em;
  130. // nowrap even if the path is too long
  131. .d-flex {
  132. flex-wrap: nowrap;
  133. }
  134. .path-segment {
  135. white-space: nowrap;
  136. }
  137. }
  138. // hide if screen size is less than tablet
  139. @media (max-width: $screen-sm) {
  140. display: none;
  141. }
  142. }
  143. .page-editor-footer {
  144. width: 100%;
  145. margin: 0;
  146. padding: 3px;
  147. min-height: 40px;
  148. border-top: solid 1px transparent;
  149. .grant-selector {
  150. .btn-group {
  151. min-width: 150px;
  152. }
  153. }
  154. .btn-submit {
  155. width: 100px;
  156. }
  157. }
  158. &.builtin-editor {
  159. /*****************
  160. * Editor styles
  161. *****************/
  162. .page-editor-editor-container {
  163. border-right: 1px solid transparent;
  164. // override CodeMirror styles
  165. .CodeMirror {
  166. .cm-matchhighlight {
  167. background-color: cyan;
  168. }
  169. .CodeMirror-selection-highlight-scrollbar {
  170. background-color: darkcyan;
  171. }
  172. }
  173. // add icon on cursor
  174. .autoformat-markdown-table-activated .CodeMirror-cursor {
  175. &:after {
  176. font-family: 'FontAwesome';
  177. content: '\f0ce';
  178. }
  179. }
  180. .textarea-editor {
  181. border: none;
  182. font-family: monospace;
  183. }
  184. }
  185. .page-editor-preview-container {
  186. }
  187. .page-editor-preview-body {
  188. padding-top: 18px;
  189. padding-right: 15px;
  190. overflow-y: scroll;
  191. }
  192. #page-editor-options-selector {
  193. label {
  194. margin-right: 0.5em;
  195. }
  196. // configuration dropdown
  197. .configuration-dropdown {
  198. .icon-container {
  199. display: inline-block;
  200. width: 20px;
  201. }
  202. .dropdown-menu > li > a {
  203. display: flex;
  204. justify-content: space-between;
  205. align-items: center;
  206. .menuitem-label {
  207. flex: 1;
  208. margin-right: 10px;
  209. }
  210. }
  211. }
  212. @media (max-width: $screen-xs-max) { // {{{ less than smartphone size
  213. display: none;
  214. }
  215. }
  216. #page-grant-selector {
  217. .btn-group {
  218. min-width: 150px;
  219. }
  220. }
  221. #page-grant-selector {
  222. .btn-group {
  223. min-width: 150px;
  224. }
  225. }
  226. } // .builtin-editor .tab-pane#edit
  227. &.hackmd {
  228. #page-editor-options-selector {
  229. display: none;
  230. }
  231. .hackmd-preinit, #iframe-hackmd-container > iframe {
  232. border: none;
  233. }
  234. .hackmd-status-label {
  235. font-size: 3em;
  236. color: $muted;
  237. }
  238. .hackmd-start-button-container, .hackmd-resume-button-container {
  239. .btn-lg .btn-label {
  240. padding-top: 6px; // for SplitButton
  241. padding-bottom: 6px; // for SplitButton
  242. }
  243. }
  244. .hackmd-resume-button-container {
  245. .dropdown-menu {
  246. left: unset;
  247. right: 0;
  248. }
  249. }
  250. // hide #page-status-alert
  251. #page-status-alert {
  252. display: none;
  253. }
  254. }
  255. }
  256. /*
  257. * for creating portal
  258. */
  259. .nav-tabs-create-portal {
  260. display: none;
  261. }
  262. .on-edit .nav-tabs-create-portal {
  263. display: block;
  264. }
  265. // overwrite .CodeMirror-hints
  266. .CodeMirror-hints {
  267. // FIXME: required because .content-main.on-edit has 'z-index:1050'
  268. // z-index: 1060 !important;
  269. max-height: 30em !important;
  270. .CodeMirror-hint.crowi-emoji-autocomplete {
  271. font-family: $font-family-monospace-not-strictly;
  272. line-height: 1.6em;
  273. .img-container {
  274. display: inline-block;
  275. width: 30px;
  276. }
  277. }
  278. // active line
  279. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  280. .img-container {
  281. font-size: 15px; // adjust to .wiki
  282. padding-top: 0.3em;
  283. padding-bottom: 0.3em;
  284. }
  285. }
  286. }
  287. // overwrite .CodeMirror-placeholder
  288. .CodeMirror pre.CodeMirror-placeholder {
  289. color: $text-muted;
  290. }