_mixins.scss 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. // AdminLTE mixins
  2. // ===============
  3. // Changes the color and the hovering properties of the navbar
  4. @mixin navbar-variant($color, $font-color: rgba(255, 255, 255, 0.8), $hover-color: #f6f6f6, $hover-bg: rgba(0, 0, 0, 0.1)) {
  5. background-color: $color;
  6. // Navbar links
  7. .nav > li > a {
  8. color: $font-color;
  9. }
  10. .nav > li > a:hover,
  11. .nav > li > a:active,
  12. .nav > li > a:focus,
  13. .nav .open > a,
  14. .nav .open > a:hover,
  15. .nav .open > a:focus,
  16. .nav > .active > a {
  17. background: $hover-bg;
  18. color: $hover-color;
  19. }
  20. // Add color to the sidebar toggle button
  21. .sidebar-toggle {
  22. color: $font-color;
  23. &:hover {
  24. color: $hover-color;
  25. background: $hover-bg;
  26. }
  27. }
  28. }
  29. // Logo color variation
  30. @mixin logo-variant($bg-color, $color: #fff, $border-bottom-color: transparent, $border-bottom-width: 0) {
  31. background-color: $bg-color;
  32. color: $color;
  33. border-bottom: $border-bottom-width solid $border-bottom-color;
  34. &:hover {
  35. background-color: darken($bg-color, 1%);
  36. }
  37. }
  38. // Box solid color variantion creator
  39. @mixin box-solid-variant($color, $text-color: #fff) {
  40. border: 1px solid $color;
  41. > .box-header {
  42. color: $text-color;
  43. background: $color;
  44. background-color: $color;
  45. a,
  46. .btn {
  47. color: $text-color;
  48. }
  49. }
  50. }
  51. // Direct Chat Variant
  52. @mixin direct-chat-variant($bg-color, $color: #fff) {
  53. .right > .direct-chat-text {
  54. background: $bg-color;
  55. border-color: $bg-color;
  56. color: $color;
  57. &:after,
  58. &:before {
  59. border-left-color: $bg-color;
  60. }
  61. }
  62. }
  63. @mixin translate($x, $y) {
  64. -webkit-transform: translate($x, $y);
  65. -ms-transform: translate($x, $y); // IE9 only
  66. transform: translate($x, $y);
  67. }
  68. // Different radius each side
  69. @mixin border-radius-sides($top-left, $top-right, $bottom-left, $bottom-right) {
  70. border-radius: $top-left $top-right $bottom-left $bottom-right;
  71. }
  72. @mixin calc($property, $expression) {
  73. #{$property}: -webkit-calc(#{$expression});
  74. #{$property}: calc(#{$expression});
  75. }
  76. @mixin rotate($value) {
  77. -ms-transform: rotate($value);
  78. transform: rotate($value);
  79. }
  80. @mixin animation($animation) {
  81. animation: $animation;
  82. }
  83. // Gradient background
  84. @mixin gradient($color: #F5F5F5, $start: #EEE, $stop: #FFF) {
  85. background: $color;
  86. background: -webkit-gradient(linear, left bottom, left top, color-stop(0, $start), color-stop(1, $stop));
  87. background: -ms-linear-gradient(bottom, $start, $stop);
  88. background: -moz-linear-gradient(center bottom, $start 0%, $stop 100%);
  89. background: -o-linear-gradient($stop, $start);
  90. }
  91. // Skins Mixins
  92. // Dark Sidebar Mixin
  93. @mixin skin-dark-sidebar($link-hover-border-color) {
  94. // Sidebar background color (Both .wrapper and .left-side are responsible for sidebar bg color)
  95. .main-sidebar,
  96. .main-sidebar:before {
  97. background-color: $sidebar-dark-bg;
  98. }
  99. // User Panel (resides in the sidebar)
  100. .user-panel {
  101. .info,
  102. .status {
  103. color: #fff;
  104. }
  105. .status {
  106. color: $sidebar-dark-color;
  107. background: $sidebar-dark-hover-bg;
  108. &:hover,
  109. &:focus,
  110. &:active {
  111. color: $sidebar-dark-hover-color;
  112. background: darken($sidebar-dark-hover-bg, 3%);
  113. }
  114. }
  115. .dropdown-menu {
  116. border-color: darken($sidebar-dark-hover-bg, 5%);
  117. @include box-shadow(0 2px 4px rgba(0, 0, 0, .4));
  118. }
  119. .dropdown-item {
  120. color: $body-color;
  121. }
  122. }
  123. // Sidebar Menu. First level links
  124. .nav-sidebar > .nav-item {
  125. // links
  126. > .nav-link {
  127. border-left: 3px solid transparent;
  128. &:active,
  129. &:focus {
  130. color: $sidebar-dark-color;
  131. }
  132. }
  133. // Hover and active states
  134. &.menu-open > .nav-link,
  135. &:hover > .nav-link,
  136. > .nav-link.active {
  137. color: $sidebar-dark-hover-color;
  138. background: $sidebar-dark-hover-bg;
  139. }
  140. > .nav-link.active {
  141. border-left-color: $link-hover-border-color;
  142. }
  143. // First Level Submenu
  144. > .nav-treeview {
  145. margin: 0 1px;
  146. background: $sidebar-dark-submenu-bg;
  147. }
  148. }
  149. // Section Heading
  150. .nav-header {
  151. color: darken($sidebar-dark-color, 20%);
  152. background: inherit; //darken($sidebar-dark-bg, 3%);
  153. }
  154. // All links within the sidebar menu
  155. .sidebar a {
  156. color: $sidebar-dark-color;
  157. &:hover {
  158. text-decoration: none;
  159. }
  160. }
  161. // All submenus
  162. .nav-treeview {
  163. > .nav-item {
  164. > .nav-link {
  165. color: $sidebar-dark-submenu-color;
  166. }
  167. > .nav-link.active,
  168. > .nav-link:hover {
  169. color: $sidebar-dark-submenu-hover-color;
  170. background: transparent;
  171. }
  172. }
  173. }
  174. // Sidebar form
  175. .sidebar-form {
  176. .form-control {
  177. background: $sidebar-dark-submenu-bg;
  178. border: 0;
  179. &,
  180. &:focus + .form-icon {
  181. color: $sidebar-dark-hover-color;
  182. }
  183. &:focus {
  184. background: lighten($sidebar-dark-submenu-bg, 7%);
  185. }
  186. }
  187. .form-icon {
  188. color: $sidebar-dark-color;
  189. }
  190. }
  191. }
  192. // Light Sidebar Mixin
  193. @mixin skin-light-sidebar($icon-active-color) {
  194. // Sidebar background color
  195. .main-sidebar,
  196. .main-sidebar:before {
  197. background-color: $sidebar-light-bg;
  198. }
  199. .content-wrapper,
  200. .main-footer {
  201. border-left: 1px solid $gray-500;
  202. }
  203. // User Panel (resides in the sidebar)
  204. .user-panel {
  205. > .info,
  206. > .info > .nav-link {
  207. color: $sidebar-light-color;
  208. }
  209. }
  210. // Sidebar Menu. First level links
  211. .sidebar-menu > .nav-item {
  212. transition: border-left-color .3s ease;
  213. // links
  214. > .nav-link {
  215. border-left: 3px solid transparent;
  216. font-weight: 600;
  217. &:focus {
  218. color: $sidebar-light-color;
  219. }
  220. }
  221. // Hover and active states
  222. &:hover > .nav-link,
  223. &.active > .nav-link {
  224. color: $sidebar-light-hover-color;
  225. background: $sidebar-light-hover-bg;
  226. }
  227. &:hover > .nav-link {
  228. }
  229. &.active {
  230. border-left-color: $icon-active-color;
  231. > .nav-link {
  232. font-weight: 600;
  233. }
  234. }
  235. // First Level Submenu
  236. > .nav-treeview {
  237. background: $sidebar-light-submenu-bg;
  238. }
  239. }
  240. // Section Headning
  241. .nav-header {
  242. color: lighten($sidebar-light-color, 25%);
  243. background: $sidebar-light-bg;
  244. }
  245. // All links within the sidebar menu
  246. .sidebar .nav-link {
  247. color: $sidebar-light-color;
  248. &:hover {
  249. text-decoration: none;
  250. }
  251. }
  252. // All submenus
  253. .nav-treeview {
  254. > .nav-item {
  255. > .nav-link {
  256. color: $sidebar-light-submenu-color;
  257. }
  258. &.active > .nav-link,
  259. > .nav-link:hover {
  260. color: $sidebar-light-submenu-hover-color;
  261. }
  262. &.active > .nav-link {
  263. font-weight: 600;
  264. }
  265. }
  266. }
  267. @include media-breakpoint-up(sm) {
  268. &.sidebar-mini.sidebar-collapse {
  269. .sidebar-menu > li > .nav-treeview {
  270. border-left: 1px solid $gray-500;
  271. }
  272. }
  273. }
  274. }