mixins.less 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // Misc: mixins
  2. //==============
  3. //Changes the color and the hovering properties of the navbar
  4. .navbar-variant(@color) {
  5. background-color: @color;
  6. //Navbar links
  7. .nav a {
  8. color: #acd0e5;
  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: darken(@color, 10%);
  17. color: #f6f6f6;
  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: #acd0e5;
  25. }
  26. }
  27. //Logo color variation
  28. .logo-variant(@color) {
  29. background-color: @color;
  30. color: #f9f9f9;
  31. > a {
  32. color: #f9f9f9;
  33. }
  34. &:hover {
  35. background: darken(@color, 1%);
  36. }
  37. }
  38. //Box solid color variantion creator
  39. .box-solid-variant(@color) {
  40. > .box-header {
  41. color: #fff;
  42. background: @color;
  43. background-color: @color;
  44. a {
  45. color: #444;
  46. }
  47. }
  48. }
  49. //Transform function that rotates eements
  50. .transform(@degree) {
  51. transform:rotate(@degree);
  52. -ms-transform:rotate(@degree); /* IE 9 */
  53. -webkit-transform:rotate(@degree); /* Safari and Chrome */
  54. }
  55. //For floating elements
  56. .clearfix() {
  57. &:before,
  58. &:after {
  59. display: table;
  60. content: " ";
  61. }
  62. &:after {
  63. clear: both;
  64. }
  65. }
  66. //border radius creator
  67. .border-radius(@radius) {
  68. -webkit-border-radius: @radius;
  69. -moz-border-radius: @radius;
  70. border-radius: @radius;
  71. }
  72. //Different radius each side
  73. .border-radius(@top-left; @top-right, @bottom-left, @bottom-right) {
  74. -webkit-border-top-left-radius: @top-left;
  75. -webkit-border-top-right-radius: @top-right;
  76. -webkit-border-bottom-right-radius: @bottom-right;
  77. -webkit-border-bottom-left-radius: @bottom-left;
  78. -moz-border-radius-topleft: @top-left;
  79. -moz-border-radius-topright: @top-right;
  80. -moz-border-radius-bottomright: @bottom-right;
  81. -moz-border-radius-bottomleft: @bottom-left;
  82. border-top-left-radius: @top-left;
  83. border-top-right-radius: @top-right;
  84. border-bottom-right-radius: @bottom-right;
  85. border-bottom-left-radius: @bottom-left;
  86. }
  87. //Bootstrap mixins for progress bars. You can find original copies
  88. //with the bootstrap assets (www.getbootstrap.com)
  89. .progress-bar-variant(@color) {
  90. background-color: @color;
  91. .progress-striped & {
  92. #gradient > .striped();
  93. }
  94. }
  95. // Animations
  96. .animation(@animation) {
  97. -webkit-animation: @animation;
  98. animation: @animation;
  99. }
  100. #gradient {
  101. .striped(@color: rgba(255,255,255,.15); @angle: 45deg) {
  102. 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));
  103. background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);
  104. background-image: -moz-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);
  105. background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);
  106. }
  107. }