Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

_button-group.scss 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. // Button groups
  2. // *******************************************************************************
  3. .btn-group {
  4. --#{$prefix}btn-group-border-radius: #{$btn-border-radius};
  5. &.btn-group-sm {
  6. --#{$prefix}btn-group-border-radius: #{$btn-border-radius-sm};
  7. }
  8. &.btn-group-xs {
  9. --#{$prefix}btn-group-border-radius: #{$btn-border-radius-xs};
  10. }
  11. &.btn-group-lg {
  12. --#{$prefix}btn-group-border-radius: #{$btn-border-radius-lg};
  13. }
  14. &.btn-group-xl {
  15. --#{$prefix}btn-group-border-radius: #{$btn-border-radius-xl};
  16. }
  17. > :not(.btn-check:first-child) + .btn,
  18. > .btn-group:not(:first-child) {
  19. margin: 0;
  20. margin-inline-start: calc(#{$btn-border-width} * -1);
  21. }
  22. &:not(.btn-group-vertical) {
  23. > .btn:not(:last-child):not(.dropdown-toggle),
  24. > .btn.dropdown-toggle-split:first-child,
  25. > .btn-group:not(:last-child) > .btn,
  26. > .btn:nth-child(n + 3),
  27. > :not(.btn-check) + .btn,
  28. > .btn-group:not(:first-child) > .btn {
  29. @include border-radius(var(--#{$prefix}btn-group-border-radius));
  30. }
  31. > .btn:not(:last-child):not(.dropdown-toggle),
  32. > .btn.dropdown-toggle-split:first-child,
  33. > .btn-group:not(:last-child) > .btn {
  34. border-end-end-radius: 0 !important;
  35. border-start-end-radius: 0 !important;
  36. }
  37. > .btn:nth-child(n + 3),
  38. > :not(.btn-check) + .btn,
  39. > .btn-group:not(:first-child) > .btn {
  40. border-end-start-radius: 0 !important;
  41. border-start-start-radius: 0 !important;
  42. }
  43. }
  44. &.btn-group-vertical {
  45. > :not(.btn-check:first-child) + .btn,
  46. > .btn-group:not(:first-child) {
  47. margin: 0;
  48. margin-block-start: calc(#{$btn-border-width} * -1);
  49. }
  50. .btn:not([class*="btn-outline-"]) {
  51. border-inline-color: var(--#{$prefix}btn-bg);
  52. &:hover {
  53. border-inline-color: var(--#{$prefix}btn-hover-bg);
  54. }
  55. }
  56. > .btn:first-child,
  57. > .btn.dropdown-toggle-split:first-child,
  58. > .btn-group:first-child > .btn {
  59. @include border-top-radius(var(--#{$prefix}btn-group-border-radius));
  60. }
  61. > .btn:last-child,
  62. > .btn.dropdown-toggle-split:last-child,
  63. > .btn-group:last-child > .btn {
  64. @include border-bottom-radius(var(--#{$prefix}btn-group-border-radius));
  65. }
  66. }
  67. }
  68. // Split button
  69. // *******************************************************************************
  70. .dropdown-toggle-split,
  71. .btn-lg + .dropdown-toggle-split,
  72. .btn-group-lg > .btn + .dropdown-toggle-split,
  73. .input-group-lg .btn + .dropdown-toggle-split,
  74. .btn-xl + .dropdown-toggle-split,
  75. .btn-group-xl > .btn + .dropdown-toggle-split {
  76. padding-inline: .92em;
  77. }
  78. .btn-sm + .dropdown-toggle-split,
  79. .btn-group-sm > .btn + .dropdown-toggle-split,
  80. .input-group-sm .btn + .dropdown-toggle-split {
  81. padding-inline: .6em;
  82. }
  83. .btn-xs + .dropdown-toggle-split,
  84. .btn-group-xs > .btn + .dropdown-toggle-split {
  85. padding-inline: .5em;
  86. }
  87. // Sizing
  88. // *******************************************************************************
  89. .btn-group-xs > .btn {
  90. @extend .btn-xs;
  91. }
  92. .btn-group-xl > .btn {
  93. @extend .btn-xl;
  94. }
  95. /* Button groups border */
  96. .btn-group:not(.btn-group-vertical) > .btn-group:first-child > .btn:not([class*="btn-outline-"]):first-child,
  97. .input-group > .btn:not([class*="btn-outline-"]):first-child,
  98. :not(.btn-group, .input-group) > .btn-group:not(.btn-group-vertical) > .btn:not([class*="btn-outline-"]):first-child,
  99. .input-group > .btn-group:first-child > .btn:not([class*="btn-outline-"]):first-child {
  100. border-inline-start-color: transparent;
  101. }
  102. .btn-group:not(.btn-group-vertical) > .btn-group:last-child > .btn:not([class*="btn-outline-"]):last-of-type,
  103. .input-group > .btn:not([class*="btn-outline-"]):last-of-type,
  104. :not(.btn-group, .input-group) > .btn-group:not(.btn-group-vertical) > .btn:not([class*="btn-outline-"]):last-of-type,
  105. .input-group > .btn-group:last-child > .btn:not([class*="btn-outline-"]):last-of-type {
  106. border-inline-end-color: transparent;
  107. }
  108. .btn-group-vertical > .btn-group-vertical:first-child > .btn:not([class*="btn-outline-"]):first-child,
  109. :not(.btn-group-vertical, .input-group) > .btn-group-vertical > .btn:not([class*="btn-outline-"]):first-child {
  110. border-block-start-color: transparent;
  111. }
  112. .btn-group-vertical > .btn-group-vertical:last-child > .btn:not([class*="btn-outline-"]):last-of-type,
  113. :not(.btn-group-vertical, .input-group) > .btn-group-vertical > .btn:not([class*="btn-outline-"]):last-of-type {
  114. border-block-end-color: transparent;
  115. }