_form.scss 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. // import crowi variable
  2. @import 'utilities';
  3. .crowi.main-container .main .content-main.on-edit { // {{{ Edit Form of Page
  4. padding: 0;
  5. position: fixed;
  6. z-index: 1050;
  7. background: #fff;
  8. top: 0;
  9. left: 0;
  10. height: 100%;
  11. width: 100%;
  12. .nav {
  13. margin-top: 8px;
  14. height: 40px;
  15. .dropdown-menu {
  16. z-index: 1060;
  17. }
  18. }
  19. .tab-content {
  20. top: 48px;
  21. bottom: 58px;
  22. position: absolute;
  23. z-index: 1051;
  24. left: 0;
  25. right: 0;
  26. margin-top: 4px;
  27. .alert-info.alert-moved,
  28. .alert-info.alert-unlinked {
  29. display: none;
  30. }
  31. // layout (height: 100%)
  32. .edit-form {
  33. height: 100%;
  34. > form {
  35. height: 100%;
  36. > #page-editor {
  37. height: 100%;
  38. .row, .col-md-6, .col-sm-12,
  39. .react-codemirror2, .CodeMirror, .CodeMirror-scroll,
  40. .page-editor-preview-body
  41. {
  42. height: 100%;
  43. }
  44. }
  45. }
  46. }
  47. }
  48. .page-form-setting {
  49. .extended-setting {
  50. label {
  51. margin-bottom: 0;
  52. }
  53. }
  54. }
  55. .page-editor-editor-container {
  56. padding-right: 0;
  57. border-right: 1px solid #ccc;
  58. // override CodeMirror styles
  59. .CodeMirror {
  60. pre {
  61. font-family: $font-family-monospace-not-strictly;
  62. }
  63. .cm-matchhighlight {
  64. background-color: cyan;
  65. }
  66. .CodeMirror-selection-highlight-scrollbar {
  67. background-color: darkcyan;
  68. }
  69. }
  70. // for Dropzone
  71. .dropzone {
  72. @mixin insertFontAwesome($code) {
  73. &:before {
  74. margin-right: 0.2em;
  75. font-family: FontAwesome;
  76. content: $code;
  77. }
  78. }
  79. // default layout and style
  80. .dropzone-overlay {
  81. // layout
  82. display: flex;
  83. justify-content: center;
  84. align-items: center;
  85. // style
  86. margin: 0 15px;
  87. }
  88. .dropzone-overlay-content {
  89. font-size: 2em;
  90. padding: 0.2em;
  91. border-radius: 5px;
  92. }
  93. // unuploadable or rejected
  94. &.dropzone-unuploadable, &.dropzone-rejected {
  95. .dropzone-overlay {
  96. background: rgba(200,200,200,0.8);
  97. }
  98. .dropzone-overlay-content {
  99. color: #444;
  100. }
  101. }
  102. // uploading
  103. &.dropzone-uploading {
  104. .dropzone-overlay {
  105. background: rgba(255,255,255,0.5);
  106. }
  107. .dropzone-overlay-content {
  108. padding: 0.3em;
  109. background: rgba(200,200,200,0.5);
  110. color: #444;
  111. }
  112. }
  113. // unuploadable
  114. &.dropzone-unuploadable {
  115. .dropzone-overlay-content {
  116. // insert content
  117. @include insertFontAwesome("\f06a "); // fa-exclamation-circle
  118. &:after {
  119. content: "File uploading is disabled";
  120. }
  121. }
  122. }
  123. // uploadable
  124. &.dropzone-uploadable {
  125. // accepted
  126. &.dropzone-accepted:not(.dropzone-rejected) {
  127. .dropzone-overlay {
  128. border: 4px dashed #ccc;
  129. }
  130. .dropzone-overlay-content {
  131. // insert content
  132. @include insertFontAwesome("\f093"); // fa-upload
  133. &:after {
  134. content: "Drop here to upload";
  135. }
  136. // style
  137. color: #666;
  138. background: rgba(200,200,200,0.8);
  139. }
  140. }
  141. // file type mismatch
  142. &.dropzone-rejected:not(.dropzone-uploadablefile) .dropzone-overlay-content {
  143. // insert content
  144. @include insertFontAwesome("\f03e"); // fa-picture-o
  145. &:after {
  146. content: "Only an image file is allowed";
  147. }
  148. }
  149. // multiple files
  150. &.dropzone-accepted.dropzone-rejected .dropzone-overlay-content {
  151. // insert content
  152. @include insertFontAwesome("\f071"); // fa-fa-exclamation-triangle
  153. &:after {
  154. content: "Only 1 file is allowed";
  155. }
  156. }
  157. }
  158. } // end of.dropzone
  159. .btn-open-dropzone {
  160. font-size: small;
  161. text-align: right;
  162. padding-top: 3px;
  163. padding-bottom: 0;
  164. border: none;
  165. border-radius: 0;
  166. border-top: 1px dotted #ccc;
  167. background-color: transparent;
  168. &:active {
  169. box-shadow: none;
  170. }
  171. }
  172. }
  173. .page-editor-preview-container {
  174. }
  175. .page-editor-preview-body {
  176. padding-top: 18px;
  177. padding-right: 15px;
  178. overflow-y: scroll;
  179. }
  180. .form-group.form-submit-group {
  181. position: fixed;
  182. z-index: 1054;
  183. bottom: 0;
  184. width: 100%;
  185. left: 0;
  186. padding: 8px;
  187. min-height: 50px;
  188. background: rgba(255,255,255,.8);
  189. border-top: solid 1px #ccc;
  190. margin-bottom: 0;
  191. }
  192. } // }}}
  193. .crowi.main-container .main .page-list.content-main { // {{{ Edit Form of Page List
  194. .close-button {
  195. display: none;
  196. }
  197. }
  198. .crowi.main-container .main .page-list.content-main.on-edit { // {{{ Edit Form of Page List
  199. .close-button {
  200. display: block;
  201. }
  202. .page-list-container {
  203. display: none;
  204. }
  205. .portal-form-header {
  206. height: 16px;
  207. padding: 8px;
  208. border-bottom: solid 1px #ccc;
  209. }
  210. } // }}}
  211. @media (max-width: $screen-sm-max) { // {{{ less than tablet size
  212. .content-main.on-edit {
  213. .form-group.form-submit-group {
  214. select.form-control {
  215. display: inline-block;
  216. max-width: 50%;
  217. }
  218. }
  219. }
  220. } // }}}
  221. @media (max-width: $screen-xs-max) { // {{{ less than smartphone size
  222. #edit-form-submit {
  223. float: right;
  224. }
  225. } // }}}
  226. // overwrite .CodeMirror-hints
  227. .CodeMirror-hints {
  228. // FIXME: required because .content-main.on-edit has 'z-index:1050'
  229. z-index: 1060 !important;
  230. max-height: 30em !important;
  231. .CodeMirror-hint.crowi-emoji-autocomplete {
  232. font-family: $font-family-monospace-not-strictly;
  233. line-height: 1.6em;
  234. .img-container {
  235. display: inline-block;
  236. width: 30px;
  237. img.emojione {
  238. width: 1.6em;
  239. }
  240. }
  241. }
  242. // active line
  243. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  244. .img-container {
  245. font-size: 15px; // adjust to .wiki
  246. padding-top: 0.3em;
  247. padding-bottom: 0.3em;
  248. }
  249. }
  250. }