mixins.scss 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /* positioning */
  2. @mixin group {
  3. &:after {
  4. content: ".";
  5. display: block;
  6. height: 0;
  7. clear: both;
  8. visibility: hidden;
  9. }
  10. }
  11. @mixin text-hidden {
  12. text-indent: 0;
  13. line-height: 0;
  14. font-size: 0;
  15. }
  16. @mixin inline-block {
  17. display: inline-block;
  18. *display: inline;
  19. *zoom: 1;
  20. }
  21. /* sprites */
  22. @mixin sprite-icon {
  23. text-indent: -9999px;
  24. line-height: 0;
  25. font-size: 0;
  26. overflow: hidden;
  27. display: block;
  28. background-image: url("../img/greentech-sprite-icons.png");
  29. background-repeat: no-repeat;
  30. }
  31. @mixin sprite-image {
  32. text-indent: -9999px;
  33. line-height: 0;
  34. font-size: 0;
  35. overflow: hidden;
  36. display: block;
  37. background-image: url("../img/greentech-sprite-images.png");
  38. background-repeat: no-repeat;
  39. }
  40. /* borders made from backgrounds */
  41. @mixin border-vertical-dotted($position) {
  42. background-image: url("../img/border-vertical-dotted.png");
  43. background-repeat: repeat-y;
  44. background-position: $position top;
  45. }
  46. @mixin border-horizontal-dotted($position) {
  47. background-image: url("../img/border-horizontal-dotted.png");
  48. background-repeat: repeat-x;
  49. background-position: left $position;
  50. }
  51. /* triangles */
  52. @mixin triangle-vertical($size: 7px, $position: "bottom", $color: #999, $rgba: rgba(0, 0, 0, 0.7)) {
  53. @include text-hidden;
  54. position : absolute;
  55. height : 0;
  56. width : 0;
  57. border-style : solid;
  58. border-width : $size;
  59. border-color : transparent transparent $color transparent;
  60. border-color : transparent transparent $rgba transparent;
  61. left : 50%;
  62. margin-left : $size * -2;
  63. #{$position} : 0;
  64. }
  65. @mixin triangle-angled($size: 4px, $position: "bottom", $color: #333, $rgba: "") {
  66. @include text-hidden;
  67. position : absolute;
  68. height : 0;
  69. width : 0;
  70. border-style : solid;
  71. border-width : $size;
  72. border-color : $color transparent transparent $color;
  73. @if $rgba != "" {
  74. border-color : $rgba transparent transparent $rgba;
  75. }
  76. left : 50%;
  77. margin-left : $size * -2;
  78. #{$position} : $size * -2;
  79. }
  80. /* css3 */
  81. @mixin rounded($radius: 5px) {
  82. -moz-border-radius: $radius;
  83. border-radius: $radius;
  84. }
  85. @mixin rounded-side($horizontal, $vertical, $magnitude: 5px) {
  86. border-#{$vertical}-#{$horizontal}-radius: $magnitude;
  87. -moz-border-radius-#{$vertical}#{$horizontal}: $magnitude;
  88. -webkit-border-#{$vertical}-#{$horizontal}-radius: $magnitude;
  89. }
  90. @mixin transition($property, $time: 0.25s) {
  91. -webkit-transition: $property $time ease-in-out;
  92. -moz-transition: $property $time ease-in-out;
  93. -o-transition: $property $time ease-in-out;
  94. -ms-transition: $property $time ease-in-out;
  95. transition: $property $time ease-in-out;
  96. }
  97. @mixin inner-shadow($horizontal: -5px, $vertical: -5px, $magnitude: 5px, $color: #888) {
  98. -moz-box-shadow: inset $horizontal $vertical $magnitude $color;
  99. -webkit-box-shadow: inset $horizontal $vertical $magnitude $color;
  100. box-shadow: inset $horizontal $vertical $magnitude $color;
  101. }
  102. @mixin drop-shadow($horizontal: 5px, $vertical: 5px, $magnitude: 5px, $color: #888) {
  103. -moz-box-shadow: $horizontal $vertical $magnitude $color;
  104. -webkit-box-shadow: $horizontal $vertical $magnitude $color;
  105. box-shadow: $horizontal $vertical $magnitude $color;
  106. }