_on-edit.scss 8.3 KB

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