bourbon 3.2.4 → 4.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +6 -6
  3. data/.npmignore +9 -11
  4. data/Gemfile.lock +49 -0
  5. data/{LICENSE.md → LICENSE} +10 -8
  6. data/app/assets/stylesheets/_bourbon-deprecated-upcoming.scss +3 -8
  7. data/app/assets/stylesheets/_bourbon.scss +9 -12
  8. data/app/assets/stylesheets/addons/_directional-values.scss +8 -5
  9. data/app/assets/stylesheets/addons/_html5-input-types.scss +15 -39
  10. data/app/assets/stylesheets/addons/_position.scss +5 -5
  11. data/app/assets/stylesheets/addons/_prefixer.scss +5 -5
  12. data/app/assets/stylesheets/addons/_rem.scss +33 -0
  13. data/app/assets/stylesheets/addons/_retina-image.scss +1 -1
  14. data/app/assets/stylesheets/addons/_size.scss +9 -37
  15. data/app/assets/stylesheets/addons/_timing-functions.scss +1 -1
  16. data/app/assets/stylesheets/addons/_triangle.scss +0 -1
  17. data/app/assets/stylesheets/css3/_background-image.scss +29 -35
  18. data/app/assets/stylesheets/css3/_background.scss +37 -85
  19. data/app/assets/stylesheets/css3/_border-image.scss +45 -42
  20. data/app/assets/stylesheets/css3/_flex-box.scss +14 -14
  21. data/app/assets/stylesheets/css3/_font-face.scss +1 -1
  22. data/app/assets/stylesheets/css3/_keyframes.scss +7 -7
  23. data/app/assets/stylesheets/functions/_assign.scss +11 -0
  24. data/app/assets/stylesheets/functions/_color-lightness.scss +5 -5
  25. data/app/assets/stylesheets/helpers/_convert-units.scss +15 -0
  26. data/app/assets/stylesheets/helpers/_is-num.scss +8 -0
  27. data/app/assets/stylesheets/helpers/_linear-angle-parser.scss +25 -0
  28. data/app/assets/stylesheets/helpers/_linear-gradient-parser.scss +41 -0
  29. data/app/assets/stylesheets/helpers/_linear-side-corner-parser.scss +31 -0
  30. data/app/assets/stylesheets/helpers/_radial-gradient-parser.scss +50 -0
  31. data/app/assets/stylesheets/helpers/_render-gradients.scss +2 -2
  32. data/app/assets/stylesheets/helpers/_str-to-num.scss +50 -0
  33. data/bourbon.gemspec +2 -2
  34. data/bower.json +6 -23
  35. data/dist/_bourbon-deprecated-upcoming.scss +3 -8
  36. data/dist/_bourbon.scss +9 -12
  37. data/dist/addons/_directional-values.scss +8 -5
  38. data/dist/addons/_html5-input-types.scss +15 -39
  39. data/dist/addons/_position.scss +5 -5
  40. data/dist/addons/_prefixer.scss +5 -5
  41. data/dist/addons/_rem.scss +33 -0
  42. data/dist/addons/_retina-image.scss +1 -1
  43. data/dist/addons/_size.scss +9 -37
  44. data/dist/addons/_timing-functions.scss +1 -1
  45. data/dist/addons/_triangle.scss +0 -1
  46. data/dist/css3/_background-image.scss +29 -35
  47. data/dist/css3/_background.scss +37 -85
  48. data/dist/css3/_border-image.scss +45 -42
  49. data/dist/css3/_flex-box.scss +14 -14
  50. data/dist/css3/_font-face.scss +1 -1
  51. data/dist/css3/_keyframes.scss +7 -7
  52. data/dist/functions/_assign.scss +11 -0
  53. data/dist/functions/_color-lightness.scss +5 -5
  54. data/dist/helpers/_convert-units.scss +15 -0
  55. data/dist/helpers/_is-num.scss +8 -0
  56. data/dist/helpers/_linear-angle-parser.scss +25 -0
  57. data/dist/helpers/_linear-gradient-parser.scss +41 -0
  58. data/dist/helpers/_linear-side-corner-parser.scss +31 -0
  59. data/dist/helpers/_radial-gradient-parser.scss +50 -0
  60. data/dist/helpers/_render-gradients.scss +2 -2
  61. data/dist/helpers/_str-to-num.scss +50 -0
  62. data/lib/bourbon/version.rb +1 -1
  63. data/package.json +14 -18
  64. data/readme.md +96 -0
  65. metadata +38 -33
  66. data/README.md +0 -126
  67. data/app/assets/stylesheets/addons/_word-wrap.scss +0 -8
  68. data/app/assets/stylesheets/css3/_inline-block.scss +0 -8
  69. data/app/assets/stylesheets/functions/_linear-gradient.scss +0 -13
  70. data/app/assets/stylesheets/functions/_px-to-rem.scss +0 -15
  71. data/app/assets/stylesheets/functions/_radial-gradient.scss +0 -23
  72. data/app/assets/stylesheets/settings/_asset-pipeline.scss +0 -1
  73. data/dist/addons/_word-wrap.scss +0 -8
  74. data/dist/css3/_inline-block.scss +0 -8
  75. data/dist/functions/_linear-gradient.scss +0 -13
  76. data/dist/functions/_px-to-rem.scss +0 -15
  77. data/dist/functions/_radial-gradient.scss +0 -23
  78. data/dist/settings/_asset-pipeline.scss +0 -1
@@ -1,5 +1,5 @@
1
1
  // CSS cubic-bezier timing functions. Timing functions courtesy of jquery.easie (github.com/jaukia/easie)
2
- // Timing functions are the same as demo'ed here: http://jqueryui.com/resources/demos/effect/easing.html
2
+ // Timing functions are the same as demo'ed here: http://jqueryui.com/demos/effect/easing.html
3
3
 
4
4
  // EASE IN
5
5
  $ease-in-quad: cubic-bezier(0.550, 0.085, 0.680, 0.530);
@@ -14,7 +14,6 @@
14
14
  @if ($direction == up) or ($direction == down) or ($direction == right) or ($direction == left) {
15
15
 
16
16
  $width: $width / 2;
17
- $height: if(length($size) > 1, $height, $height/2);
18
17
 
19
18
  @if $direction == up {
20
19
  border-left: $width solid $background-color;
@@ -4,45 +4,39 @@
4
4
  //************************************************************************//
5
5
 
6
6
  @mixin background-image($images...) {
7
- background-image: _add-prefix($images, webkit);
8
- background-image: _add-prefix($images);
9
- }
7
+ $webkit-images: ();
8
+ $spec-images: ();
9
+
10
+ @each $image in $images {
11
+ $webkit-image: ();
12
+ $spec-image: ();
13
+
14
+ @if (type-of($image) == string) {
15
+ $url-str: str-slice($image, 0, 3);
16
+ $gradient-type: str-slice($image, 0, 6);
10
17
 
11
- @function _add-prefix($images, $vendor: false) {
12
- $images-prefixed: ();
13
- $gradient-positions: false;
14
- @for $i from 1 through length($images) {
15
- $type: type-of(nth($images, $i)); // Get type of variable - List or String
16
-
17
- // If variable is a list - Gradient
18
- @if $type == list {
19
- $gradient-type: nth(nth($images, $i), 1); // linear or radial
20
- $gradient-pos: null;
21
- $gradient-args: null;
22
-
23
- @if ($gradient-type == linear) or ($gradient-type == radial) {
24
- $gradient-pos: nth(nth($images, $i), 2); // Get gradient position
25
- $gradient-args: nth(nth($images, $i), 3); // Get actual gradient (red, blue)
18
+ @if $url-str == "url" {
19
+ $webkit-image: $image;
20
+ $spec-image: $image;
26
21
  }
27
- @else {
28
- $gradient-args: nth(nth($images, $i), 2); // Get actual gradient (red, blue)
22
+
23
+ @else if $gradient-type == "linear" {
24
+ $gradients: _linear-gradient-parser($image);
25
+ $webkit-image: map-get($gradients, webkit-image);
26
+ $spec-image: map-get($gradients, spec-image);
29
27
  }
30
28
 
31
- $gradient-positions: _gradient-positions-parser($gradient-type, $gradient-pos);
32
- $gradient: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor);
33
- $images-prefixed: append($images-prefixed, $gradient, comma);
34
- }
35
- // If variable is a string - Image
36
- @else if $type == string {
37
- $images-prefixed: join($images-prefixed, nth($images, $i), comma);
29
+ @else if $gradient-type == "radial" {
30
+ $gradients: _radial-gradient-parser($image);
31
+ $webkit-image: map-get($gradients, webkit-image);
32
+ $spec-image: map-get($gradients, spec-image);
33
+ }
38
34
  }
35
+
36
+ $webkit-images: append($webkit-images, $webkit-image, comma);
37
+ $spec-images: append($spec-images, $spec-image, comma);
39
38
  }
40
- @return $images-prefixed;
41
- }
42
39
 
43
- //Examples:
44
- //@include background-image(linear-gradient(top, orange, red));
45
- //@include background-image(radial-gradient(50% 50%, cover circle, orange, red));
46
- //@include background-image(url("/images/a.png"), linear-gradient(orange, red));
47
- //@include background-image(url("image.png"), linear-gradient(orange, red), url("image.png"));
48
- //@include background-image(linear-gradient(hsla(0, 100%, 100%, 0.25) 0%, hsla(0, 100%, 100%, 0.08) 50%, transparent 50%), linear-gradient(orange, red));
40
+ background-image: $webkit-images;
41
+ background-image: $spec-images;
42
+ }
@@ -3,101 +3,53 @@
3
3
  // notation.
4
4
  //************************************************************************//
5
5
 
6
- @mixin background(
7
- $background-1 , $background-2: null,
8
- $background-3: null, $background-4: null,
9
- $background-5: null, $background-6: null,
10
- $background-7: null, $background-8: null,
11
- $background-9: null, $background-10: null,
12
- $fallback: null
13
- ) {
14
- $backgrounds: $background-1, $background-2,
15
- $background-3, $background-4,
16
- $background-5, $background-6,
17
- $background-7, $background-8,
18
- $background-9, $background-10;
6
+ @mixin background($backgrounds...) {
7
+ $webkit-backgrounds: ();
8
+ $spec-backgrounds: ();
19
9
 
20
- $fallback-color: false;
21
- @if (type-of($fallback) == color) or ($fallback == "transparent") {
22
- $fallback-color: $fallback;
23
- }
24
- @else {
25
- $fallback-color: _extract-background-color($backgrounds);
26
- }
27
-
28
- @if $fallback-color {
29
- background-color: $fallback-color;
30
- }
31
- background: _background-add-prefix($backgrounds, webkit);
32
- background: _background-add-prefix($backgrounds);
33
- }
34
-
35
- @function _extract-background-color($backgrounds) {
36
- $final-bg-layer: nth($backgrounds, length($backgrounds));
37
- @if type-of($final-bg-layer) == list {
38
- @for $i from 1 through length($final-bg-layer) {
39
- $value: nth($final-bg-layer, $i);
40
- @if type-of($value) == color {
41
- @return $value;
42
- }
43
- }
44
- }
45
- @return false;
46
- }
47
-
48
- @function _background-add-prefix($backgrounds, $vendor: false) {
49
- $backgrounds-prefixed: ();
10
+ @each $background in $backgrounds {
11
+ $webkit-background: ();
12
+ $spec-background: ();
13
+ $background-type: type-of($background);
50
14
 
51
- @for $i from 1 through length($backgrounds) {
52
- $shorthand: nth($backgrounds, $i); // Get member for current index
53
- $type: type-of($shorthand); // Get type of variable - List (gradient) or String (image)
15
+ @if $background-type == string or list {
16
+ $background-str: if($background-type == list, nth($background, 1), $background);
54
17
 
55
- // If shorthand is a list (gradient)
56
- @if $type == list {
57
- $first-member: nth($shorthand, 1); // Get first member of shorthand
18
+ $url-str: str-slice($background-str, 0, 3);
19
+ $gradient-type: str-slice($background-str, 0, 6);
58
20
 
59
- // Linear Gradient
60
- @if index(linear radial, nth($first-member, 1)) {
61
- $gradient-type: nth($first-member, 1); // linear || radial
62
- $gradient-args: false;
63
- $gradient-positions: false;
64
- $shorthand-start: false;
65
- @if type-of($first-member) == list { // Linear gradient plus additional shorthand values - lg(red,orange)repeat,...
66
- $gradient-positions: nth($first-member, 2);
67
- $gradient-args: nth($first-member, 3);
68
- $shorthand-start: 2;
69
- }
70
- @else { // Linear gradient only - lg(red,orange),...
71
- $gradient-positions: nth($shorthand, 2);
72
- $gradient-args: nth($shorthand, 3); // Get gradient (red, blue)
73
- }
21
+ @if $url-str == "url" {
22
+ $webkit-background: $background;
23
+ $spec-background: $background;
24
+ }
74
25
 
75
- $gradient-positions: _gradient-positions-parser($gradient-type, $gradient-positions);
76
- $gradient: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor);
26
+ @else if $gradient-type == "linear" {
27
+ $gradients: _linear-gradient-parser("#{$background}");
28
+ $webkit-background: map-get($gradients, webkit-image);
29
+ $spec-background: map-get($gradients, spec-image);
30
+ }
77
31
 
78
- // Append any additional shorthand args to gradient
79
- @if $shorthand-start {
80
- @for $j from $shorthand-start through length($shorthand) {
81
- $gradient: join($gradient, nth($shorthand, $j), space);
82
- }
83
- }
84
- $backgrounds-prefixed: append($backgrounds-prefixed, $gradient, comma);
32
+ @else if $gradient-type == "radial" {
33
+ $gradients: _radial-gradient-parser("#{$background}");
34
+ $webkit-background: map-get($gradients, webkit-image);
35
+ $spec-background: map-get($gradients, spec-image);
85
36
  }
86
- // Image with additional properties
37
+
87
38
  @else {
88
- $backgrounds-prefixed: append($backgrounds-prefixed, $shorthand, comma);
39
+ $webkit-background: $background;
40
+ $spec-background: $background;
89
41
  }
90
42
  }
91
- // If shorthand is a simple string (color or image)
92
- @else if $type == string {
93
- $backgrounds-prefixed: join($backgrounds-prefixed, $shorthand, comma);
43
+
44
+ @else {
45
+ $webkit-background: $background;
46
+ $spec-background: $background;
94
47
  }
48
+
49
+ $webkit-backgrounds: append($webkit-backgrounds, $webkit-background, comma);
50
+ $spec-backgrounds: append($spec-backgrounds, $spec-background, comma);
95
51
  }
96
- @return $backgrounds-prefixed;
97
- }
98
52
 
99
- //Examples:
100
- //@include background(linear-gradient(top, orange, red));
101
- //@include background(radial-gradient(circle at 40% 40%, orange, red));
102
- //@include background(url("/images/a.png") no-repeat, linear-gradient(orange, red));
103
- //@include background(url("image.png") center center, linear-gradient(orange, red), url("image.png"));
53
+ background: $webkit-backgrounds;
54
+ background: $spec-backgrounds;
55
+ }
@@ -1,49 +1,53 @@
1
- @mixin border-image($images) {
2
- -webkit-border-image: _border-add-prefix($images, webkit);
3
- -moz-border-image: _border-add-prefix($images, moz);
4
- -o-border-image: _border-add-prefix($images, o);
5
- border-image: _border-add-prefix($images);
6
- border-style: solid;
7
- }
1
+ @mixin border-image($borders...) {
2
+ $webkit-borders: ();
3
+ $spec-borders: ();
4
+
5
+ @each $border in $borders {
6
+ $webkit-border: ();
7
+ $spec-border: ();
8
+ $border-type: type-of($border);
9
+
10
+ @if $border-type == string or list {
11
+ $border-str: if($border-type == list, nth($border, 1), $border);
12
+
13
+ $url-str: str-slice($border-str, 0, 3);
14
+ $gradient-type: str-slice($border-str, 0, 6);
15
+
16
+ @if $url-str == "url" {
17
+ $webkit-border: $border;
18
+ $spec-border: $border;
19
+ }
20
+
21
+ @else if $gradient-type == "linear" {
22
+ $gradients: _linear-gradient-parser("#{$border}");
23
+ $webkit-border: map-get($gradients, webkit-image);
24
+ $spec-border: map-get($gradients, spec-image);
25
+ }
26
+
27
+ @else if $gradient-type == "radial" {
28
+ $gradients: _radial-gradient-parser("#{$border}");
29
+ $webkit-border: map-get($gradients, webkit-image);
30
+ $spec-border: map-get($gradients, spec-image);
31
+ }
8
32
 
9
- @function _border-add-prefix($images, $vendor: false) {
10
- $border-image: null;
11
- $images-type: type-of(nth($images, 1));
12
- $first-var: nth(nth($images, 1), 1); // Get type of Gradient (Linear || radial)
13
-
14
- // If input is a gradient
15
- @if $images-type == string {
16
- @if ($first-var == "linear") or ($first-var == "radial") {
17
- $gradient-type: nth($images, 1); // Get type of gradient (linear || radial)
18
- $gradient-pos: nth($images, 2); // Get gradient position
19
- $gradient-args: nth($images, 3); // Get actual gradient (red, blue)
20
- $gradient-positions: _gradient-positions-parser($gradient-type, $gradient-pos);
21
- $border-image: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor);
33
+ @else {
34
+ $webkit-border: $border;
35
+ $spec-border: $border;
36
+ }
22
37
  }
23
- // If input is a URL
38
+
24
39
  @else {
25
- $border-image: $images;
26
- }
27
- }
28
- // If input is gradient or url + additional args
29
- @else if $images-type == list {
30
- $type: type-of(nth($images, 1)); // Get type of variable - List or String
31
-
32
- // If variable is a list - Gradient
33
- @if $type == list {
34
- $gradient: nth($images, 1);
35
- $gradient-type: nth($gradient, 1); // Get type of gradient (linear || radial)
36
- $gradient-pos: nth($gradient, 2); // Get gradient position
37
- $gradient-args: nth($gradient, 3); // Get actual gradient (red, blue)
38
- $gradient-positions: _gradient-positions-parser($gradient-type, $gradient-pos);
39
- $border-image: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor);
40
-
41
- @for $i from 2 through length($images) {
42
- $border-image: append($border-image, nth($images, $i));
43
- }
40
+ $webkit-border: $border;
41
+ $spec-border: $border;
44
42
  }
43
+
44
+ $webkit-borders: append($webkit-borders, $webkit-border, comma);
45
+ $spec-borders: append($spec-borders, $spec-border, comma);
45
46
  }
46
- @return $border-image;
47
+
48
+ -webkit-border-image: $webkit-borders;
49
+ border-image: $spec-borders;
50
+ border-style: solid;
47
51
  }
48
52
 
49
53
  //Examples:
@@ -53,4 +57,3 @@
53
57
  // @include border-image(linear-gradient(45deg, orange, yellow) stretch);
54
58
  // @include border-image(linear-gradient(45deg, orange, yellow) 20 30 40 50 stretch round);
55
59
  // @include border-image(radial-gradient(top, cover, orange, yellow, orange));
56
-
@@ -78,7 +78,7 @@
78
78
  display: flex;
79
79
  }
80
80
 
81
- @else if $value == "inline-flex" {
81
+ @elseif $value == "inline-flex" {
82
82
  display: -webkit-inline-box;
83
83
  display: -moz-inline-box;
84
84
  display: inline-box;
@@ -124,16 +124,16 @@
124
124
  $value-2009: horizontal;
125
125
  }
126
126
 
127
- @else if $value == "row-reverse" {
127
+ @elseif $value == "row-reverse" {
128
128
  $value-2009: horizontal;
129
129
  $direction: reverse;
130
130
  }
131
131
 
132
- @else if $value == column {
132
+ @elseif $value == column {
133
133
  $value-2009: vertical;
134
134
  }
135
135
 
136
- @else if $value == "column-reverse" {
136
+ @elseif $value == "column-reverse" {
137
137
  $value-2009: vertical;
138
138
  $direction: reverse;
139
139
  }
@@ -162,11 +162,11 @@
162
162
  $alt-value: single;
163
163
  }
164
164
 
165
- @else if $value == wrap {
165
+ @elseif $value == wrap {
166
166
  $alt-value: multiple;
167
167
  }
168
168
 
169
- @else if $value == "wrap-reverse" {
169
+ @elseif $value == "wrap-reverse" {
170
170
  $alt-value: multiple;
171
171
  }
172
172
 
@@ -224,15 +224,15 @@
224
224
  $alt-value: start;
225
225
  }
226
226
 
227
- @else if $value == "flex-end" {
227
+ @elseif $value == "flex-end" {
228
228
  $alt-value: end;
229
229
  }
230
230
 
231
- @else if $value == "space-between" {
231
+ @elseif $value == "space-between" {
232
232
  $alt-value: justify;
233
233
  }
234
234
 
235
- @else if $value == "space-around" {
235
+ @elseif $value == "space-around" {
236
236
  $alt-value: center;
237
237
  }
238
238
 
@@ -257,7 +257,7 @@
257
257
  $alt-value: start;
258
258
  }
259
259
 
260
- @else if $value == "flex-end" {
260
+ @elseif $value == "flex-end" {
261
261
  $alt-value: end;
262
262
  }
263
263
 
@@ -280,7 +280,7 @@
280
280
  $value-2011: start;
281
281
  }
282
282
 
283
- @else if $value == "flex-end" {
283
+ @elseif $value == "flex-end" {
284
284
  $value-2011: end;
285
285
  }
286
286
 
@@ -300,15 +300,15 @@
300
300
  $value-2011: start;
301
301
  }
302
302
 
303
- @else if $value == "flex-end" {
303
+ @elseif $value == "flex-end" {
304
304
  $value-2011: end;
305
305
  }
306
306
 
307
- @else if $value == "space-between" {
307
+ @elseif $value == "space-between" {
308
308
  $value-2011: justify;
309
309
  }
310
310
 
311
- @else if $value == "space-around" {
311
+ @elseif $value == "space-around" {
312
312
  $value-2011: distribute;
313
313
  }
314
314
 
@@ -1,6 +1,6 @@
1
1
  // Order of the includes matters, and it is: normal, bold, italic, bold+italic.
2
2
 
3
- @mixin font-face($font-family, $file-path, $weight: normal, $style: normal, $asset-pipeline: $asset-pipeline) {
3
+ @mixin font-face($font-family, $file-path, $weight: normal, $style: normal, $asset-pipeline: false ) {
4
4
  @font-face {
5
5
  font-family: $font-family;
6
6
  font-weight: $weight;
@@ -8,24 +8,24 @@
8
8
 
9
9
  @if $original-prefix-for-webkit {
10
10
  @include disable-prefix-for-all();
11
- $prefix-for-webkit: true;
11
+ $prefix-for-webkit: true !global;
12
12
  @-webkit-keyframes #{$name} {
13
13
  @content;
14
14
  }
15
15
  }
16
16
  @if $original-prefix-for-mozilla {
17
17
  @include disable-prefix-for-all();
18
- $prefix-for-mozilla: true;
18
+ $prefix-for-mozilla: true !global;
19
19
  @-moz-keyframes #{$name} {
20
20
  @content;
21
21
  }
22
22
  }
23
23
 
24
- $prefix-for-webkit: $original-prefix-for-webkit;
25
- $prefix-for-mozilla: $original-prefix-for-mozilla;
26
- $prefix-for-microsoft: $original-prefix-for-microsoft;
27
- $prefix-for-opera: $original-prefix-for-opera;
28
- $prefix-for-spec: $original-prefix-for-spec;
24
+ $prefix-for-webkit: $original-prefix-for-webkit !global;
25
+ $prefix-for-mozilla: $original-prefix-for-mozilla !global;
26
+ $prefix-for-microsoft: $original-prefix-for-microsoft !global;
27
+ $prefix-for-opera: $original-prefix-for-opera !global;
28
+ $prefix-for-spec: $original-prefix-for-spec !global;
29
29
 
30
30
  @if $original-prefix-for-spec {
31
31
  @keyframes #{$name} {