index.less 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. @import "../styles/mixins/index.less";
  2. @import "../styles/themes/index.less";
  3. .fab-button-style(@theme, @color) {
  4. &--@{theme} &__action,
  5. &--@{theme} &__button,
  6. &--@{theme} &__button--disabled {
  7. background-color: @color !important;
  8. }
  9. }
  10. .@{wux-prefix}-fab-button {
  11. position: fixed;
  12. z-index: @z-index-fab-button;
  13. &--center {
  14. left: 50%;
  15. top: 50%;
  16. transform: translate3d(-50%, -50%, 0);
  17. }
  18. &--topLeft {
  19. left: 15px;
  20. top: 15px;
  21. }
  22. &--topRight {
  23. right: 15px;
  24. top: 15px;
  25. }
  26. &--bottomLeft {
  27. left: 15px;
  28. bottom: 15px;
  29. }
  30. &--bottomRight {
  31. right: 15px;
  32. bottom: 15px;
  33. }
  34. &--vertical&--topLeft &__label,
  35. &--vertical&--bottomLeft &__label {
  36. left: 60px;
  37. }
  38. &--vertical&--center &__label,
  39. &--vertical&--topRight &__label,
  40. &--vertical&--bottomRight &__label {
  41. right: 60px;
  42. }
  43. &__action {
  44. .square(@fab-button-action-size);
  45. position: relative;
  46. border-radius: 50%;
  47. z-index: @z-index-fab-button;
  48. background-color: @fab-button-balanced-bg;
  49. color: @text-color-inverse;
  50. overflow: visible;
  51. transition-duration: .3s;
  52. display: flex;
  53. align-items: center;
  54. justify-content: center;
  55. box-shadow: @fab-button-box-shadow;
  56. right: 0;
  57. bottom: 0;
  58. position: relative;
  59. &--hover {
  60. transition-duration: 0s;
  61. opacity: .8 !important;
  62. }
  63. &--hide-shadow {
  64. box-shadow: none !important;
  65. }
  66. }
  67. &__icon {
  68. display: inline-block;
  69. width: @fab-button-icon-size;
  70. height: @fab-button-icon-size;
  71. font-size: @fab-button-icon-size;
  72. line-height: 1;
  73. }
  74. &__text {
  75. display: inline-block;
  76. width: @fab-button-icon-size;
  77. height: @fab-button-icon-size;
  78. font-size: @fab-button-icon-size;
  79. line-height: 1;
  80. transition: transform 150ms cubic-bezier(0.4, 0, 1, 1);
  81. &--rotate {
  82. transform: scale(1) rotate(135deg);
  83. }
  84. }
  85. &__button {
  86. .button-reset();
  87. color: @text-color-inverse !important;
  88. border-radius: 50%;
  89. overflow: visible;
  90. background-color: @fab-button-balanced-bg !important;
  91. transition-duration: .3s;
  92. display: flex;
  93. align-items: center;
  94. justify-content: center;
  95. box-shadow: @fab-button-box-shadow;
  96. position: absolute;
  97. top: 0;
  98. left: 0;
  99. opacity: 0;
  100. z-index: 2;
  101. width: 100% !important;
  102. height: 100%;
  103. &--hover {
  104. transition-duration: 0s;
  105. opacity: .8 !important;
  106. }
  107. &--disabled {
  108. opacity: @disabled-opacity !important;
  109. }
  110. &--hide-shadow {
  111. box-shadow: none !important;
  112. }
  113. }
  114. &__label {
  115. position: absolute;
  116. top: 50%;
  117. padding: @fab-button-label-padding;
  118. font-size: @font-size-sm;
  119. background: @fab-button-label-bg;
  120. border-radius: @border-radius-base;
  121. color: @fab-button-label-color;
  122. pointer-events: none;
  123. white-space: nowrap;
  124. opacity: 0;
  125. box-sizing: border-box;
  126. transform: translate3d(0, -50%, 0);
  127. transition: all 0.3s;
  128. }
  129. &--vertical&--opened &__label {
  130. opacity: 1;
  131. }
  132. &__backdrop {
  133. position: fixed;
  134. z-index: @z-index-backdrop;
  135. top: 0;
  136. right: 0;
  137. left: 0;
  138. bottom: 0;
  139. background: @backdrop-background-inverse;
  140. }
  141. .fab-button-style(light, @fab-button-light-bg);
  142. .fab-button-style(stable, @fab-button-stable-bg);
  143. .fab-button-style(positive, @fab-button-positive-bg);
  144. .fab-button-style(calm, @fab-button-calm-bg);
  145. .fab-button-style(assertive, @fab-button-assertive-bg);
  146. .fab-button-style(balanced, @fab-button-balanced-bg);
  147. .fab-button-style(energized, @fab-button-energized-bg);
  148. .fab-button-style(royal, @fab-button-royal-bg);
  149. .fab-button-style(dark, @fab-button-dark-bg);
  150. }