3afb3fdd9d62af74a4b756fc3df96252c98e796dbcf9168d56a1f75b0fb3d76ccf8fc1f1c375cc4db07c2e0d949756c2128e89170cb03535c7ff0c54d19033 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. @use 'mixins/mixins' as *;
  2. @use 'mixins/var' as *;
  3. @use 'common/var' as *;
  4. $directions: rtl, ltr, ttb, btt;
  5. .#{$namespace}-overlay.is-drawer {
  6. overflow: hidden;
  7. }
  8. @include b(drawer) {
  9. @include set-component-css-var('drawer', $drawer);
  10. }
  11. @include b(drawer) {
  12. position: absolute;
  13. box-sizing: border-box;
  14. background-color: getCssVar('drawer', 'bg-color');
  15. display: flex;
  16. flex-direction: column;
  17. box-shadow: getCssVar('box-shadow', 'dark');
  18. transition: all getCssVar('transition-duration');
  19. @each $direction in $directions {
  20. .#{$direction} {
  21. transform: translate(0, 0);
  22. }
  23. }
  24. &__sr-focus:focus {
  25. outline: none !important;
  26. }
  27. &__header {
  28. align-items: center;
  29. color: getCssVar('text-color', 'primary');
  30. display: flex;
  31. margin-bottom: 32px;
  32. padding: getCssVar('drawer-padding-primary');
  33. padding-bottom: 0;
  34. overflow: hidden;
  35. & > :first-child {
  36. flex: 1;
  37. }
  38. }
  39. &__title {
  40. margin: 0;
  41. flex: 1;
  42. line-height: inherit;
  43. font-size: 16px;
  44. }
  45. @include e(footer) {
  46. padding: getCssVar('drawer-padding-primary');
  47. padding-top: 10px;
  48. text-align: right;
  49. overflow: hidden;
  50. }
  51. &__close-btn {
  52. display: inline-flex;
  53. border: none;
  54. cursor: pointer;
  55. font-size: getCssVar('font-size-extra-large');
  56. color: inherit;
  57. background-color: transparent;
  58. outline: none;
  59. &:focus,
  60. &:hover {
  61. i {
  62. color: getCssVar('color-primary');
  63. }
  64. }
  65. }
  66. &__body {
  67. flex: 1;
  68. padding: getCssVar('drawer-padding-primary');
  69. overflow: auto;
  70. & > * {
  71. box-sizing: border-box;
  72. }
  73. }
  74. @include when(dragging) {
  75. transition: none;
  76. }
  77. @include e(dragger) {
  78. position: absolute;
  79. background-color: transparent;
  80. user-select: none;
  81. transition: all 0.2s;
  82. &::before {
  83. content: '';
  84. position: absolute;
  85. background-color: transparent;
  86. transition: all 0.2s;
  87. }
  88. &:hover::before {
  89. background-color: getCssVar('color-primary');
  90. }
  91. }
  92. &.ltr,
  93. &.rtl {
  94. height: 100%;
  95. top: 0;
  96. bottom: 0;
  97. > .#{$namespace}-drawer__dragger {
  98. height: 100%;
  99. width: getCssVar('drawer-dragger-size');
  100. top: 0;
  101. bottom: 0;
  102. cursor: ew-resize;
  103. &::before {
  104. top: 0;
  105. bottom: 0;
  106. width: 3px;
  107. }
  108. }
  109. }
  110. &.ttb,
  111. &.btt {
  112. width: 100%;
  113. left: 0;
  114. right: 0;
  115. > .#{$namespace}-drawer__dragger {
  116. width: 100%;
  117. height: getCssVar('drawer-dragger-size');
  118. left: 0;
  119. right: 0;
  120. cursor: ns-resize;
  121. &::before {
  122. left: 0;
  123. right: 0;
  124. height: 3px;
  125. }
  126. }
  127. }
  128. &.ltr {
  129. left: 0;
  130. > .#{$namespace}-drawer__dragger {
  131. right: 0;
  132. &::before {
  133. right: -2px;
  134. }
  135. }
  136. }
  137. &.rtl {
  138. right: 0;
  139. > .#{$namespace}-drawer__dragger {
  140. left: 0;
  141. &::before {
  142. left: -2px;
  143. }
  144. }
  145. }
  146. &.ttb {
  147. top: 0;
  148. > .#{$namespace}-drawer__dragger {
  149. bottom: 0;
  150. &::before {
  151. bottom: -2px;
  152. }
  153. }
  154. }
  155. &.btt {
  156. bottom: 0;
  157. > .#{$namespace}-drawer__dragger {
  158. top: 0;
  159. &::before {
  160. top: -2px;
  161. }
  162. }
  163. }
  164. }
  165. .#{$namespace}-drawer-fade {
  166. &-enter-active,
  167. &-leave-active {
  168. transition: all getCssVar('transition-duration');
  169. }
  170. &-enter-from,
  171. &-enter-active,
  172. &-enter-to,
  173. &-leave-from,
  174. &-leave-active,
  175. &-leave-to {
  176. overflow: hidden !important;
  177. }
  178. &-enter-from,
  179. &-leave-to {
  180. background-color: transparent !important;
  181. }
  182. &-enter-from,
  183. &-leave-to {
  184. @each $direction in $directions {
  185. .#{$direction} {
  186. @if $direction == ltr {
  187. transform: translateX(-100%);
  188. }
  189. @if $direction == rtl {
  190. transform: translateX(100%);
  191. }
  192. @if $direction == ttb {
  193. transform: translateY(-100%);
  194. }
  195. @if $direction == btt {
  196. transform: translateY(100%);
  197. }
  198. }
  199. }
  200. }
  201. }