_buttons.scss 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. //
  2. // Component: Button
  3. //
  4. .btn {
  5. &.disabled,
  6. &:disabled {
  7. cursor: not-allowed;
  8. }
  9. // Flat buttons
  10. &.btn-flat {
  11. @include border-radius(0);
  12. border-width: 1px;
  13. box-shadow: none;
  14. }
  15. // input file btn
  16. &.btn-file {
  17. overflow: hidden;
  18. position: relative;
  19. > input[type="file"] {
  20. background-color: $white;
  21. cursor: inherit;
  22. display: block;
  23. font-size: 100px;
  24. min-height: 100%;
  25. min-width: 100%;
  26. opacity: 0;
  27. outline: none;
  28. position: absolute;
  29. right: 0;
  30. text-align: right;
  31. top: 0;
  32. }
  33. }
  34. .text-sm & {
  35. font-size: $font-size-sm !important;
  36. }
  37. }
  38. // Button color variations
  39. .btn-default {
  40. background-color: $button-default-background-color;
  41. border-color: $button-default-border-color;
  42. color: $button-default-color;
  43. &:hover,
  44. &:active,
  45. &.hover {
  46. background-color: darken($button-default-background-color, 5%);
  47. color: darken($button-default-color, 10%);
  48. }
  49. &.disabled,
  50. &:disabled {
  51. color: $button-default-color;
  52. background-color: $button-default-background-color;
  53. }
  54. }
  55. .btn-outline-light {
  56. color: darken($light, 20%);
  57. border-color: darken($light, 20%);
  58. &.disabled,
  59. &:disabled {
  60. color: darken($light, 20%);
  61. border-color: darken($light, 20%);
  62. }
  63. }
  64. // Application buttons
  65. .btn-app {
  66. @include border-radius(3px);
  67. background-color: $button-default-background-color;
  68. border: 1px solid $button-default-border-color;
  69. color: $gray-600;
  70. font-size: 12px;
  71. height: 60px;
  72. margin: 0 0 10px 10px;
  73. min-width: 80px;
  74. padding: 15px 5px;
  75. position: relative;
  76. text-align: center;
  77. /* stylelint-disable selector-class-pattern */
  78. // Icons within the btn
  79. > .fa,
  80. > .fas,
  81. > .far,
  82. > .fab,
  83. > .fal,
  84. > .fad,
  85. > .svg-inline--fa,
  86. > .ion {
  87. display: block;
  88. font-size: 20px;
  89. }
  90. > .svg-inline--fa {
  91. margin: 0 auto;
  92. }
  93. /* stylelint-enable selector-class-pattern */
  94. &:hover {
  95. background-color: $button-default-background-color;
  96. border-color: darken($button-default-border-color, 20%);
  97. color: $button-default-color;
  98. }
  99. &:active,
  100. &:focus {
  101. @include box-shadow(inset 0 3px 5px rgba($black, .125));
  102. }
  103. // The badge
  104. > .badge {
  105. font-size: 10px;
  106. font-weight: 400;
  107. position: absolute;
  108. right: -10px;
  109. top: -3px;
  110. }
  111. }
  112. // Extra Button Size
  113. .btn-xs {
  114. @include button-size($button-padding-y-xs, $button-padding-x-xs, $button-font-size-xs, $button-line-height-xs, $button-border-radius-xs);
  115. }
  116. @include dark-mode () {
  117. .btn-default,
  118. .btn-app {
  119. background-color: lighten($dark, 2.5%);
  120. color: $white;
  121. border-color: $gray-600;
  122. &:hover,
  123. &:focus {
  124. background-color: lighten($dark, 5%);
  125. color: $gray-300;
  126. border-color: lighten($gray-600, 2.5%);
  127. }
  128. }
  129. .btn-light {
  130. background-color: lighten($dark, 7.5%);
  131. color: $white;
  132. border-color: $gray-600;
  133. &:hover,
  134. &:focus {
  135. background-color: lighten($dark, 10%);
  136. color: $gray-300;
  137. border-color: lighten($gray-600, 5%);
  138. }
  139. }
  140. @each $color, $value in $theme-colors-alt {
  141. .btn-#{$color} {
  142. @if $color == dark {
  143. @include button-variant(darken($value, 5%), lighten($value, 10%));
  144. } @else {
  145. @include button-variant($value, $value);
  146. }
  147. }
  148. }
  149. @each $color, $value in $theme-colors-alt {
  150. .btn-outline-#{$color} {
  151. @if $color == dark {
  152. @include button-outline-variant(darken($value, 20%));
  153. } @else {
  154. @include button-outline-variant($value);
  155. }
  156. }
  157. }
  158. }