mixins.less 7.2 KB

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