mixins.less 7.0 KB

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