_buttons.scss 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. .btn {
  2. margin-bottom: $btn-margin-bottom;
  3. letter-spacing: $a-letter-spacing;
  4. text-transform: uppercase;
  5. box-shadow: $btn-box-shadow;
  6. background-size: $btn-background-size;
  7. background-position-x: $btn-background-position-x;
  8. &:not([class*="btn-outline-"]) {
  9. border: 0;
  10. }
  11. &:active,
  12. &:active:focus,
  13. &:active:hover {
  14. box-shadow: $btn-hover-box-shadow;
  15. transform: $btn-active-hover-transform;
  16. opacity: $btn-hover-opacity;
  17. }
  18. @include hover {
  19. &:not(.btn-icon-only){
  20. box-shadow: $btn-hover-box-shadow;
  21. transform: $btn-hover-transform;
  22. }
  23. }
  24. &.bg-white {
  25. @include hover {
  26. color: $body-color;
  27. }
  28. }
  29. &.btn-link{
  30. box-shadow: none;
  31. font-weight: $btn-font-weight;
  32. &:hover,
  33. &:focus{
  34. box-shadow: none;
  35. }
  36. }
  37. &.btn-round {
  38. border-radius: $btn-border-rounded;
  39. }
  40. // Button Just Icon
  41. &.btn-icon-only {
  42. width: $btn-just-icon-width;
  43. height: $btn-just-icon-height;
  44. padding: $btn-just-icon-padding-y $btn-just-icon-padding-x;
  45. }
  46. // Button Icon Sizes
  47. &.btn-sm {
  48. &.btn-icon-only {
  49. width: $btn-just-icon-width-sm;
  50. height: $btn-just-icon-height-sm;
  51. padding: $btn-just-icon-padding-y-sm $btn-just-icon-padding-x-sm;
  52. }
  53. i {
  54. font-size: $btn-just-icon-sm-font-size;
  55. }
  56. }
  57. &.btn-lg {
  58. &.btn-icon-only {
  59. width: $btn-just-icon-width-lg;
  60. height: $btn-just-icon-height-lg;
  61. padding: $btn-just-icon-padding-y-lg $btn-just-icon-padding-x-lg;
  62. }
  63. i {
  64. font-size: $btn-just-icon-lg-font-size;
  65. position: $btn-just-icon-lg-position;
  66. top: $btn-just-icon-lg-top;
  67. }
  68. }
  69. &.btn-rounded {
  70. border-radius: $btn-border-rounded;
  71. }
  72. &.btn-transparent {
  73. appearance: none;
  74. -moz-appearance: none;
  75. -webkit-appearance: none;
  76. }
  77. }
  78. .btn-check{
  79. &:checked{
  80. +.btn{
  81. svg{
  82. .color-background{
  83. fill: $white;
  84. }
  85. }
  86. &:hover{
  87. svg{
  88. .color-background{
  89. fill: $dark;
  90. }
  91. }
  92. }
  93. }
  94. }
  95. }
  96. .icon-move-right {
  97. i {
  98. transition: $btn-icon-transition;
  99. }
  100. &:hover,
  101. &:focus {
  102. i {
  103. transform: $btn-icon-transform-right;
  104. }
  105. }
  106. }
  107. .icon-move-left{
  108. i {
  109. transition: $btn-icon-transition;
  110. }
  111. &:hover,
  112. &:focus {
  113. i {
  114. transform: $btn-icon-transform-left;
  115. }
  116. }
  117. }
  118. @each $color, $value in $theme-colors {
  119. .btn-#{$color},
  120. .btn.bg-gradient-#{$color} {
  121. @include hover {
  122. background-color: $value;
  123. border-color: $value;
  124. }
  125. .btn.bg-outline-#{$color} {
  126. border: $border-width solid $value;
  127. }
  128. &:not(:disabled):not(.disabled).active,
  129. &:not(:disabled):not(.disabled):active,
  130. .show > &.dropdown-toggle {
  131. color: color-yiq($value);
  132. background-color: $value;
  133. }
  134. @if $value != $white and $value != $light {
  135. &.focus,
  136. &:focus {
  137. color: $white;
  138. }
  139. }
  140. }
  141. // .btn-#{$color},
  142. // .btn.bg-gradient-#{$color}{
  143. // &:focus{
  144. // box-shadow: 0 0 0 3px rgba($value,.5);
  145. // }
  146. // }
  147. .btn-outline-#{$color} {
  148. box-shadow: none;
  149. @include hover {
  150. &:not(.active){
  151. background-color: transparent;
  152. opacity: .75;
  153. box-shadow: none;
  154. color: $value;
  155. }
  156. }
  157. }
  158. }
  159. .btn-outline-white{
  160. border-color: rgba($white, .75);
  161. background: rgba($white, .1);
  162. }
  163. @each $color, $value in $btn-font-colors {
  164. .btn-#{$color},
  165. .btn.bg-gradient-#{$color} {
  166. color: $value;
  167. @include hover {
  168. color: $value;
  169. }
  170. }
  171. }
  172. // buttons box-shadow
  173. @each $color, $value in $theme-colors {
  174. .btn-#{$color},
  175. .btn.bg-gradient-#{$color}{
  176. //box-shadow: $btn-box-shadow-values rgba($value, .2);
  177. @include hover {
  178. //box-shadow: $btn-box-shadow-hover-values rgba($value, .2);
  179. }
  180. }
  181. }