_on-edit.scss 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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) {
  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 + 46px; // width of all of nav-main-right-tab
  117. position: absolute;
  118. z-index: 1;
  119. left: $left-margin;
  120. 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. .header-wrap {
  128. overflow-x: hidden;
  129. }
  130. h1#revision-path {
  131. @include variable-font-size(20px);
  132. line-height: 1em;
  133. // nowrap even if the path is too long
  134. .d-flex {
  135. flex-wrap: nowrap;
  136. }
  137. .path-segment {
  138. white-space: nowrap;
  139. }
  140. }
  141. // hide if screen size is less than smartphone
  142. @media (max-width: $screen-sm) {
  143. display: none;
  144. }
  145. }
  146. /*****************
  147. * Editor styles
  148. *****************/
  149. .page-editor-editor-container {
  150. border-right: 1px solid transparent;
  151. padding-right: 0;
  152. // override CodeMirror styles
  153. .CodeMirror {
  154. pre {
  155. font-family: $font-family-monospace-not-strictly;
  156. }
  157. .cm-matchhighlight {
  158. background-color: cyan;
  159. }
  160. .CodeMirror-selection-highlight-scrollbar {
  161. background-color: darkcyan;
  162. }
  163. }
  164. // for Dropzone
  165. .dropzone {
  166. @mixin insertFontAwesome($code) {
  167. &:before {
  168. margin-right: 0.2em;
  169. font-family: 'simple-line-icons';
  170. content: $code;
  171. }
  172. }
  173. // default layout and style
  174. .dropzone-overlay {
  175. // layout
  176. display: flex;
  177. justify-content: center;
  178. align-items: center;
  179. // style
  180. margin: 0 15px;
  181. }
  182. .dropzone-overlay-content {
  183. font-size: 2.5em;
  184. padding: 0.5em;
  185. }
  186. // unuploadable or rejected
  187. &.dropzone-unuploadable, &.dropzone-rejected {
  188. .dropzone-overlay {
  189. background: rgba(200,200,200,0.8);
  190. }
  191. .dropzone-overlay-content {
  192. color: #444;
  193. }
  194. }
  195. // uploading
  196. &.dropzone-uploading {
  197. .dropzone-overlay {
  198. background: rgba(255,255,255,0.5);
  199. }
  200. .dropzone-overlay-content {
  201. padding: 0.3em;
  202. background: rgba(200,200,200,0.5);
  203. color: #444;
  204. }
  205. }
  206. // unuploadable
  207. &.dropzone-unuploadable {
  208. .dropzone-overlay-content {
  209. // insert content
  210. @include insertFontAwesome("\e617"); // icon-exclamation
  211. &:after {
  212. content: "File uploading is disabled";
  213. }
  214. }
  215. }
  216. // uploadable
  217. &.dropzone-uploadable {
  218. // accepted
  219. &.dropzone-accepted:not(.dropzone-rejected) {
  220. .dropzone-overlay {
  221. border: 4px dashed #ccc;
  222. }
  223. .dropzone-overlay-content {
  224. // insert content
  225. @include insertFontAwesome("\e084"); // icon-cloud-upload
  226. &:after {
  227. content: "Drop here to upload";
  228. }
  229. // style
  230. color: #666;
  231. background: rgba(200,200,200,0.8);
  232. }
  233. }
  234. // file type mismatch
  235. &.dropzone-rejected:not(.dropzone-uploadablefile) .dropzone-overlay-content {
  236. // insert content
  237. @include insertFontAwesome("\e032"); // icon-picture
  238. &:after {
  239. content: "Only an image file is allowed";
  240. }
  241. }
  242. // multiple files
  243. &.dropzone-accepted.dropzone-rejected .dropzone-overlay-content {
  244. // insert content
  245. @include insertFontAwesome("\e617"); // icon-exclamation
  246. &:after {
  247. content: "Only 1 file is allowed";
  248. }
  249. }
  250. }
  251. } // end of.dropzone
  252. .btn-open-dropzone {
  253. z-index: 2;
  254. font-size: small;
  255. text-align: right;
  256. padding-top: 3px;
  257. padding-bottom: 0;
  258. border: none;
  259. border-radius: 0;
  260. border-top: 1px dotted #ccc;
  261. &:active {
  262. box-shadow: none;
  263. }
  264. }
  265. }
  266. .page-editor-preview-container {
  267. }
  268. .page-editor-preview-body {
  269. padding-top: 18px;
  270. padding-right: 15px;
  271. overflow-y: scroll;
  272. }
  273. #page-editor-options-selector {
  274. label {
  275. margin-right: 0.5em;
  276. }
  277. // configuration dropdown
  278. .configuration-dropdown {
  279. .icon-container {
  280. display: inline-block;
  281. width: 20px;
  282. }
  283. .dropdown-menu > li > a {
  284. display: flex;
  285. justify-content: space-between;
  286. align-items: center;
  287. .menuitem-label {
  288. flex: 1;
  289. margin-right: 10px;
  290. }
  291. }
  292. }
  293. @media (max-width: $screen-xs-max) { // {{{ less than smartphone size
  294. display: none;
  295. }
  296. }
  297. } // }}}
  298. /*
  299. * for creating portal
  300. */
  301. .nav-tabs-create-portal {
  302. display: none;
  303. }
  304. .on-edit .nav-tabs-create-portal {
  305. display: block;
  306. }
  307. /*
  308. .crowi.main-container .main .page-list.content-main { // {{{ Edit Form of Page List
  309. .close-button {
  310. display: none;
  311. }
  312. }
  313. .crowi.main-container .main .page-list.content-main.on-edit { // {{{ Edit Form of Page List
  314. .close-button {
  315. display: block;
  316. }
  317. .page-list-container {
  318. display: none;
  319. }
  320. .portal-form-header {
  321. height: 16px;
  322. padding: 8px;
  323. border-bottom: solid 1px #ccc;
  324. }
  325. } // }}}
  326. */
  327. /*
  328. @media (max-width: $screen-sm-max) { // {{{ less than tablet size
  329. .content-main.on-edit {
  330. .form-group.form-submit-group {
  331. select.form-control {
  332. display: inline-block;
  333. max-width: 50%;
  334. }
  335. }
  336. }
  337. } // }}}
  338. @media (max-width: $screen-xs-max) { // {{{ less than smartphone size
  339. #edit-form-submit {
  340. float: right;
  341. }
  342. } // }}}
  343. */
  344. // overwrite .CodeMirror-hints
  345. .CodeMirror-hints {
  346. // FIXME: required because .content-main.on-edit has 'z-index:1050'
  347. // z-index: 1060 !important;
  348. max-height: 30em !important;
  349. .CodeMirror-hint.crowi-emoji-autocomplete {
  350. font-family: $font-family-monospace-not-strictly;
  351. line-height: 1.6em;
  352. .img-container {
  353. display: inline-block;
  354. width: 30px;
  355. }
  356. }
  357. // active line
  358. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  359. .img-container {
  360. font-size: 15px; // adjust to .wiki
  361. padding-top: 0.3em;
  362. padding-bottom: 0.3em;
  363. }
  364. }
  365. }