index.less 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @float-btn-prefix-cls: ~'@{ant-prefix}-float-btn';
  4. @float-btn-group-prefix-cls: ~'@{ant-prefix}-float-btn-group';
  5. .@{float-btn-prefix-cls} {
  6. position: fixed;
  7. z-index: 99;
  8. display: block;
  9. align-items: center;
  10. justify-content: center;
  11. width: 40px;
  12. height: 40px;
  13. overflow: hidden;
  14. border: none;
  15. box-shadow: @shadow-2;
  16. cursor: pointer;
  17. inset-inline-end: 24px;
  18. inset-block-end: 48px;
  19. &-hidden {
  20. display: none;
  21. }
  22. &-pure {
  23. position: relative;
  24. inset: auto;
  25. }
  26. &:empty {
  27. display: none;
  28. }
  29. &-body {
  30. display: flex;
  31. align-items: center;
  32. justify-content: center;
  33. width: 100%;
  34. height: 100%;
  35. transition: all 0.2s;
  36. .@{float-btn-prefix-cls}-content {
  37. display: flex;
  38. flex-direction: column;
  39. align-items: center;
  40. justify-content: center;
  41. min-height: 40px;
  42. padding: 2px @margin-xss;
  43. overflow: hidden;
  44. text-align: center;
  45. .@{float-btn-prefix-cls}-icon {
  46. width: 18px;
  47. margin: auto;
  48. font-size: @font-size-lg + 2px;
  49. line-height: 1;
  50. text-align: center;
  51. }
  52. }
  53. }
  54. }
  55. .@{float-btn-prefix-cls}-inner {
  56. display: block;
  57. width: 100%;
  58. height: 100%;
  59. margin: 0;
  60. padding: 0;
  61. list-style: none;
  62. border: none;
  63. }
  64. .@{float-btn-prefix-cls}-rtl {
  65. direction: rtl;
  66. }
  67. .@{float-btn-prefix-cls}-circle {
  68. height: 40px;
  69. border-radius: 50%;
  70. .@{float-btn-prefix-cls}-body {
  71. border-radius: 50%;
  72. }
  73. }
  74. .@{float-btn-prefix-cls}-square {
  75. height: auto;
  76. min-height: 40px;
  77. border-radius: @border-radius-base;
  78. .@{float-btn-prefix-cls}-body {
  79. height: auto;
  80. border-radius: @border-radius-base;
  81. }
  82. }
  83. .@{float-btn-prefix-cls}-default {
  84. background-color: @component-background;
  85. transition: background-color 0.2s;
  86. .@{float-btn-prefix-cls}-body {
  87. background-color: @component-background;
  88. transition: background-color 0.2s;
  89. &:hover {
  90. color: @text-color;
  91. background-color: @background-color-base;
  92. }
  93. .@{float-btn-prefix-cls}-content {
  94. .@{float-btn-prefix-cls}-icon {
  95. color: @text-color;
  96. }
  97. .@{float-btn-prefix-cls}-description {
  98. display: flex;
  99. align-items: center;
  100. color: @text-color;
  101. font-size: @font-size-sm;
  102. line-height: @line-height-base;
  103. }
  104. }
  105. }
  106. &:focus {
  107. color: @text-color;
  108. }
  109. }
  110. .@{float-btn-prefix-cls}-top {
  111. padding: 0 !important;
  112. }
  113. .@{float-btn-group-prefix-cls} {
  114. position: fixed;
  115. z-index: 99;
  116. display: block;
  117. box-sizing: border-box;
  118. width: 40px;
  119. height: auto;
  120. min-height: 40px;
  121. margin: 0;
  122. padding: 0;
  123. color: @text-color;
  124. font-size: @font-size-base;
  125. font-family: @font-family;
  126. line-height: @line-height-base;
  127. list-style: none;
  128. border: none;
  129. border-radius: @border-radius-base;
  130. box-shadow: none;
  131. inset-inline-end: 24px;
  132. inset-block-end: 48px;
  133. &-wrap {
  134. position: relative;
  135. z-index: -1;
  136. display: block;
  137. margin-bottom: @margin-md;
  138. }
  139. &-rtl {
  140. direction: rtl;
  141. }
  142. .@{float-btn-prefix-cls} {
  143. position: static;
  144. }
  145. &-circle {
  146. .@{float-btn-prefix-cls}-circle:not(:last-child) {
  147. margin-bottom: @margin-md;
  148. }
  149. .@{float-btn-prefix-cls}-body {
  150. width: 40px;
  151. height: 40px;
  152. }
  153. }
  154. &-square {
  155. .@{float-btn-prefix-cls}-square {
  156. padding: 0;
  157. border-radius: 0;
  158. &:first-child {
  159. border-start-start-radius: @border-radius-base;
  160. border-start-end-radius: @border-radius-base;
  161. }
  162. &:last-child {
  163. border-start-start-radius: @border-radius-base;
  164. border-start-end-radius: @border-radius-base;
  165. }
  166. &:not(:last-child) {
  167. border-bottom: 1px solid @border-color-base;
  168. }
  169. }
  170. .@{float-btn-group-prefix-cls}-wrap {
  171. display: block;
  172. overflow: hidden;
  173. border-radius: @border-radius-base;
  174. box-shadow: @shadow-2;
  175. .@{float-btn-prefix-cls}-square {
  176. margin-top: 0;
  177. padding: @padding-xss;
  178. border-radius: 0;
  179. box-shadow: none;
  180. &:first-child {
  181. border-start-start-radius: @border-radius-base;
  182. border-start-end-radius: @border-radius-base;
  183. }
  184. &:last-child {
  185. border-start-start-radius: @border-radius-base;
  186. border-start-end-radius: @border-radius-base;
  187. }
  188. &:not(:last-child) {
  189. border-bottom: @border-width-base @border-style-base @border-color-base;
  190. }
  191. .@{float-btn-prefix-cls}-body {
  192. width: 32px;
  193. height: 32px;
  194. }
  195. }
  196. }
  197. }
  198. &-circle-shadow {
  199. box-shadow: none;
  200. }
  201. &-square-shadow {
  202. box-shadow: @shadow-2;
  203. .@{float-btn-prefix-cls}-square {
  204. padding: @padding-xss;
  205. box-shadow: none;
  206. .@{float-btn-prefix-cls}-body {
  207. width: 32px;
  208. height: 32px;
  209. }
  210. }
  211. }
  212. }