_on-edit.scss 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. body.on-edit {
  2. // hide unnecessary elements
  3. .navbar.navbar-static-top,
  4. .row.page-list,
  5. .row.page-comments-row,
  6. .row.page-attachments-row,
  7. .row.not-found-message-row,
  8. .users-meta,
  9. .user-page-content-container,
  10. .portal-form-button,
  11. .alert-info.alert-moved,
  12. .alert-info.alert-unlinked,
  13. .like-button, .bookmark-link, .btn-edit,
  14. .authors,
  15. footer {
  16. display: none !important;
  17. }
  18. // hide unnecessary elements for growi layout
  19. .revision-toc-container {
  20. display: none;
  21. }
  22. // hide unnecessary elements for crowi layout
  23. #toggle-sidebar,
  24. .crowi-sidebar {
  25. display: none;
  26. }
  27. /*****************
  28. * Expand Editor
  29. *****************/
  30. .expand-by-flex {
  31. display: flex;
  32. flex-direction: column;
  33. flex: 1;
  34. }
  35. .container-fluid {
  36. padding-bottom: 0;
  37. }
  38. .main {
  39. width: 100vw;
  40. height: 100vh;
  41. margin-top: 0px !important;
  42. padding-top: 2px;
  43. padding-left: 0;
  44. padding-right: 0;
  45. // for growi layout
  46. > .row {
  47. margin: 0;
  48. > .col-lg-10, > .col-md-9 {
  49. width: 100vw;
  50. padding: 0;
  51. }
  52. }
  53. &,
  54. .content-main,
  55. .tab-content,
  56. .edit-form,
  57. .page-form {
  58. @extend .expand-by-flex;
  59. }
  60. .page-form {
  61. #page-editor {
  62. &,
  63. .row, .col-md-6, .col-sm-12,
  64. .react-codemirror2, .CodeMirror, .CodeMirror-scroll,
  65. .page-editor-preview-body {
  66. height: calc(100vh - 100px);
  67. }
  68. }
  69. .form-group.form-submit-group {
  70. width: 100%;
  71. margin: 0;
  72. padding: 8px;
  73. min-height: 50px;
  74. background-color: #fafafa;
  75. border-top: solid 1px #ccc;
  76. }
  77. }
  78. }
  79. .row.bg-title {
  80. $left-margin: $nav-main-left-tab-width * 2 + 25px; // width of .nav-main-left-tab x 2 + some margin
  81. position: absolute;
  82. z-index: 1;
  83. left: $left-margin;
  84. min-width: calc(100% - #{$left-margin});
  85. // for crowi layout
  86. > .col-md-9, .col-xs-12 {
  87. padding: 0;
  88. width: 100%;
  89. }
  90. background: none;
  91. h1 {
  92. font-size: 20px;
  93. line-height: 1em;
  94. }
  95. }
  96. /*****************
  97. * Editor styles
  98. *****************/
  99. .main {
  100. background-color: #fafafa;
  101. #page-editor {
  102. background-color: #fff;
  103. }
  104. }
  105. .page-editor-editor-container {
  106. padding-right: 0;
  107. border-right: 1px solid #ccc;
  108. // override CodeMirror styles
  109. .CodeMirror {
  110. pre {
  111. font-family: $font-family-monospace-not-strictly;
  112. }
  113. .cm-matchhighlight {
  114. background-color: cyan;
  115. }
  116. .CodeMirror-selection-highlight-scrollbar {
  117. background-color: darkcyan;
  118. }
  119. }
  120. // for Dropzone
  121. .dropzone {
  122. @mixin insertFontAwesome($code) {
  123. &:before {
  124. margin-right: 0.2em;
  125. font-family: FontAwesome;
  126. content: $code;
  127. }
  128. }
  129. // default layout and style
  130. .dropzone-overlay {
  131. // layout
  132. display: flex;
  133. justify-content: center;
  134. align-items: center;
  135. // style
  136. margin: 0 15px;
  137. }
  138. .dropzone-overlay-content {
  139. font-size: 2em;
  140. padding: 0.2em;
  141. border-radius: 5px;
  142. }
  143. // unuploadable or rejected
  144. &.dropzone-unuploadable, &.dropzone-rejected {
  145. .dropzone-overlay {
  146. background: rgba(200,200,200,0.8);
  147. }
  148. .dropzone-overlay-content {
  149. color: #444;
  150. }
  151. }
  152. // uploading
  153. &.dropzone-uploading {
  154. .dropzone-overlay {
  155. background: rgba(255,255,255,0.5);
  156. }
  157. .dropzone-overlay-content {
  158. padding: 0.3em;
  159. background: rgba(200,200,200,0.5);
  160. color: #444;
  161. }
  162. }
  163. // unuploadable
  164. &.dropzone-unuploadable {
  165. .dropzone-overlay-content {
  166. // insert content
  167. @include insertFontAwesome("\f06a "); // fa-exclamation-circle
  168. &:after {
  169. content: "File uploading is disabled";
  170. }
  171. }
  172. }
  173. // uploadable
  174. &.dropzone-uploadable {
  175. // accepted
  176. &.dropzone-accepted:not(.dropzone-rejected) {
  177. .dropzone-overlay {
  178. border: 4px dashed #ccc;
  179. }
  180. .dropzone-overlay-content {
  181. // insert content
  182. @include insertFontAwesome("\f093"); // fa-upload
  183. &:after {
  184. content: "Drop here to upload";
  185. }
  186. // style
  187. color: #666;
  188. background: rgba(200,200,200,0.8);
  189. }
  190. }
  191. // file type mismatch
  192. &.dropzone-rejected:not(.dropzone-uploadablefile) .dropzone-overlay-content {
  193. // insert content
  194. @include insertFontAwesome("\f03e"); // fa-picture-o
  195. &:after {
  196. content: "Only an image file is allowed";
  197. }
  198. }
  199. // multiple files
  200. &.dropzone-accepted.dropzone-rejected .dropzone-overlay-content {
  201. // insert content
  202. @include insertFontAwesome("\f071"); // fa-fa-exclamation-triangle
  203. &:after {
  204. content: "Only 1 file is allowed";
  205. }
  206. }
  207. }
  208. } // end of.dropzone
  209. .btn-open-dropzone {
  210. font-size: small;
  211. text-align: right;
  212. padding-top: 3px;
  213. padding-bottom: 0;
  214. border: none;
  215. border-radius: 0;
  216. border-top: 1px dotted #ccc;
  217. background-color: transparent;
  218. &:active {
  219. box-shadow: none;
  220. }
  221. }
  222. }
  223. .page-editor-preview-container {
  224. }
  225. .page-editor-preview-body {
  226. padding-top: 18px;
  227. padding-right: 15px;
  228. overflow-y: scroll;
  229. }
  230. #page-editor-options-selector {
  231. label {
  232. margin-right: 0.5em;
  233. }
  234. .btn-style-active-line, .btn-render-mathjax-in-realtime {
  235. &:hover:not(.active), &:focus:not(.active) {
  236. background-color: inherit;
  237. }
  238. }
  239. @media (max-width: $screen-xs-max) { // {{{ less than smartphone size
  240. display: none;
  241. }
  242. }
  243. } // }}}
  244. /*
  245. * for creating portal
  246. */
  247. .nav-tabs-create-portal {
  248. display: none;
  249. }
  250. .on-edit .nav-tabs-create-portal {
  251. display: block;
  252. }
  253. /*
  254. .crowi.main-container .main .page-list.content-main { // {{{ Edit Form of Page List
  255. .close-button {
  256. display: none;
  257. }
  258. }
  259. .crowi.main-container .main .page-list.content-main.on-edit { // {{{ Edit Form of Page List
  260. .close-button {
  261. display: block;
  262. }
  263. .page-list-container {
  264. display: none;
  265. }
  266. .portal-form-header {
  267. height: 16px;
  268. padding: 8px;
  269. border-bottom: solid 1px #ccc;
  270. }
  271. } // }}}
  272. */
  273. /*
  274. @media (max-width: $screen-sm-max) { // {{{ less than tablet size
  275. .content-main.on-edit {
  276. .form-group.form-submit-group {
  277. select.form-control {
  278. display: inline-block;
  279. max-width: 50%;
  280. }
  281. }
  282. }
  283. } // }}}
  284. @media (max-width: $screen-xs-max) { // {{{ less than smartphone size
  285. #edit-form-submit {
  286. float: right;
  287. }
  288. } // }}}
  289. */
  290. // overwrite .CodeMirror-hints
  291. .CodeMirror-hints {
  292. // FIXME: required because .content-main.on-edit has 'z-index:1050'
  293. // z-index: 1060 !important;
  294. max-height: 30em !important;
  295. .CodeMirror-hint.crowi-emoji-autocomplete {
  296. font-family: $font-family-monospace-not-strictly;
  297. line-height: 1.6em;
  298. .img-container {
  299. display: inline-block;
  300. width: 30px;
  301. }
  302. }
  303. // active line
  304. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  305. .img-container {
  306. font-size: 15px; // adjust to .wiki
  307. padding-top: 0.3em;
  308. padding-bottom: 0.3em;
  309. }
  310. }
  311. }