_on-edit.scss 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. body.on-edit {
  2. // hide unnecessary elements
  3. .navbar.navbar-static-top,
  4. .row.row-alerts,
  5. .row.page-list,
  6. .row.page-comments-row,
  7. .row.page-attachments-row,
  8. .row.not-found-message-row,
  9. .users-meta,
  10. .user-page-content-container,
  11. .portal-form-button,
  12. .alert-info.alert-moved,
  13. .alert-info.alert-unlinked,
  14. .like-button, .bookmark-link, .btn-edit,
  15. .authors,
  16. footer {
  17. display: none !important;
  18. }
  19. // hide unnecessary elements for growi layout
  20. .revision-toc-container {
  21. display: none;
  22. }
  23. // hide unnecessary elements for crowi layout
  24. #toggle-sidebar,
  25. .crowi-sidebar {
  26. display: none;
  27. }
  28. /*
  29. * right tabs
  30. */
  31. .nav-main-right-tab:not(.dropdown) {
  32. // hide if screen size is less than smartphone
  33. @media (max-width: $screen-xs-max) {
  34. display: none;
  35. }
  36. }
  37. /*****************
  38. * Expand Editor
  39. *****************/
  40. .expand-by-flex {
  41. display: flex;
  42. flex-direction: column;
  43. flex: 1;
  44. }
  45. .container-fluid {
  46. padding-bottom: 0;
  47. }
  48. .main {
  49. width: 100vw;
  50. height: 100vh;
  51. margin-top: 0px !important;
  52. padding-top: 2px;
  53. padding-left: 0;
  54. padding-right: 0;
  55. // for growi layout
  56. > .row {
  57. margin: 0;
  58. > .col-lg-10, > .col-md-9 {
  59. width: 100vw;
  60. padding: 0;
  61. }
  62. }
  63. &,
  64. .content-main,
  65. .tab-content,
  66. .edit-form,
  67. .page-form {
  68. @extend .expand-by-flex;
  69. }
  70. .page-form {
  71. // calculate margin
  72. $header-plus-footer: 2px // .main padding-top
  73. + 42px // .nav height
  74. + 1px // .page-editor-footer border-top
  75. + 40px; // .page-editor-footer min-height
  76. $preview-margin: $header-plus-footer;
  77. $editor-margin: $header-plus-footer + 22px; // .btn-open-dropzone height
  78. #page-editor {
  79. // right(preview)
  80. &,
  81. .row,
  82. .page-editor-preview-container,
  83. .page-editor-preview-body {
  84. height: calc(100vh - #{$preview-margin});
  85. }
  86. // left(editor)
  87. .page-editor-editor-container,
  88. .react-codemirror2, .CodeMirror, .CodeMirror-scroll {
  89. height: calc(100vh - #{$editor-margin});
  90. }
  91. }
  92. .page-editor-footer {
  93. width: 100%;
  94. margin: 0;
  95. padding: 3px;
  96. min-height: 40px;
  97. border-top: solid 1px transparent;
  98. .btn-submit {
  99. width: 100px;
  100. }
  101. }
  102. // slack
  103. .input-group-slack {
  104. .input-group-addon {
  105. padding: 2px 8px;
  106. line-height: 1em;
  107. img, input {
  108. vertical-align: middle;
  109. }
  110. }
  111. }
  112. }
  113. }
  114. .row.bg-title {
  115. $left-margin: $nav-main-left-tab-width * 2 + 25px; // width of .nav-main-left-tab x 2 + some margin
  116. $right-margin: 128px + 94px; // width of presentation and history tabs width
  117. position: absolute;
  118. z-index: 1;
  119. left: $left-margin;
  120. min-width: calc(100% - #{$left-margin} - #{$right-margin});
  121. // for crowi layout
  122. > .col-md-9, .col-xs-12 {
  123. padding: 0;
  124. width: 100%;
  125. }
  126. background: none;
  127. h1#revision-path {
  128. @include variable-font-size(20px);
  129. line-height: 1em;
  130. .d-flex {
  131. flex-wrap: nowrap; // nowrap even if the path is too long
  132. }
  133. }
  134. // hide if screen size is less than smartphone
  135. @media (max-width: $screen-xs) {
  136. display: none;
  137. }
  138. }
  139. /*****************
  140. * Editor styles
  141. *****************/
  142. .page-editor-editor-container {
  143. border-right: 1px solid transparent;
  144. padding-right: 0;
  145. // override CodeMirror styles
  146. .CodeMirror {
  147. pre {
  148. font-family: $font-family-monospace-not-strictly;
  149. }
  150. .cm-matchhighlight {
  151. background-color: cyan;
  152. }
  153. .CodeMirror-selection-highlight-scrollbar {
  154. background-color: darkcyan;
  155. }
  156. }
  157. // for Dropzone
  158. .dropzone {
  159. @mixin insertFontAwesome($code) {
  160. &:before {
  161. margin-right: 0.2em;
  162. font-family: 'simple-line-icons';
  163. content: $code;
  164. }
  165. }
  166. // default layout and style
  167. .dropzone-overlay {
  168. // layout
  169. display: flex;
  170. justify-content: center;
  171. align-items: center;
  172. // style
  173. margin: 0 15px;
  174. }
  175. .dropzone-overlay-content {
  176. font-size: 2.5em;
  177. padding: 0.5em;
  178. }
  179. // unuploadable or rejected
  180. &.dropzone-unuploadable, &.dropzone-rejected {
  181. .dropzone-overlay {
  182. background: rgba(200,200,200,0.8);
  183. }
  184. .dropzone-overlay-content {
  185. color: #444;
  186. }
  187. }
  188. // uploading
  189. &.dropzone-uploading {
  190. .dropzone-overlay {
  191. background: rgba(255,255,255,0.5);
  192. }
  193. .dropzone-overlay-content {
  194. padding: 0.3em;
  195. background: rgba(200,200,200,0.5);
  196. color: #444;
  197. }
  198. }
  199. // unuploadable
  200. &.dropzone-unuploadable {
  201. .dropzone-overlay-content {
  202. // insert content
  203. @include insertFontAwesome("\e617"); // icon-exclamation
  204. &:after {
  205. content: "File uploading is disabled";
  206. }
  207. }
  208. }
  209. // uploadable
  210. &.dropzone-uploadable {
  211. // accepted
  212. &.dropzone-accepted:not(.dropzone-rejected) {
  213. .dropzone-overlay {
  214. border: 4px dashed #ccc;
  215. }
  216. .dropzone-overlay-content {
  217. // insert content
  218. @include insertFontAwesome("\e084"); // icon-cloud-upload
  219. &:after {
  220. content: "Drop here to upload";
  221. }
  222. // style
  223. color: #666;
  224. background: rgba(200,200,200,0.8);
  225. }
  226. }
  227. // file type mismatch
  228. &.dropzone-rejected:not(.dropzone-uploadablefile) .dropzone-overlay-content {
  229. // insert content
  230. @include insertFontAwesome("\e032"); // icon-picture
  231. &:after {
  232. content: "Only an image file is allowed";
  233. }
  234. }
  235. // multiple files
  236. &.dropzone-accepted.dropzone-rejected .dropzone-overlay-content {
  237. // insert content
  238. @include insertFontAwesome("\e617"); // icon-exclamation
  239. &:after {
  240. content: "Only 1 file is allowed";
  241. }
  242. }
  243. }
  244. } // end of.dropzone
  245. .btn-open-dropzone {
  246. z-index: 2;
  247. font-size: small;
  248. text-align: right;
  249. padding-top: 3px;
  250. padding-bottom: 0;
  251. border: none;
  252. border-radius: 0;
  253. border-top: 1px dotted #ccc;
  254. &:active {
  255. box-shadow: none;
  256. }
  257. }
  258. }
  259. .page-editor-preview-container {
  260. }
  261. .page-editor-preview-body {
  262. padding-top: 18px;
  263. padding-right: 15px;
  264. overflow-y: scroll;
  265. }
  266. #page-editor-options-selector {
  267. label {
  268. margin-right: 0.5em;
  269. }
  270. // configuration dropdown
  271. .configuration-dropdown {
  272. .icon-container {
  273. display: inline-block;
  274. width: 20px;
  275. }
  276. .dropdown-menu > li > a {
  277. display: flex;
  278. justify-content: space-between;
  279. align-items: center;
  280. .menuitem-label {
  281. flex: 1;
  282. margin-right: 10px;
  283. }
  284. }
  285. }
  286. @media (max-width: $screen-xs-max) { // {{{ less than smartphone size
  287. display: none;
  288. }
  289. }
  290. } // }}}
  291. /*
  292. * for creating portal
  293. */
  294. .nav-tabs-create-portal {
  295. display: none;
  296. }
  297. .on-edit .nav-tabs-create-portal {
  298. display: block;
  299. }
  300. /*
  301. .crowi.main-container .main .page-list.content-main { // {{{ Edit Form of Page List
  302. .close-button {
  303. display: none;
  304. }
  305. }
  306. .crowi.main-container .main .page-list.content-main.on-edit { // {{{ Edit Form of Page List
  307. .close-button {
  308. display: block;
  309. }
  310. .page-list-container {
  311. display: none;
  312. }
  313. .portal-form-header {
  314. height: 16px;
  315. padding: 8px;
  316. border-bottom: solid 1px #ccc;
  317. }
  318. } // }}}
  319. */
  320. /*
  321. @media (max-width: $screen-sm-max) { // {{{ less than tablet size
  322. .content-main.on-edit {
  323. .form-group.form-submit-group {
  324. select.form-control {
  325. display: inline-block;
  326. max-width: 50%;
  327. }
  328. }
  329. }
  330. } // }}}
  331. @media (max-width: $screen-xs-max) { // {{{ less than smartphone size
  332. #edit-form-submit {
  333. float: right;
  334. }
  335. } // }}}
  336. */
  337. // overwrite .CodeMirror-hints
  338. .CodeMirror-hints {
  339. // FIXME: required because .content-main.on-edit has 'z-index:1050'
  340. // z-index: 1060 !important;
  341. max-height: 30em !important;
  342. .CodeMirror-hint.crowi-emoji-autocomplete {
  343. font-family: $font-family-monospace-not-strictly;
  344. line-height: 1.6em;
  345. .img-container {
  346. display: inline-block;
  347. width: 30px;
  348. }
  349. }
  350. // active line
  351. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  352. .img-container {
  353. font-size: 15px; // adjust to .wiki
  354. padding-top: 0.3em;
  355. padding-bottom: 0.3em;
  356. }
  357. }
  358. }