智慧水务管理系统 - 精河县供水工程综合管理平台

button-group.scss 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. @use 'sass:map';
  2. @use 'common/var' as *;
  3. @use 'mixins/mixins' as *;
  4. @use 'mixins/utils' as *;
  5. @include b(button-group) {
  6. & > .#{$namespace}-button {
  7. & + .#{$namespace}-button {
  8. margin-left: 0;
  9. }
  10. &:first-child:last-child {
  11. border-top-right-radius: map.get($button-border-radius, 'default');
  12. border-bottom-right-radius: map.get($button-border-radius, 'default');
  13. border-top-left-radius: map.get($button-border-radius, 'default');
  14. border-bottom-left-radius: map.get($button-border-radius, 'default');
  15. &.is-round {
  16. border-radius: getCssVar('border-radius', 'round');
  17. }
  18. &.is-circle {
  19. border-radius: 50%;
  20. }
  21. }
  22. &:not(:first-child):not(:last-child) {
  23. border-radius: 0;
  24. }
  25. &:hover,
  26. &:focus,
  27. &:active {
  28. z-index: 1;
  29. }
  30. @include when(active) {
  31. z-index: 1;
  32. }
  33. }
  34. @include m('horizontal') {
  35. display: inline-block;
  36. vertical-align: middle;
  37. @include utils-clearfix;
  38. & > .#{$namespace}-button {
  39. float: left;
  40. position: relative;
  41. &:first-child {
  42. border-top-right-radius: 0;
  43. border-bottom-right-radius: 0;
  44. }
  45. &:last-child {
  46. border-top-left-radius: 0;
  47. border-bottom-left-radius: 0;
  48. }
  49. &:not(:last-child) {
  50. margin-right: -1px;
  51. }
  52. }
  53. @each $type in (primary, success, warning, danger, info) {
  54. .#{$namespace}-button--#{$type} {
  55. &:first-child {
  56. border-right-color: getCssVar('button', 'divide-border-color');
  57. }
  58. &:last-child {
  59. border-left-color: getCssVar('button', 'divide-border-color');
  60. }
  61. &:not(:first-child):not(:last-child) {
  62. border-left-color: getCssVar('button', 'divide-border-color');
  63. border-right-color: getCssVar('button', 'divide-border-color');
  64. }
  65. }
  66. }
  67. & > .#{$namespace}-dropdown {
  68. & > .#{$namespace}-button {
  69. border-top-left-radius: 0;
  70. border-bottom-left-radius: 0;
  71. border-left-color: getCssVar('button', 'divide-border-color');
  72. }
  73. }
  74. }
  75. @include m('vertical') {
  76. display: inline-flex;
  77. flex-direction: column;
  78. align-items: stretch;
  79. & > .#{$namespace}-button {
  80. margin-top: -1px;
  81. &:first-child {
  82. border-bottom-left-radius: 0;
  83. border-bottom-right-radius: 0;
  84. }
  85. &:last-child {
  86. border-top-left-radius: 0;
  87. border-top-right-radius: 0;
  88. }
  89. }
  90. & > .#{$namespace}-dropdown {
  91. margin-top: -1px;
  92. & > .#{$namespace}-button {
  93. border-top-left-radius: 0;
  94. border-top-right-radius: 0;
  95. border-left-color: getCssVar('button', 'divide-border-color');
  96. }
  97. }
  98. @each $type in (primary, success, warning, danger, info) {
  99. .#{$namespace}-button--#{$type} {
  100. &:first-child {
  101. border-bottom-color: getCssVar('button', 'divide-border-color');
  102. }
  103. &:last-child {
  104. border-top-color: getCssVar('button', 'divide-border-color');
  105. }
  106. &:not(:first-child):not(:last-child) {
  107. border-top-color: getCssVar('button', 'divide-border-color');
  108. border-bottom-color: getCssVar('button', 'divide-border-color');
  109. }
  110. }
  111. }
  112. }
  113. }