mixins.less 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. // Misc: 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 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. background: @hover-bg;
  17. color: @hover-color;
  18. }
  19. .navbar-right > .nav {
  20. margin-right: 10px;
  21. }
  22. //Add color to the sidebar toggle button
  23. .sidebar-toggle .icon-bar {
  24. background: @font-color;
  25. }
  26. .sidebar-toggle:hover .icon-bar {
  27. background: @hover-color!important;
  28. }
  29. }
  30. //Logo color variation
  31. .logo-variant(@color) {
  32. background-color: @color;
  33. color: #f9f9f9;
  34. > a {
  35. color: #f9f9f9;
  36. }
  37. &:hover {
  38. background: darken(@color, 1%);
  39. }
  40. }
  41. //Box solid color variantion creator
  42. .box-solid-variant(@color) {
  43. > .box-header {
  44. color: #fff;
  45. background: @color;
  46. background-color: @color;
  47. a {
  48. color: #444;
  49. }
  50. }
  51. }
  52. //Transform function that rotates eements
  53. .transform(@degree) {
  54. transform:rotate(@degree);
  55. -ms-transform:rotate(@degree); /* IE 9 */
  56. -webkit-transform:rotate(@degree); /* Safari and Chrome */
  57. }
  58. //For floating elements
  59. .clearfix() {
  60. &:before,
  61. &:after {
  62. display: table;
  63. content: " ";
  64. }
  65. &:after {
  66. clear: both;
  67. }
  68. }
  69. //border radius creator
  70. .border-radius(@radius) {
  71. -webkit-border-radius: @radius;
  72. -moz-border-radius: @radius;
  73. border-radius: @radius;
  74. }
  75. //Different radius each side
  76. .border-radius(@top-left; @top-right; @bottom-left; @bottom-right) {
  77. -webkit-border-top-left-radius: @top-left;
  78. -webkit-border-top-right-radius: @top-right;
  79. -webkit-border-bottom-right-radius: @bottom-right;
  80. -webkit-border-bottom-left-radius: @bottom-left;
  81. -moz-border-radius-topleft: @top-left;
  82. -moz-border-radius-topright: @top-right;
  83. -moz-border-radius-bottomright: @bottom-right;
  84. -moz-border-radius-bottomleft: @bottom-left;
  85. border-top-left-radius: @top-left;
  86. border-top-right-radius: @top-right;
  87. border-bottom-right-radius: @bottom-right;
  88. border-bottom-left-radius: @bottom-left;
  89. }
  90. //Bootstrap mixins for progress bars. You can find original copies
  91. //with the bootstrap assets (www.getbootstrap.com)
  92. .progress-bar-variant(@color) {
  93. background-color: @color;
  94. .progress-striped & {
  95. #gradient > .striped();
  96. }
  97. }
  98. // Animations
  99. .animation(@animation) {
  100. -webkit-animation: @animation;
  101. animation: @animation;
  102. }
  103. #gradient {
  104. .striped(@color: rgba(255,255,255,.15); @angle: 45deg) {
  105. background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, @color), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, @color), color-stop(.75, @color), color-stop(.75, transparent), to(transparent));
  106. background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);
  107. background-image: -moz-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);
  108. background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);
  109. }
  110. }
  111. /*---------------------------------------------------
  112. LESS Elements 0.9
  113. ---------------------------------------------------
  114. A set of useful LESS mixins
  115. More info at: http://lesselements.com
  116. ---------------------------------------------------*/
  117. .gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
  118. background: @color;
  119. background: -webkit-gradient(linear,
  120. left bottom,
  121. left top,
  122. color-stop(0, @start),
  123. color-stop(1, @stop));
  124. background: -ms-linear-gradient(bottom,
  125. @start,
  126. @stop);
  127. background: -moz-linear-gradient(center bottom,
  128. @start 0%,
  129. @stop 100%);
  130. background: -o-linear-gradient(@stop,
  131. @start);
  132. filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@stop,@start));
  133. }
  134. .bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) {
  135. background: @color;
  136. background: -webkit-gradient(linear,
  137. left bottom,
  138. left top,
  139. color-stop(0, rgb(@start,@start,@start)),
  140. color-stop(1, rgb(@stop,@stop,@stop)));
  141. background: -ms-linear-gradient(bottom,
  142. rgb(@start,@start,@start) 0%,
  143. rgb(@stop,@stop,@stop) 100%);
  144. background: -moz-linear-gradient(center bottom,
  145. rgb(@start,@start,@start) 0%,
  146. rgb(@stop,@stop,@stop) 100%);
  147. background: -o-linear-gradient(rgb(@stop,@stop,@stop),
  148. rgb(@start,@start,@start));
  149. filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",rgb(@stop,@stop,@stop),rgb(@start,@start,@start)));
  150. }