_on-edit.scss 7.6 KB

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