mixins.less 7.1 KB

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