_mixins.scss 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. * General: Mixins
  3. * ---------------
  4. */
  5. // Cards Variant
  6. @mixin cards-variant($name, $color) {
  7. .card-#{$name} {
  8. &:not(.card-outline) {
  9. .card-header {
  10. background-color: $color;
  11. border-bottom: 0;
  12. &,
  13. a {
  14. color: color-yiq($color);
  15. }
  16. }
  17. }
  18. &.card-outline {
  19. border-top: 3px solid $color;
  20. }
  21. }
  22. .bg-#{$name},
  23. .bg-#{$name}-gradient,
  24. .card-#{$name}:not(.card-outline) {
  25. .btn-tool {
  26. color: rgba(color-yiq($color), 0.8);
  27. &:hover {
  28. color: color-yiq($color);
  29. }
  30. }
  31. }
  32. .card.bg-#{$name},
  33. .card.bg-#{$name}-gradient {
  34. .bootstrap-datetimepicker-widget {
  35. .table td,
  36. .table th {
  37. border: none;
  38. }
  39. table thead tr:first-child th:hover,
  40. table td.day:hover,
  41. table td.hour:hover,
  42. table td.minute:hover,
  43. table td.second:hover {
  44. background: darken($color, 8%);
  45. color: color-yiq($color);
  46. }
  47. table td.active,
  48. table td.active:hover {
  49. background: lighten($color, 10%);
  50. color: color-yiq($color);
  51. }
  52. }
  53. }
  54. }
  55. // Sidebar Color
  56. @mixin sidebar-color($color) {
  57. .nav-sidebar > .nav-item {
  58. & > .nav-link.active {
  59. background-color: $color;
  60. color: color-yiq($color);
  61. }
  62. }
  63. }
  64. @mixin navbar-variant($color, $font-color: rgba(255, 255, 255, 0.8), $hover-color: #f6f6f6, $hover-bg: rgba(0, 0, 0, 0.1)) {
  65. background-color: $color;
  66. .nav > li > a {
  67. color: $font-color;
  68. }
  69. .nav > li > a:hover,
  70. .nav > li > a:active,
  71. .nav > li > a:focus,
  72. .nav .open > a,
  73. .nav .open > a:hover,
  74. .nav .open > a:focus,
  75. .nav > .active > a {
  76. background: $hover-bg;
  77. color: $hover-color;
  78. }
  79. // Add color to the sidebar toggle button
  80. .sidebar-toggle {
  81. color: $font-color;
  82. &:hover,
  83. &:focus {
  84. background: $hover-bg;
  85. color: $hover-color;
  86. }
  87. }
  88. }
  89. // Logo color variation
  90. @mixin logo-variant($bg-color, $color: #fff, $border-bottom-color: transparent, $border-bottom-width: 0) {
  91. background-color: $bg-color;
  92. border-bottom: $border-bottom-width solid $border-bottom-color;
  93. color: $color;
  94. &:hover,
  95. &:focus {
  96. background-color: darken($bg-color, 1%);
  97. }
  98. }
  99. // Direct Chat Variant
  100. @mixin direct-chat-variant($bg-color, $color: #fff) {
  101. .right > .direct-chat-text {
  102. background: $bg-color;
  103. border-color: $bg-color;
  104. color: color-yiq($bg-color);
  105. &:after,
  106. &::before {
  107. border-left-color: $bg-color;
  108. }
  109. }
  110. }
  111. @mixin translate($x, $y) {
  112. transform: translate($x, $y);
  113. }
  114. // Different radius each side
  115. @mixin border-radius-sides($top-left, $top-right, $bottom-left, $bottom-right) {
  116. border-radius: $top-left $top-right $bottom-left $bottom-right;
  117. }
  118. @mixin calc($property, $expression) {
  119. #{$property}: -webkit-calc(#{$expression});
  120. #{$property}: calc(#{$expression});
  121. }
  122. @mixin rotate($value) {
  123. -ms-transform: rotate($value);
  124. transform: rotate($value);
  125. }
  126. @mixin animation($animation) {
  127. animation: $animation;
  128. }
  129. // Gradient background
  130. @mixin gradient($color: #F5F5F5, $start: #EEE, $stop: #FFF) {
  131. background: $color;
  132. background: -webkit-gradient(linear, left bottom, left top, color-stop(0, $start), color-stop(1, $stop));
  133. background: -ms-linear-gradient(bottom, $start, $stop);
  134. background: -moz-linear-gradient(center bottom, $start 0%, $stop 100%);
  135. background: -o-linear-gradient($stop, $start);
  136. }