mixins.less 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // For clearing floats
  2. .clearfix {
  3. *zoom: 1;
  4. &:before,
  5. &:after {
  6. display: table;
  7. content: "";
  8. // Fixes Opera/contenteditable bug:
  9. // http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952
  10. line-height: 0;
  11. }
  12. &:after {
  13. clear: both;
  14. }
  15. }
  16. // Single side border-radius
  17. .border-top-radius(@radius) {
  18. border-top-right-radius: @radius;
  19. border-top-left-radius: @radius;
  20. }
  21. .border-right-radius(@radius) {
  22. border-bottom-right-radius: @radius;
  23. border-top-right-radius: @radius;
  24. }
  25. .border-bottom-radius(@radius) {
  26. border-bottom-right-radius: @radius;
  27. border-bottom-left-radius: @radius;
  28. }
  29. .border-left-radius(@radius) {
  30. border-bottom-left-radius: @radius;
  31. border-top-left-radius: @radius;
  32. }
  33. // Gradient Bar Colors for buttons and alerts
  34. .gradientBar(@primaryColor, @secondaryColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) {
  35. color: @textColor;
  36. text-shadow: @textShadow;
  37. #gradient > .vertical(@primaryColor, @secondaryColor);
  38. border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%);
  39. border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
  40. }
  41. // Gradients
  42. #gradient {
  43. .vertical(@startColor: #555, @endColor: #333) {
  44. background-color: mix(@startColor, @endColor, 60%);
  45. background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
  46. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
  47. background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
  48. background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
  49. background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10
  50. background-repeat: repeat-x;
  51. filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down
  52. }
  53. }
  54. // Icon Base Styles
  55. .iconBaseStyles(@fontFamily: "fuelux"){
  56. font-family: @fontFamily !important;
  57. font-style: normal !important;
  58. font-weight: normal !important;
  59. font-variant: normal !important;
  60. text-transform: none !important;
  61. line-height: 1;
  62. speak: none;
  63. -webkit-font-smoothing: antialiased;
  64. -moz-osx-font-smoothing: grayscale;
  65. }
  66. // Disables selection of text
  67. .noSelectionAllowed(){
  68. -webkit-user-select: none;
  69. -moz-user-select: none;
  70. -ms-user-select: none;
  71. -o-user-select: none;
  72. user-select: none;
  73. }
  74. // Opacity
  75. .opacity(@opacity) {
  76. opacity: @opacity / 100;
  77. filter: ~"alpha(opacity=@{opacity})";
  78. }
  79. // Helpers
  80. // -------------------------
  81. .data-label() {
  82. text-transform: uppercase;
  83. font-size: 10px;
  84. margin-bottom: 2px;
  85. text-shadow: 0 1px #fff;
  86. color: #666;
  87. }
  88. .data-value() {
  89. font-size: 14px;
  90. }
  91. .section-heading() {
  92. font-size: 16px;
  93. color: #333;
  94. margin: 0 0 10px;
  95. padding: 0;
  96. text-shadow: 0 1px #fff;
  97. }
  98. .text-emphasis-variant(@color) {
  99. color: @color;
  100. a&:hover {
  101. color: darken(@color, 10%);
  102. }
  103. }
  104. .vertical-align() {
  105. margin: auto;
  106. position: absolute;
  107. top: 0;
  108. bottom: 0;
  109. }