Editor.module.scss 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. @use '~/styles/mixins' as ms;
  2. @use '~/styles/bootstrap/init' as bs;
  3. @use './page-editor-inheritance';
  4. .editor-container :global {
  5. // overlay in .editor-container
  6. .overlay {
  7. position: absolute;
  8. top: 0;
  9. right: 0;
  10. bottom: 0;
  11. left: 0;
  12. z-index: 7; // forward than .CodeMirror-vscrollbar
  13. display: flex;
  14. align-items: center;
  15. justify-content: center;
  16. }
  17. // loading keymap
  18. @include ms.overlay-processing-style(overlay-loading-keymap, 2.5em, 0.3em);
  19. // for Dropzone
  20. .dropzone {
  21. position: relative; // against .overlay position: absolute
  22. @include ms.overlay-processing-style(overlay-dropzone-active, 2.5em, 0.5em);
  23. // unuploadable or rejected
  24. &.dropzone-unuploadable,
  25. &.dropzone-rejected {
  26. .overlay.overlay-dropzone-active {
  27. background: rgba(200, 200, 200, 0.8);
  28. .overlay-content {
  29. color: bs.$gray-300;
  30. }
  31. }
  32. }
  33. // uploading
  34. &.dropzone-uploading {
  35. @include ms.overlay-processing-style(overlay-dropzone-active, 2.5em, 0.5em);
  36. }
  37. // unuploadable
  38. &.dropzone-unuploadable {
  39. .overlay.overlay-dropzone-active {
  40. .overlay-content {
  41. // insert content
  42. @include ms.insertSimpleLineIcons('\e617'); // icon-exclamation
  43. &:after {
  44. content: 'File uploading is disabled';
  45. }
  46. }
  47. }
  48. }
  49. // uploadable
  50. &.dropzone-uploadable {
  51. // accepted
  52. &.dropzone-accepted:not(.dropzone-rejected) {
  53. .overlay.overlay-dropzone-active {
  54. border: 4px dashed bs.$gray-300;
  55. .overlay-content {
  56. // insert content
  57. @include ms.insertSimpleLineIcons('\e084'); // icon-cloud-upload
  58. &:after {
  59. content: 'Drop here to upload';
  60. }
  61. // style
  62. color: bs.$secondary;
  63. background: rgba(200, 200, 200, 0.8);
  64. }
  65. }
  66. }
  67. // file type mismatch
  68. &.dropzone-rejected:not(.dropzone-uploadablefile) {
  69. .overlay.overlay-dropzone-active {
  70. .overlay-content {
  71. // insert content
  72. @include ms.insertSimpleLineIcons('\e032'); // icon-picture
  73. &:after {
  74. content: 'Only an image file is allowed';
  75. }
  76. }
  77. }
  78. }
  79. // multiple files
  80. &.dropzone-accepted.dropzone-rejected {
  81. .overlay.overlay-dropzone-active {
  82. .overlay-content {
  83. // insert content
  84. @include ms.insertSimpleLineIcons('\e617'); // icon-exclamation
  85. &:after {
  86. content: 'Only 1 file is allowed';
  87. }
  88. }
  89. }
  90. }
  91. }
  92. /* end of.dropzone */
  93. }
  94. .btn.btn-open-dropzone {
  95. z-index: 2;
  96. padding-top: 3px;
  97. padding-bottom: 3px;
  98. font-size: small;
  99. border: none;
  100. border-top: 1px dotted bs.$gray-300;
  101. border-bottom: none;
  102. &:hover,
  103. &:focus {
  104. border-bottom: none;
  105. }
  106. }
  107. // for Navbar editor
  108. .navbar-editor {
  109. height: page-editor-inheritance.$navbar-editor-height;
  110. padding: 0;
  111. border-bottom: 1px solid transparent;
  112. li {
  113. display: inline-block;
  114. i {
  115. font-size: 16px;
  116. }
  117. }
  118. button {
  119. padding: 0px;
  120. margin: 0 2px;
  121. font-size: 1rem;
  122. line-height: 1;
  123. background-color: transparent;
  124. border: none;
  125. }
  126. img {
  127. vertical-align: bottom;
  128. }
  129. }
  130. }