_on-edit.scss 8.5 KB

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