mixins.less 6.9 KB

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