Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added css3 mixins file

  • Loading branch information...
commit c39d0fa93c22133c8301be6fe14fdd3373042080 0 parents
Matthieu Aussaguel authored July 03, 2011

Showing 1 changed file with 240 additions and 0 deletions. Show diff stats Hide diff stats

  1. 240  css3-mixins.scss
240  css3-mixins.scss
... ...
@@ -0,0 +1,240 @@
  1
+/* -------------------------------------------------------------
  2
+  Sass CSS3 Mixins! The Cross-Browser CSS3 Sass Library
  3
+  By: Matthieu Aussaguel, http://www.mynameismatthieu.com, @matthieu_tweets
  4
+
  5
+  List of CSS3 Sass Mixins File to be @imported and @included as you need
  6
+
  7
+  The purpose of this library is to facilitate the use of CSS3 on different browsers avoiding HARD TO READ and NEVER
  8
+  ENDING css files
  9
+
  10
+  note: All CSS3 Properties are being supported by Safari 5
  11
+  more info: http://www.findmebyip.com/litmus/#css3-properties
  12
+
  13
+  Mixins available:
  14
+    -   background-gradient     - arguments: Start Color: #3C3C3C, End Color: #999999
  15
+    -   background-size         - arguments: Width: 100%, Height: 100%
  16
+    -   border-radius           - arguments: Radius: 5px
  17
+    -   border-radius-separate  - arguments: Top Left: 5px, Top Left: 5px, Bottom Left: 5px, Bottom Right: 5px
  18
+    -   box                     - arguments: Orientation: horizontal, Pack: center, Align: center
  19
+    -   box-rgba                - arguments: R: 60, G: 3, B: 12, Opacity: 0.23, Color: #3C3C3C
  20
+    -   box-shadow              - arguments: X: 2px, Y: 2px, Blur: 5px, Color: rgba(0,0,0,.4)
  21
+    -   box-sizing              - arguments: Type: border-box
  22
+    -   columns                 - arguments: Count: 3, Gap: 10
  23
+    -   double-borders          - arguments: Color One: #3C3C3C, Color Two: #999999, Radius: 0
  24
+    -   flex                    - arguments: Value: 1
  25
+    -   flip                    - arguments: ScaleX: -1
  26
+    -   font-face               - arguments: Font Family: myFont, Eot File Src: myFont.eot, Woff File Src: myFont.woff, Ttf File Src: myFont.ttf
  27
+    -   opacity                 - arguments: Opacity: 0.5
  28
+    -   outline radius          - arguments: Radius: 5px
  29
+    -   resize                  - arguments: Direction: both
  30
+    -   rotate                  - arguments: Degree: 0, M11: 0, M12: 0, M21: 0, M22: 0
  31
+    CSS Matrix Rotation Calculator http://www.boogdesign.com/examples/transforms/matrix-calculator.html
  32
+    -   text-shadow             - arguments: X: 2px, Y: 2px, Blur: 5px, Color: rgba(0,0,0,.4)
  33
+    -   transform               - arguments: Parameters: null
  34
+    -   transition              - arguments: What: all, Length: 1s, Easing: ease-in-out
  35
+    -   triple-borders          - arguments: Color One: #3C3C3C, Color Two: #999999, Color Three: #000000, Radius: 0
  36
+
  37
+------------------------------------------------------------- */
  38
+
  39
+/* BACKGROUND GRADIENT */
  40
+@mixin background-gradient($startColor: #3C3C3C, $endColor: #999999) {
  41
+    background-color: $startColor;
  42
+    background-image: -webkit-gradient(linear, left top, left bottom, from($startColor), to($endColor));
  43
+    background-image: -webkit-linear-gradient(top, $startColor, $endColor);
  44
+    background-image:    -moz-linear-gradient(top, $startColor, $endColor);
  45
+    background-image:     -ms-linear-gradient(top, $startColor, $endColor);
  46
+    background-image:      -o-linear-gradient(top, $startColor, $endColor);
  47
+    background-image:         linear-gradient(top, $startColor, $endColor);
  48
+    filter:            progid:DXImageTransform.Microsoft.gradient(startColorStr=$startColor, EndColorStr=$endColor);
  49
+}
  50
+
  51
+
  52
+/* BACKGROUND SIZE */
  53
+@mixin background-size($width: 100%, $height: 100%) {
  54
+     -moz-background-size: $width $height;
  55
+  -webkit-background-size: $width $height;
  56
+          background-size: $width $height;
  57
+}
  58
+
  59
+
  60
+/* BORDER RADIUS */
  61
+@mixin border-radius($radius: 5px) {
  62
+    -moz-border-radius:    $radius;
  63
+    -webkit-border-radius: $radius;
  64
+    border-radius:         $radius;
  65
+}
  66
+
  67
+@mixin border-radius-separate($topLeftRadius: 5px, $topRightRadius: 5px, $bottomLeftRadius: 5px, $bottomRightRadius: 5px) {
  68
+    -webkit-border-top-left-radius:     $topLeftRadius;
  69
+    -webkit-border-top-right-radius:    $topRightRadius;
  70
+    -webkit-border-bottom-right-radius: $bottomLeftRadius;
  71
+    -webkit-border-bottom-left-radius:  $bottomRightRadius;
  72
+
  73
+    -moz-border-radius-topleft:     $topLeftRadius;
  74
+    -moz-border-radius-topright:    $topRightRadius;
  75
+    -moz-border-radius-bottomright: $bottomLeftRadius;
  76
+    -moz-border-radius-bottomleft:  $bottomRightRadius;
  77
+
  78
+    border-top-left-radius:     $topLeftRadius;
  79
+    border-top-right-radius:    $topRightRadius;
  80
+    border-bottom-right-radius: $bottomLeftRadius;
  81
+    border-bottom-left-radius:  $bottomRightRadius;
  82
+}
  83
+
  84
+/* BOX */
  85
+@mixin box($orient: horizontal, $pack: center, $align: center) {
  86
+    display: -webkit-box;
  87
+    display: -moz-box;
  88
+    display: box;
  89
+
  90
+    -webkit-box-orient: $orient;
  91
+    -moz-box-orient:    $orient;
  92
+    box-orient:         $orient;
  93
+
  94
+    -webkit-box-pack: $pack;
  95
+    -moz-box-pack:    $pack;
  96
+    box-pack:         $pack;
  97
+
  98
+    -webkit-box-align: $align;
  99
+    -moz-box-align:    $align;
  100
+    box-align:         $align;
  101
+}
  102
+
  103
+/* BOX RGBA */
  104
+@mixin box-rgba($r: 60, $g: 3, $b: 12, $opacity: 0.23, $color: #3C3C3C) {
  105
+  background-color: transparent;
  106
+  background-color: rgba($r, $g, $b, $opacity);
  107
+            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr#$color,endColorstr=$color);
  108
+            zoom:   1;
  109
+}
  110
+
  111
+
  112
+/* BOX SHADOW */
  113
+@mixin box-shadow($x: 2px, $y: 2px, $blur: 5px, $color: rgba(0,0,0,.4)) {
  114
+    -webkit-box-shadow: $x $y $blur $color;
  115
+    -moz-box-shadow:    $x $y $blur $color;
  116
+    box-shadow:         $x $y $blur $color;
  117
+}
  118
+
  119
+/* BOX SIZING */
  120
+@mixin box-sizing($type: border-box) {
  121
+    -webkit-box-sizing:   $type;
  122
+    -moz-box-sizing:      $type;
  123
+    box-sizing:           $type;
  124
+}
  125
+
  126
+/* COLUMNS */
  127
+@mixin columns($count: 3, $gap: 10) {
  128
+    -webkit-column-count: $count;
  129
+    -moz-column-count:    $count;
  130
+    column-count:         $count;
  131
+
  132
+    -webkit-column-gap:   $gap;
  133
+    -moz-column-gap:      $gap;
  134
+    column-gap:           $gap;
  135
+}
  136
+
  137
+/* DOUBLE BORDERS */
  138
+@mixin double-borders($colorOne: #3C3C3C, $colorTwo: #999999, $radius: 0) {
  139
+    border: 1px solid $colorOne;
  140
+
  141
+    -webkit-box-shadow: 0 0 0 1px $colorTwo;
  142
+    -moz-box-shadow:    0 0 0 1px $colorTwo;
  143
+    box-shadow:         0 0 0 1px $colorTwo;
  144
+
  145
+    @include border-radius( $radius );
  146
+}
  147
+
  148
+/* FLEX */
  149
+@mixin flex($value: 1) {
  150
+    -webkit-box-flex: $value;
  151
+    -moz-box-flex:    $value;
  152
+    box-flex:         $value;
  153
+}
  154
+
  155
+/* FLIP */
  156
+@mixin flip($scaleX: -1) {
  157
+	-moz-transform:    scaleX($scaleX);
  158
+	-o-transform:      scaleX($scaleX);
  159
+	-webkit-transform: scaleX($scaleX);
  160
+	transform:         scaleX($scaleX);
  161
+	filter:            FlipH;
  162
+	-ms-filter:        "FlipH";
  163
+}
  164
+
  165
+/* FONT FACE */
  166
+@mixin font-face($fontFamily: myFont, $eotFileSrc: 'myFont.eot', $woffFileSrc: 'myFont.woff', $ttfFileSrc: 'myFont.ttf') {
  167
+  font-family: $fontFamily;
  168
+  src: url($eotFileSrc)  format('eot'),
  169
+       url($woffFileSrc) format('woff'),
  170
+       url($ttfFileSrc)  format('truetype');
  171
+}
  172
+
  173
+/* OPACITY */
  174
+@mixin opacity($opacity: 0.5) {
  175
+    filter:         alpha(opacity=($opacity * 100));
  176
+    -ms-filter:     "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + ($opacity * 100) + ")";
  177
+    -moz-opacity:   $opacity;
  178
+    -khtml-opacity: $opacity;
  179
+    opacity:        $opacity;
  180
+}
  181
+
  182
+
  183
+/* OUTLINE RADIUS */
  184
+@mixin outline-radius($radius: 5px) {
  185
+    -webkit-outline-radius: $radius;
  186
+    -moz-outline-radius:    $radius;
  187
+    outline-radius:         $radius;
  188
+}
  189
+
  190
+/* RESIZE */
  191
+@mixin resize($direction: both) {
  192
+    -webkit-resize: $direction;
  193
+    -moz-resize:    $direction;
  194
+    resize:         $direction;
  195
+}
  196
+
  197
+/* ROTATE*/
  198
+@mixin rotate($deg: 0, $m11: 0, $m12: 0, $m21: 0, $m22: 0) {
  199
+     -moz-transform: rotate($deg + deg);
  200
+       -o-transform: rotate($deg + deg);
  201
+  -webkit-transform: rotate($deg + deg);
  202
+      -ms-transform: rotate($deg + deg);
  203
+          transform: rotate($deg + deg);
  204
+             filter: progid:DXImageTransform.Microsoft.Matrix(
  205
+                     M11=$m11, M12=$m12,M21=$m21, M22=$m22, sizingMethod='auto expand');
  206
+               zoom: 1;
  207
+}
  208
+
  209
+/* TEXT SHADOW */
  210
+@mixin text-shadow($x: 2px, $y: 2px, $blur: 5px, $color: rgba(0,0,0,.4)) {
  211
+    text-shadow: $x $y $blur $color;
  212
+}
  213
+
  214
+/* TRANSFORM  */
  215
+@mixin transform($params) {
  216
+    -webkit-transform: $params;
  217
+    -moz-transform:    $params;
  218
+    transform:         $params;
  219
+}
  220
+
  221
+/* TRANSITION */
  222
+@mixin transition($what: all, $length: 1s, $easing: ease-in-out) {
  223
+    -moz-transition:    $what $length $easing;
  224
+    -o-transition:      $what $length $easing;
  225
+    -webkit-transition: $what $length $easing;
  226
+    -ms-transition:     $what $length $easing;
  227
+    transition:         $what $length $easing;
  228
+
  229
+}
  230
+
  231
+/* TRIPLE BORDERS */
  232
+@mixin triple-borders($colorOne: #3C3C3C, $colorTwo: #999999, $colorThree: #000000, $radius: 0) {
  233
+    border: 1px solid $colorOne;
  234
+
  235
+    @include border-radius($radius);
  236
+
  237
+    -webkit-box-shadow: 0 0 0 1px $colorTwo, 0 0 0 2px $colorThree;
  238
+    -moz-box-shadow:    0 0 0 1px $colorTwo, 0 0 0 2px $colorThree;
  239
+    box-shadow:         0 0 0 1px $colorTwo, 0 0 0 2px $colorThree;
  240
+}

0 notes on commit c39d0fa

Please sign in to comment.
Something went wrong with that request. Please try again.