_on-edit.scss 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  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. // 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 tablet
  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. .cm-matchhighlight {
  155. background-color: cyan;
  156. }
  157. .CodeMirror-selection-highlight-scrollbar {
  158. background-color: darkcyan;
  159. }
  160. }
  161. .overlay {
  162. // layout
  163. display: flex;
  164. justify-content: center;
  165. align-items: center;
  166. // style
  167. margin: 0 15px;
  168. }
  169. .overlay-content {
  170. font-size: 2.5em;
  171. padding: 0.5em;
  172. }
  173. @mixin overlay-processing-style() {
  174. .overlay {
  175. background: rgba(255,255,255,0.5);
  176. }
  177. .overlay-content {
  178. padding: 0.3em;
  179. background: rgba(200,200,200,0.5);
  180. color: #444;
  181. }
  182. }
  183. // add icon on cursor
  184. .autoformat-markdown-table-activated .CodeMirror-cursor {
  185. &:after {
  186. font-family: 'FontAwesome';
  187. content: '\f0ce';
  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-editor {
  259. border: none;
  260. font-family: monospace;
  261. }
  262. .loading-keymap {
  263. @include overlay-processing-style();
  264. }
  265. .btn-open-dropzone {
  266. z-index: 2;
  267. font-size: small;
  268. text-align: right;
  269. padding-top: 3px;
  270. padding-bottom: 0;
  271. border: none;
  272. border-radius: 0;
  273. border-top: 1px dotted #ccc;
  274. &:active {
  275. box-shadow: none;
  276. }
  277. // hide if screen size is less than smartphone
  278. @media (max-width: $screen-xs) {
  279. display: none;
  280. }
  281. }
  282. }
  283. .page-editor-preview-container {
  284. }
  285. .page-editor-preview-body {
  286. padding-top: 18px;
  287. padding-right: 15px;
  288. overflow-y: scroll;
  289. }
  290. #page-editor-options-selector {
  291. label {
  292. margin-right: 0.5em;
  293. }
  294. // configuration dropdown
  295. .configuration-dropdown {
  296. .icon-container {
  297. display: inline-block;
  298. width: 20px;
  299. }
  300. .dropdown-menu > li > a {
  301. display: flex;
  302. justify-content: space-between;
  303. align-items: center;
  304. .menuitem-label {
  305. flex: 1;
  306. margin-right: 10px;
  307. }
  308. }
  309. }
  310. @media (max-width: $screen-xs-max) { // {{{ less than smartphone size
  311. display: none;
  312. }
  313. }
  314. #page-grant-selector {
  315. .btn-group {
  316. min-width: 150px;
  317. }
  318. }
  319. } // }}}
  320. /*
  321. * for creating portal
  322. */
  323. .nav-tabs-create-portal {
  324. display: none;
  325. }
  326. .on-edit .nav-tabs-create-portal {
  327. display: block;
  328. }
  329. // overwrite .CodeMirror-hints
  330. .CodeMirror-hints {
  331. // FIXME: required because .content-main.on-edit has 'z-index:1050'
  332. // z-index: 1060 !important;
  333. max-height: 30em !important;
  334. .CodeMirror-hint.crowi-emoji-autocomplete {
  335. font-family: $font-family-monospace-not-strictly;
  336. line-height: 1.6em;
  337. .img-container {
  338. display: inline-block;
  339. width: 30px;
  340. }
  341. }
  342. // active line
  343. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  344. .img-container {
  345. font-size: 15px; // adjust to .wiki
  346. padding-top: 0.3em;
  347. padding-bottom: 0.3em;
  348. }
  349. }
  350. }