_mixins.scss 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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. //border radius creator
  64. @mixin border-radius($radius) {
  65. border-radius: $radius;
  66. }
  67. @mixin translate($x, $y) {
  68. -ms-transform: translate($x, $y); // IE9 only
  69. transform: translate($x, $y);
  70. }
  71. //Different radius each side
  72. @mixin border-radius-sides($top-left, $top-right, $bottom-left, $bottom-right)
  73. {
  74. border-radius: $top-left $top-right $bottom-left $bottom-right;
  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. //Added 2.1.0
  92. //Skins Mixins
  93. //Dark Sidebar Mixin
  94. @mixin skin-dark-sidebar($link-hover-border-color) {
  95. // Sidebar background color (Both .wrapper and .left-side are responsible for sidebar bg color)
  96. .wrapper,
  97. .main-sidebar,
  98. .left-side {
  99. background-color: $sidebar-dark-bg;
  100. }
  101. //User Panel (resides in the sidebar)
  102. .user-panel {
  103. > .info, > .info > a {
  104. color: #fff;
  105. }
  106. }
  107. //Sidebar Menu. First level links
  108. .sidebar-menu > li {
  109. //Section Headning
  110. &.header {
  111. color: lighten($sidebar-dark-bg, 20%);
  112. background: darken($sidebar-dark-bg, 4%);
  113. }
  114. //links
  115. > a {
  116. border-left: 3px solid transparent;
  117. }
  118. //Hover and active states
  119. &:hover > a, &.active > a {
  120. color: $sidebar-dark-hover-color;
  121. background: $sidebar-dark-hover-bg;
  122. border-left-color: $link-hover-border-color;
  123. }
  124. //First Level Submenu
  125. > .treeview-menu {
  126. margin: 0 1px;
  127. background: $sidebar-dark-submenu-bg;
  128. }
  129. }
  130. //All links within the sidebar menu
  131. .sidebar a {
  132. color: $sidebar-dark-color;
  133. &:hover {
  134. text-decoration: none;
  135. }
  136. }
  137. //All submenus
  138. .treeview-menu {
  139. > li {
  140. > a {
  141. color: $sidebar-dark-submenu-color;
  142. }
  143. &.active > a, > a:hover {
  144. color: $sidebar-dark-submenu-hover-color;
  145. }
  146. }
  147. }
  148. //The sidebar search form
  149. .sidebar-form {
  150. @include border-radius(3px);
  151. border: 1px solid lighten($sidebar-dark-bg, 10%);
  152. margin: 10px 10px;
  153. input[type="text"], .btn {
  154. box-shadow: none;
  155. background-color: lighten($sidebar-dark-bg, 10%);
  156. border: 1px solid transparent;
  157. height: 35px;
  158. transition: all $transition-speed $transition-fn;
  159. }
  160. input[type="text"] {
  161. color: #666;
  162. @include border-radius(2px, 0, 2px, 0);
  163. &:focus, &:focus + .input-group-btn .btn {
  164. background-color: #fff;
  165. color: #666;
  166. }
  167. &:focus + .input-group-btn .btn {
  168. border-left-color: #fff;
  169. }
  170. }
  171. .btn {
  172. color: #999;
  173. @include border-radius(0, 2px, 0, 2px);
  174. }
  175. }
  176. }
  177. //Light Sidebar Mixin
  178. @mixin skin-light-sidebar($icon-active-color) {
  179. // Sidebar background color (Both .wrapper and .left-side are responsible for sidebar bg color)
  180. .wrapper,
  181. .main-sidebar,
  182. .left-side {
  183. background-color: $sidebar-light-bg;
  184. }
  185. .content-wrapper,
  186. .main-footer {
  187. border-left: 1px solid $gray;
  188. }
  189. //User Panel (resides in the sidebar)
  190. .user-panel {
  191. > .info, > .info > a {
  192. color: $sidebar-light-color;
  193. }
  194. }
  195. //Sidebar Menu. First level links
  196. .sidebar-menu > li {
  197. transition: border-left-color .3s ease;
  198. //border-left: 3px solid transparent;
  199. //Section Headning
  200. &.header {
  201. color: lighten($sidebar-light-color, 25%);
  202. background: $sidebar-light-bg;
  203. }
  204. //links
  205. > a {
  206. border-left: 3px solid transparent;
  207. font-weight: 600;
  208. }
  209. //Hover and active states
  210. &:hover > a,
  211. &.active > a {
  212. color: $sidebar-light-hover-color;
  213. background: $sidebar-light-hover-bg;
  214. }
  215. &:hover > a {
  216. }
  217. &.active {
  218. border-left-color: $icon-active-color;
  219. > a {
  220. font-weight: 600;
  221. }
  222. }
  223. //First Level Submenu
  224. > .treeview-menu {
  225. background: $sidebar-light-submenu-bg;
  226. }
  227. }
  228. //All links within the sidebar menu
  229. .sidebar a {
  230. color: $sidebar-light-color;
  231. &:hover {
  232. text-decoration: none;
  233. }
  234. }
  235. //All submenus
  236. .treeview-menu {
  237. > li {
  238. > a {
  239. color: $sidebar-light-submenu-color;
  240. }
  241. &.active > a,
  242. > a:hover {
  243. color: $sidebar-light-submenu-hover-color;
  244. }
  245. &.active > a {
  246. font-weight: 600;
  247. }
  248. }
  249. }
  250. //The sidebar search form
  251. .sidebar-form {
  252. @include border-radius(3px);
  253. border: 1px solid $gray; //darken($sidebar-light-bg, 5%);
  254. margin: 10px 10px;
  255. input[type="text"],
  256. .btn {
  257. box-shadow: none;
  258. background-color: #fff; //darken($sidebar-light-bg, 3%);
  259. border: 1px solid transparent;
  260. height: 35px;
  261. transition: all $transition-speed $transition-fn;
  262. }
  263. input[type="text"] {
  264. color: #666;
  265. @include border-radius(2px, 0, 2px, 0);
  266. &:focus,
  267. &:focus + .input-group-btn .btn {
  268. background-color: #fff;
  269. color: #666;
  270. }
  271. &:focus + .input-group-btn .btn {
  272. border-left-color: #fff;
  273. }
  274. }
  275. .btn {
  276. color: #999;
  277. @include border-radius(0, 2px, 0, 2px);
  278. }
  279. }
  280. @media (min-width: map-get($grid-breakpoints, sm)) {
  281. &.sidebar-mini.sidebar-collapse {
  282. .sidebar-menu > li > .treeview-menu {
  283. border-left: 1px solid $gray;
  284. }
  285. }
  286. }
  287. }