_mixins.scss 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. @import '~bootstrap/scss/mixins';
  2. @mixin button-variant(
  3. $background,
  4. $border,
  5. $hover-background: darken($background, 7.5%),
  6. $hover-border: darken($border, 10%),
  7. $active-background: darken($background, 10%),
  8. $active-border: darken($border, 12.5%)
  9. ) {
  10. color: color-yiq($background);
  11. @include gradient-bg($background);
  12. border-color: $border;
  13. // @include box-shadow($btn-box-shadow);
  14. @if $background == $white {
  15. box-shadow: 3px 5px 0 $dark;
  16. }
  17. @include hover() {
  18. color: color-yiq($hover-background);
  19. @include gradient-bg($hover-background);
  20. border-color: $hover-border;
  21. @if $background == $white {
  22. background-color: $white;
  23. border-color: $dark;
  24. }
  25. }
  26. &:focus,
  27. &.focus {
  28. color: color-yiq($hover-background);
  29. @include gradient-bg($hover-background);
  30. border-color: $hover-border;
  31. @if $background == $white {
  32. background-color: $white;
  33. border-color: $dark;
  34. }
  35. }
  36. // Disabled comes first so active can properly restyle
  37. &.disabled,
  38. &:disabled {
  39. color: color-yiq($background);
  40. background-color: $background;
  41. border-color: $border;
  42. }
  43. &:not(:disabled):not(.disabled):active,
  44. &:not(:disabled):not(.disabled).active,
  45. .show > &.dropdown-toggle {
  46. color: color-yiq($active-background);
  47. background-color: $active-background;
  48. border-color: $active-border;
  49. &:focus {
  50. border-color: $hover-border;
  51. }
  52. }
  53. }
  54. @mixin dot-button-variant(
  55. $background,
  56. $border,
  57. $hover-background: darken($background, 7.5%),
  58. $hover-border: lighten($border, 5%),
  59. $active-background: $background,
  60. $active-border: $border
  61. ) {
  62. color: color-yiq($background);
  63. background-color: lighten($background, 15%);
  64. @if $background == $white {
  65. border-color: $black;
  66. border-width: 3px;
  67. } @else {
  68. border-color: lighten($border, 15%);
  69. }
  70. &:focus,
  71. &.focus {
  72. color: color-yiq($hover-background);
  73. @if $background == $white {
  74. border-color: $black;
  75. } @else {
  76. border-color: $hover-border;
  77. }
  78. }
  79. // Disabled comes first so active can properly restyle
  80. // &.disabled,
  81. // &:disabled {
  82. // color: color-yiq($background);
  83. // background-color: $background;
  84. // border-color: $border;
  85. // }
  86. &:not(:disabled):not(.disabled):active,
  87. &:not(:disabled):not(.disabled).active,
  88. .show > &.dropdown-toggle {
  89. color: color-yiq($active-background);
  90. background-color: $active-background;
  91. @if $background == $white {
  92. border-color: $black;
  93. } @else {
  94. border-color: $active-border;
  95. &:focus {
  96. border-color: $hover-border;
  97. }
  98. }
  99. }
  100. }
  101. // List Groups
  102. @mixin list-group-item-variant($state, $osef1, $osef2) {
  103. $color: theme-color($state);
  104. .list-group-item-#{$state} {
  105. color: darken($color, 32%);
  106. background-color: lighten($color, 3.25%);
  107. &.list-group-item-action {
  108. @include hover-focus() {
  109. color: darken($color, 40%);
  110. background-color: $color;
  111. }
  112. // &.active {
  113. // color: $white;
  114. // background-color: $color;
  115. // border-color: $color;
  116. // }
  117. }
  118. }
  119. }
  120. @mixin line-clamp($lines, $line-height) {
  121. display: block;
  122. display: -webkit-box;
  123. -webkit-line-clamp: $lines;
  124. -webkit-box-orient: vertical;
  125. max-height: $lines * $line-height;
  126. text-overflow: ellipsis;
  127. overflow: hidden;
  128. }