_on-edit.scss 8.5 KB

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