_mixins.scss 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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. }
  171. }
  172. }
  173. // Sidebar form
  174. .sidebar-form {
  175. margin: 5px 0;
  176. .form-control {
  177. &::-webkit-input-placeholder,
  178. &:-moz-placeholder,
  179. &::-moz-placeholder,
  180. &:-ms-input-placeholder {
  181. color: red;
  182. }
  183. font-size: 14px;
  184. background: $sidebar-dark-hover-bg;
  185. border: 0;
  186. color: $sidebar-dark-hover-color;
  187. padding: 10px 10px;
  188. &:focus {
  189. background: lighten($sidebar-dark-bg, 3%);
  190. }
  191. }
  192. }
  193. }
  194. // Light Sidebar Mixin
  195. @mixin skin-light-sidebar($icon-active-color) {
  196. // Sidebar background color
  197. .main-sidebar,
  198. .main-sidebar:before {
  199. background-color: $sidebar-light-bg;
  200. }
  201. .content-wrapper,
  202. .main-footer {
  203. border-left: 1px solid $gray;
  204. }
  205. // User Panel (resides in the sidebar)
  206. .user-panel {
  207. > .info,
  208. > .info > .nav-link {
  209. color: $sidebar-light-color;
  210. }
  211. }
  212. // Sidebar Menu. First level links
  213. .sidebar-menu > .nav-item {
  214. transition: border-left-color .3s ease;
  215. // links
  216. > .nav-link {
  217. border-left: 3px solid transparent;
  218. font-weight: 600;
  219. &:focus {
  220. color: $sidebar-light-color;
  221. }
  222. }
  223. // Hover and active states
  224. &:hover > .nav-link,
  225. &.active > .nav-link {
  226. color: $sidebar-light-hover-color;
  227. background: $sidebar-light-hover-bg;
  228. }
  229. &:hover > .nav-link {
  230. }
  231. &.active {
  232. border-left-color: $icon-active-color;
  233. > .nav-link {
  234. font-weight: 600;
  235. }
  236. }
  237. // First Level Submenu
  238. > .nav-treeview {
  239. background: $sidebar-light-submenu-bg;
  240. }
  241. }
  242. // Section Headning
  243. .nav-header {
  244. color: lighten($sidebar-light-color, 25%);
  245. background: $sidebar-light-bg;
  246. }
  247. // All links within the sidebar menu
  248. .sidebar .nav-link {
  249. color: $sidebar-light-color;
  250. &:hover {
  251. text-decoration: none;
  252. }
  253. }
  254. // All submenus
  255. .nav-treeview {
  256. > .nav-item {
  257. > .nav-link {
  258. color: $sidebar-light-submenu-color;
  259. }
  260. &.active > .nav-link,
  261. > .nav-link:hover {
  262. color: $sidebar-light-submenu-hover-color;
  263. }
  264. &.active > .nav-link {
  265. font-weight: 600;
  266. }
  267. }
  268. }
  269. @include media-breakpoint-up(sm) {
  270. &.sidebar-mini.sidebar-collapse {
  271. .sidebar-menu > li > .nav-treeview {
  272. border-left: 1px solid $gray;
  273. }
  274. }
  275. }
  276. }