rtl.less 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @switch-prefix-cls: ~'@{ant-prefix}-switch';
  4. @switch-pin-size: @switch-height - 4px;
  5. @switch-sm-pin-size: @switch-sm-height - 4px;
  6. .@{switch-prefix-cls}-rtl {
  7. direction: rtl;
  8. .@{switch-prefix-cls}-inner {
  9. margin: 0 @switch-inner-margin-max 0 @switch-inner-margin-min;
  10. }
  11. .@{switch-prefix-cls}-handle {
  12. right: @switch-padding;
  13. left: auto;
  14. }
  15. &:not(&-disabled):active {
  16. .@{switch-prefix-cls}-handle::before {
  17. right: 0;
  18. left: -30%;
  19. }
  20. &.@{switch-prefix-cls}-checked {
  21. .@{switch-prefix-cls}-handle::before {
  22. right: -30%;
  23. left: 0;
  24. }
  25. }
  26. }
  27. &.@{switch-prefix-cls}-checked {
  28. .@{switch-prefix-cls}-inner {
  29. margin: 0 @switch-inner-margin-min 0 @switch-inner-margin-max;
  30. }
  31. .@{switch-prefix-cls}-handle {
  32. right: calc(100% - @switch-pin-size - @switch-padding);
  33. }
  34. }
  35. &.@{switch-prefix-cls}-small {
  36. &.@{switch-prefix-cls}-checked {
  37. .@{switch-prefix-cls}-handle {
  38. right: calc(100% - @switch-sm-pin-size - @switch-padding);
  39. }
  40. }
  41. }
  42. }