style.scss 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. @use 'inputrange' with (
  2. $track-color: rgba(#fff, 0.2),
  3. $thumb-color: #fff,
  4. $thumb-radius: 9px,
  5. $thumb-height: 16px,
  6. $thumb-width: 16px,
  7. $thumb-shadow-size: 0,
  8. $thumb-border-width: 0,
  9. $thumb-border-color: transparent,
  10. // If you change this `$track-height`, also change `::-moz-range-track` way below
  11. $track-height: 4px,
  12. $track-shadow-size: 0,
  13. $track-shadow-blur: 0,
  14. $track-shadow-color: transparent,
  15. $track-border-width: 0,
  16. $track-border-color: transparent
  17. );
  18. @import '@uppy/core/src/_utils.scss';
  19. @import '@uppy/core/src/_variables.scss';
  20. @import './cropper.scss';
  21. .uppy-ImageCropper {
  22. display: flex;
  23. flex-direction: column;
  24. width: 100%;
  25. height: 100%;
  26. }
  27. .uppy-ImageCropper-container {
  28. flex-grow: 1;
  29. }
  30. .uppy-ImageCropper-image {
  31. // Note that exactly these styles are demanded by cropperjs
  32. // (https: //github.com/fengyuanchen/cropperjs#example)
  33. display: block;
  34. max-width: 100%;
  35. // And this style is required for rendering tall and narrow images
  36. max-height: 400px;
  37. }
  38. .uppy-ImageCropper-controls {
  39. position: absolute;
  40. bottom: 15px;
  41. left: 50%;
  42. display: flex;
  43. align-items: center;
  44. justify-content: center;
  45. padding-top: 38px;
  46. color: $white;
  47. background-color: rgba($black, 0.6);
  48. transform: translateX(-50%);
  49. border-radius: 5px;
  50. .uppy-size--md & {
  51. padding-top: 0;
  52. }
  53. }
  54. .uppy-ImageCropper-controls button {
  55. width: 35px;
  56. height: 35px;
  57. border-radius: 5px;
  58. svg {
  59. padding: 3px;
  60. }
  61. .uppy-size--md & {
  62. width: 40px;
  63. height: 40px;
  64. svg {
  65. padding: 1px;
  66. }
  67. }
  68. &:hover {
  69. background-color: rgba(white, 0.5);
  70. }
  71. &:focus {
  72. background-color: rgba(white, 0.5);
  73. outline: none;
  74. }
  75. }
  76. .uppy-Dashboard:not(.uppy-size--md) .uppy-ImageCropper-rangeWrapper {
  77. position: absolute !important;
  78. top: 0;
  79. right: 10px;
  80. left: 10px;
  81. height: 38px;
  82. }
  83. .uppy-size--md .uppy-ImageCropper-range {
  84. width: 180px;
  85. margin-right: 5px;
  86. margin-left: 5px;
  87. }
  88. // Overrides: cropper.scss
  89. .uppy-ImageCropper .cropper-point {
  90. width: 8px;
  91. height: 8px;
  92. }
  93. .uppy-ImageCropper .cropper-view-box {
  94. outline: 2px solid #39f;
  95. // This adds a checkered background to transparent pngs
  96. // (see https://github.com/transloadit/uppy/pull/4194).
  97. // Cropper handles checkered bgs via the `background: true` option and a `.cropper-bg` css class, however those will span through the entire cropper background, and we only want the checkered background for transparent pngs.
  98. background: repeating-conic-gradient(
  99. rgba(189, 189, 189, 0.2) 0% 25%,
  100. white 0% 50%
  101. )
  102. 50% / 16px 16px;
  103. [data-uppy-theme='dark'] & {
  104. background: repeating-conic-gradient(rgb(43, 42, 42) 0% 25%, black 0% 50%)
  105. 50%/16px 16px;
  106. }
  107. }
  108. .uppy-ImageCropper .cropper-modal {
  109. opacity: 0.9;
  110. background-color: white;
  111. [data-uppy-theme='dark'] & {
  112. opacity: 0.7;
  113. background-color: black;
  114. }
  115. }
  116. .uppy-ImageCropper .cropper-face {
  117. opacity: 0;
  118. }
  119. // Overrides: inputrange.scss
  120. .uppy-ImageCropper-range {
  121. &::-moz-range-track {
  122. // We have to adjust this manually every time we change `$track-height`
  123. // in the beginning of the file.
  124. height: 4px;
  125. }
  126. &:focus,
  127. &:hover {
  128. &::-webkit-slider-runnable-track {
  129. background: rgba(white, 0.5);
  130. }
  131. &::-ms-fill-lower {
  132. background: rgba(white, 0.5);
  133. }
  134. &::-ms-fill-upper {
  135. background: rgba(white, 0.5);
  136. }
  137. &::-moz-range-track {
  138. background: rgba(white, 0.5);
  139. }
  140. }
  141. }