bourbon 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ *swp
2
+ *gem
3
+ .sass-cache/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in sass-mixins.gemspec
4
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,18 @@
1
+ // Custom Functions
2
+ @import "functions/compact";
3
+ @import "functions/tint-shade";
4
+
5
+ // CSS3 Mixins
6
+ @import "css3/animation";
7
+ @import "css3/border-radius";
8
+ @import "css3/box-shadow";
9
+ @import "css3/box-sizing";
10
+ @import "css3/flex-box";
11
+ @import "css3/inline-block";
12
+ @import "css3/linear-gradient";
13
+ @import "css3/radial-gradient";
14
+ @import "css3/transform";
15
+ @import "css3/transition";
16
+
17
+ // Addons & other mixins
18
+ @import "addons/button";
@@ -0,0 +1,174 @@
1
+ @mixin button ($style: simple, $base-color: #4294f0) {
2
+
3
+ @if type-of($style) == color {
4
+ $base-color: $style;
5
+ $style: simple;
6
+ }
7
+
8
+ @if $style == simple {
9
+ @include simple($base-color);
10
+ }
11
+
12
+ @else if $style == shiny {
13
+ @include shiny($base-color);
14
+ }
15
+
16
+ @else if $style == pill {
17
+ @include pill($base-color);
18
+ }
19
+ }
20
+
21
+ @mixin simple ($base-color) {
22
+ $stop-gradient: adjust-color($base-color, $saturation: 9%, $lightness: -11%);
23
+ $border: adjust-color($base-color, $saturation: 9%, $lightness: -14%);
24
+ $color: hsl(0, 0, 100%);
25
+ $inset-shadow: adjust-color($base-color, $saturation: -8%, $lightness: 15%);
26
+ $text-shadow: adjust-color($base-color, $saturation: 15%, $lightness: -18%);
27
+
28
+ @if lightness($base-color) > 70% {
29
+ $color: hsl(0, 0, 20%);
30
+ $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
31
+ }
32
+
33
+ border: 1px solid $border;
34
+ @include border-radius (3px);
35
+ @include box-shadow (inset 0 1px 0 0 $inset-shadow);
36
+ color: $color;
37
+ display: inline;
38
+ font: bold 11px 'lucida grande', helvetica neue, helvetica, arial, sans-serif;
39
+ @include linear-gradient ($base-color, $stop-gradient);
40
+ padding: 6px 18px 7px;
41
+ text-shadow: 0 1px 0 $text-shadow;
42
+ -webkit-background-clip: padding-box;
43
+
44
+ &:hover {
45
+ $base-color-hover: adjust-color($base-color, $saturation: -4%, $lightness: -5%);
46
+ $stop-gradient-hover: adjust-color($base-color, $saturation: 8%, $lightness: -14%);
47
+ $inset-shadow-hover: adjust-color($base-color, $saturation: -7%, $lightness: 5%);
48
+
49
+ @include box-shadow (inset 0 1px 0 0 $inset-shadow-hover);
50
+ cursor: pointer;
51
+ @include linear-gradient ($base-color-hover, $stop-gradient-hover);
52
+ }
53
+
54
+ &:active {
55
+ $border-active: adjust-color($base-color, $saturation: 9%, $lightness: -14%);
56
+ $inset-shadow-active: adjust-color($base-color, $saturation: 7%, $lightness: -17%);
57
+
58
+ border: 1px solid $border-active;
59
+ @include box-shadow (inset 0 0 8px 4px $inset-shadow-active, inset 0 0 8px 4px $inset-shadow-active, 0 1px 1px 0 #eee);
60
+ }
61
+ }
62
+
63
+ @mixin shiny($base-color) {
64
+ $second-stop: adjust-color($base-color, $saturation: 0%, $lightness: -15%);
65
+ $third-stop: adjust-color($base-color, $saturation: 5%, $lightness: -22%);
66
+ $fourth-stop: adjust-color($base-color, $saturation: 0%, $lightness: -19%);
67
+ $border-top: adjust-color($base-color, $saturation: 0%, $lightness: -23%);
68
+ $border-sides: adjust-color($base-color, $saturation: 0%, $lightness: -29%);
69
+ $border-bottom: adjust-color($base-color, $saturation: 0%, $lightness: -35%);
70
+ $color: hsl(0, 0, 100%);
71
+ $inset-shadow: adjust-color($base-color, $hue: -5, $saturation: 23%, $lightness:-8%);
72
+ $text-shadow: adjust-color($base-color, $saturation: 6%, $lightness: -21%);
73
+
74
+ @if lightness($base-color) > 70% {
75
+ $color: hsl(0, 0, 20%);
76
+ $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
77
+ }
78
+
79
+ @include linear-gradient (top, $base-color 0%, $second-stop 50%, $third-stop 50%, $fourth-stop 100%);
80
+ border: 1px solid $border-top;
81
+ border-color: $border-top $border-sides $border-bottom;
82
+ @include border-radius (4px);
83
+ @include box-shadow(inset 0 0 2px 0 $inset-shadow);
84
+ color: $color;
85
+ display: inline;
86
+ font: bold 12px "helvetica neue", helvetica, arial, sans-serif;
87
+ padding: 7px 18px;
88
+ text-shadow: 0 -1px 1px $text-shadow;
89
+ -webkit-background-clip: padding-box;
90
+
91
+ &:hover {
92
+ $first-stop-hover: adjust-color($base-color, $saturation: 2%, $lightness: -5%);
93
+ $second-stop-hover: adjust-color($base-color, $saturation: 2%, $lightness: -18%);
94
+ $third-stop-hover: adjust-color($base-color, $saturation: 23%, $lightness: -26%);
95
+ $fourth-stop-hover: adjust-color($base-color, $saturation: 16%, $lightness: -23%);
96
+
97
+ @include linear-gradient (top, $first-stop-hover 0%, $second-stop-hover 50%, $third-stop-hover 50%, $fourth-stop-hover 100%);
98
+ cursor: pointer;
99
+ }
100
+
101
+ &:active {
102
+ $border-top-active: adjust-color($base-color, $saturation: 1%, $lightness: -19%);
103
+ $border-sides-active: adjust-color($base-color, $saturation: 1%, $lightness: -34%);
104
+ $border-bottom-active: adjust-color($base-color, $saturation: 1%, $lightness: -40%);
105
+ $inset-shadow-active: adjust-color($base-color, $saturation: -1%, $lightness: -33%);
106
+
107
+ border: 1px solid $border-top-active;
108
+ border-color: $border-top-active $border-sides-active $border-bottom-active;
109
+ @include box-shadow(inset 0 0 5px 2px $inset-shadow-active, 0 1px 0 #eee);
110
+ }
111
+ }
112
+
113
+ @mixin pill($base-color) {
114
+ $stop-gradient: adjust-color($base-color, $hue: 8, $saturation: 14%, $lightness: -10%);
115
+ $border-top: adjust-color($base-color, $hue: -1, $saturation: -30%, $lightness: -15%);
116
+ $border-sides: adjust-color($base-color, $hue: 4, $saturation: -21%, $lightness: -21%);
117
+ $border-bottom: adjust-color($base-color, $hue: 8, $saturation: -11%, $lightness: -26%);
118
+ $color: hsl(0, 0, 100%);
119
+ $inset-shadow: adjust-color($base-color, $hue: -1, $saturation: -1%, $lightness: 7%);
120
+ $text-shadow: adjust-color($base-color, $hue: 5, $saturation: -19%, $lightness: -15%);
121
+
122
+ @if lightness($base-color) > 70% {
123
+ $color: hsl(0, 0, 20%);
124
+ $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
125
+ }
126
+
127
+ @include linear-gradient ($base-color, $stop-gradient);
128
+ border: 1px solid $border-top;
129
+ border-color: $border-top $border-sides $border-bottom;
130
+ @include border-radius(16px);
131
+ @include box-shadow(inset 0 1px 0 0 $inset-shadow, 0 1px 2px 0 #b3b3b3);
132
+ color: $color;
133
+ display: inline;
134
+ font-family: "lucida grande", sans-serif;
135
+ font-size: 11px;
136
+ font-weight: normal;
137
+ line-height: 1;
138
+ padding: 3px 16px 5px;
139
+ text-align: center;
140
+ text-shadow: 0 -1px 1px $text-shadow;
141
+ -webkit-background-clip: padding-box;
142
+
143
+ &:hover {
144
+ $base-color-hover: adjust-color($base-color, $lightness: -4.5%);
145
+ $stop-gradient-hover: adjust-color($base-color, $hue: 8, $saturation: -4%, $lightness: -15.5%);
146
+ $border-top: adjust-color($base-color, $hue: -1, $saturation: -17%, $lightness: -21%);
147
+ $border-sides: adjust-color($base-color, $hue: 4, $saturation: -2%, $lightness: -27%);
148
+ $border-bottom: adjust-color($base-color, $hue: 8, $saturation: 13.5%, $lightness: -32%);
149
+ $inset-shadow-hover: adjust-color($base-color, $saturation: -1%, $lightness: 3%);
150
+ $text-shadow-hover: adjust-color($base-color, $hue: 5, $saturation: -5%, $lightness: -22%);
151
+
152
+ @include linear-gradient ($base-color-hover, $stop-gradient-hover);
153
+ border: 1px solid $border-top;
154
+ border-color: $border-top $border-sides $border-bottom;
155
+ @include box-shadow(inset 0 1px 0 0 $inset-shadow-hover);
156
+ cursor: pointer;
157
+ text-shadow: 0 -1px 1px $text-shadow-hover;
158
+ -webkit-background-clip: padding-box;
159
+ }
160
+
161
+ &:active {
162
+ $active-color: adjust-color($base-color, $hue: 4, $saturation: -12%, $lightness: -10%);
163
+ $border-active: adjust-color($base-color, $hue: 6, $saturation: -2.5%, $lightness: -30%);
164
+ $border-bottom-active: adjust-color($base-color, $hue: 11, $saturation: 6%, $lightness: -31%);
165
+ $inset-shadow-active: adjust-color($base-color, $hue: 9, $saturation: 2%, $lightness: -21.5%);
166
+ $text-shadow-active: adjust-color($base-color, $hue: 5, $saturation: -12%, $lightness: -21.5%);
167
+
168
+ background: $active-color;
169
+ border: 1px solid $border-active;
170
+ border-bottom: 1px solid $border-bottom-active;
171
+ @include box-shadow(inset 0 0 6px 3px $inset-shadow-active, 0 1px 0 0 #fff);
172
+ text-shadow: 0 -1px 1px $text-shadow-active;
173
+ }
174
+ }
@@ -0,0 +1,161 @@
1
+ // http://www.w3.org/TR/css3-animations/#the-animation-name-property-
2
+ // Each of these mixins support comma separated lists of values, which allows different transitions for individual properties to be described in a single style rule. Each value in the list corresponds to the value at that same position in the other properties.
3
+
4
+ @mixin animation-name ($name-1,
5
+ $name-2: false, $name-3: false,
6
+ $name-4: false, $name-5: false,
7
+ $name-6: false, $name-7: false,
8
+ $name-8: false, $name-9: false)
9
+ {
10
+ $full: compact($name-1, $name-2, $name-3, $name-4,
11
+ $name-5, $name-6, $name-7, $name-8, $name-9);
12
+
13
+ -webkit-animation-name: $full;
14
+ -moz-animation-name: $full;
15
+ animation-name: $full;
16
+ }
17
+
18
+
19
+ @mixin animation-duration ($time-1: 0,
20
+ $time-2: false, $time-3: false,
21
+ $time-4: false, $time-5: false,
22
+ $time-6: false, $time-7: false,
23
+ $time-8: false, $time-9: false)
24
+ {
25
+ $full: compact($time-1, $time-2, $time-3, $time-4,
26
+ $time-5, $time-6, $time-7, $time-8, $time-9);
27
+
28
+ -webkit-animation-duration: $full;
29
+ -moz-animation-duration: $full;
30
+ animation-duration: $full;
31
+ }
32
+
33
+
34
+ @mixin animation-timing-function ($motion-1: ease,
35
+ // ease | linear | ease-in | ease-out | ease-in-out
36
+ $motion-2: false, $motion-3: false,
37
+ $motion-4: false, $motion-5: false,
38
+ $motion-6: false, $motion-7: false,
39
+ $motion-8: false, $motion-9: false)
40
+ {
41
+ $full: compact($motion-1, $motion-2, $motion-3, $motion-4,
42
+ $motion-5, $motion-6, $motion-7, $motion-8, $motion-9);
43
+
44
+ -webkit-animation-timing-function: $full;
45
+ -moz-animation-timing-function: $full;
46
+ animation-timing-function: $full;
47
+ }
48
+
49
+
50
+ @mixin animation-iteration-count ($value-1: 1,
51
+ // infinite | <number>
52
+ $value-2: false, $value-3: false,
53
+ $value-4: false, $value-5: false,
54
+ $value-6: false, $value-7: false,
55
+ $value-8: false, $value-9: false)
56
+ {
57
+ $full: compact($value-1, $value-2, $value-3, $value-4,
58
+ $value-5, $value-6, $value-7, $value-8, $value-9);
59
+
60
+ -webkit-animation-iteration-count: $full;
61
+ -moz-animation-iteration-count: $full;
62
+ animation-iteration-count: $full;
63
+ }
64
+
65
+
66
+ @mixin animation-direction ($direction-1: normal,
67
+ // normal | alternate
68
+ $direction-2: false, $direction-3: false,
69
+ $direction-4: false, $direction-5: false,
70
+ $direction-6: false, $direction-7: false,
71
+ $direction-8: false, $direction-9: false)
72
+ {
73
+ $full: compact($direction-1, $direction-2, $direction-3, $direction-4,
74
+ $direction-5, $direction-6, $direction-7, $direction-8, $direction-9);
75
+
76
+ -webkit-animation-direction: $full;
77
+ -moz-animation-direction: $full;
78
+ animation-direction: $full;
79
+ }
80
+
81
+
82
+ @mixin animation-play-state ($state-1: running,
83
+ // running | paused
84
+ $state-2: false, $state-3: false,
85
+ $state-4: false, $state-5: false,
86
+ $state-6: false, $state-7: false,
87
+ $state-8: false, $state-9: false)
88
+ {
89
+ $full: compact($state-1, $state-2, $state-3, $state-4,
90
+ $state-5, $state-6, $state-7, $state-8, $state-9);
91
+
92
+ -webkit-animation-play-state: $full;
93
+ -moz-animation-play-state: $full;
94
+ animation-play-state: $full;
95
+ }
96
+
97
+
98
+ @mixin animation-delay ($time-1: 0,
99
+ $time-2: false, $time-3: false,
100
+ $time-4: false, $time-5: false,
101
+ $time-6: false, $time-7: false,
102
+ $time-8: false, $time-9: false)
103
+ {
104
+ $full: compact($time-1, $time-2, $time-3, $time-4,
105
+ $time-5, $time-6, $time-7, $time-8, $time-9);
106
+
107
+ -webkit-animation-delay: $full;
108
+ -moz-animation-delay: $full;
109
+ animation-delay: $full;
110
+ }
111
+
112
+
113
+ @mixin animation-fill-mode ($mode-1: none,
114
+ // http://goo.gl/l6ckm
115
+ // none | forwards | backwards | both
116
+ $mode-2: false, $mode-3: false,
117
+ $mode-4: false, $mode-5: false,
118
+ $mode-6: false, $mode-7: false,
119
+ $mode-8: false, $mode-9: false)
120
+ {
121
+ $full: compact($mode-1, $mode-2, $mode-3, $mode-4,
122
+ $mode-5, $mode-6, $mode-7, $mode-8, $mode-9);
123
+
124
+ -webkit-animation-fill-mode: $full;
125
+ -moz-animation-fill-mode: $full;
126
+ animation-fill-mode: $full;
127
+ }
128
+
129
+
130
+ // Shorthand for a basic animation. Supports multiple parentheses-deliminated values for each variable.
131
+ // Example: @include animation-basic((slideup, fadein), (1.0s, 2.0s), ease-in);
132
+ @mixin animation-basic ($name, $time: 0, $motion: ease) {
133
+ $length-of-name: length($name);
134
+ $length-of-time: length($time);
135
+ $length-of-motion: length($motion);
136
+
137
+ @if $length-of-name > 1 {
138
+ @include animation-name(zip($name));
139
+ } @else {
140
+ @include animation-name( $name);
141
+ }
142
+
143
+ @if $length-of-time > 1 {
144
+ @include animation-duration(zip($time));
145
+ } @else {
146
+ @include animation-duration( $time);
147
+ }
148
+
149
+ @if $length-of-motion > 1 {
150
+ @include animation-timing-function(zip($motion));
151
+ } @else {
152
+ @include animation-timing-function( $motion);
153
+ }
154
+ }
155
+
156
+ // Official animation shorthand property. Needs more work to actually be useful.
157
+ @mixin animation ($name, $duration, $timing-function, $delay, $iteration-count, $direction) {
158
+ -webkit-animation: $name $duration $timing-function $delay $iteration-count $direction;
159
+ -moz-animation: $name $duration $timing-function $delay $iteration-count $direction;
160
+ animation: $name $duration $timing-function $delay $iteration-count $direction;
161
+ }
@@ -0,0 +1,7 @@
1
+ @mixin border-radius ($radii) {
2
+ -webkit-border-radius: $radii;
3
+ -moz-border-radius: $radii;
4
+ -ms-border-radius: $radii;
5
+ -o-border-radius: $radii;
6
+ border-radius: $radii;
7
+ }
@@ -0,0 +1,16 @@
1
+ // Box-Shadow Mixin Requires Sass v3.1.1+
2
+ @mixin box-shadow ($shadow-1,
3
+ $shadow-2: false, $shadow-3: false,
4
+ $shadow-4: false, $shadow-5: false,
5
+ $shadow-6: false, $shadow-7: false,
6
+ $shadow-8: false, $shadow-9: false)
7
+ {
8
+ $full: compact($shadow-1, $shadow-2, $shadow-3, $shadow-4,
9
+ $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9);
10
+
11
+ -webkit-box-shadow: $full;
12
+ -moz-box-shadow: $full;
13
+ -ms-box-shadow: $full;
14
+ -o-box-shadow: $full;
15
+ box-shadow: $full;
16
+ }
@@ -0,0 +1,8 @@
1
+ @mixin box-sizing ($box) {
2
+ // content-box | border-box | inherit
3
+ -webkit-box-sizing: $box;
4
+ -moz-box-sizing: $box;
5
+ -ms-box-sizing: $box;
6
+ -o-box-sizing: $box;
7
+ box-sizing: $box;
8
+ }
@@ -0,0 +1,59 @@
1
+ // CSS3 Flexible Box Model and property defaults
2
+
3
+ @mixin display-box {
4
+ display: -webkit-box;
5
+ display: -moz-box;
6
+ display: box;
7
+ }
8
+
9
+ @mixin box-orient($orient: inline-axis) {
10
+ // horizontal|vertical|inline-axis|block-axis|inherit
11
+ -webkit-box-orient: $orient;
12
+ -moz-box-orient: $orient;
13
+ box-orient: $orient;
14
+ }
15
+
16
+ @mixin box-pack($pack: start) {
17
+ // start|end|center|justify
18
+ -webkit-box-pack: $pack;
19
+ -moz-box-pack: $pack;
20
+ box-pack: $pack;
21
+ }
22
+
23
+ @mixin box-align($align: stretch) {
24
+ // start|end|center|baseline|stretch
25
+ -webkit-box-align: $align;
26
+ -moz-box-align: $align;
27
+ box-align: $align;
28
+ }
29
+
30
+ @mixin box-direction($direction: normal) {
31
+ // normal|reverse|inherit
32
+ -webkit-box-direction: $direction;
33
+ -moz-box-direction: $direction;
34
+ box-direction: $direction;
35
+ }
36
+ @mixin box-lines($lines: single) {
37
+ // single|multiple
38
+ -webkit-box-lines: $lines;
39
+ -moz-box-lines: $lines;
40
+ box-lines: $lines;
41
+ }
42
+
43
+ @mixin box-ordinal-group($integer: 1) {
44
+ -webkit-box-ordinal-group: $integer;
45
+ -moz-box-ordinal-group: $integer;
46
+ box-ordinal-group: $integer;
47
+ }
48
+
49
+ @mixin box-flex($value: 0.0) {
50
+ -webkit-box-flex: $value;
51
+ -moz-box-flex: $value;
52
+ box-flex: $value;
53
+ }
54
+
55
+ @mixin box-flex-group($integer: 1) {
56
+ -webkit-box-flex-group: $integer;
57
+ -moz-box-flex-group: $integer;
58
+ box-flex-group: $integer;
59
+ }