_on-edit.scss 8.4 KB

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