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
@@ -0,0 +1,11 @@
1
+ @function assign-inputs($inputs, $pseudo: null) {
2
+ $list : ();
3
+
4
+ @each $input in $inputs {
5
+ $input: unquote($input);
6
+ $input: if($pseudo, $input + ":" + $pseudo, $input);
7
+ $list: append($list, $input, comma);
8
+ }
9
+
10
+ @return $list;
11
+ }
@@ -3,11 +3,11 @@
3
3
  // More details here http://robots.thoughtbot.com/closer-look-color-lightness
4
4
 
5
5
  @function is-light($hex-color) {
6
- $-local-red: red(rgba($hex-color, 1.0));
7
- $-local-green: green(rgba($hex-color, 1.0));
8
- $-local-blue: blue(rgba($hex-color, 1.0));
6
+ $red: red(rgba($hex-color, 1.0));
7
+ $green: green(rgba($hex-color, 1.0));
8
+ $blue: blue(rgba($hex-color, 1.0));
9
9
 
10
- $-local-lightness: ($-local-red * 0.2126 + $-local-green * 0.7152 + $-local-blue * 0.0722) / 255;
10
+ $lightness: ($red * 0.2126 + $green * 0.7152 + $blue * 0.0722) / 255;
11
11
 
12
- @return $-local-lightness > .6;
12
+ @return $lightness > .6;
13
13
  }
@@ -0,0 +1,15 @@
1
+ //************************************************************************//
2
+ // Helper function for str-to-num fn.
3
+ // Source: http://sassmeister.com/gist/9647408
4
+ //************************************************************************//
5
+ @function _convert-units($number, $unit) {
6
+ $strings: 'px' 'cm' 'mm' '%' 'ch' 'pica' 'in' 'em' 'rem' 'pt' 'pc' 'ex' 'vw' 'vh' 'vmin' 'vmax', 'deg', 'rad', 'grad', 'turn';
7
+ $units: 1px 1cm 1mm 1% 1ch 1pica 1in 1em 1rem 1pt 1pc 1ex 1vw 1vh 1vmin 1vmax, 1deg, 1rad, 1grad, 1turn;
8
+ $index: index($strings, $unit);
9
+
10
+ @if not $index {
11
+ @warn "Unknown unit `#{$unit}`.";
12
+ @return false;
13
+ }
14
+ @return $number * nth($units, $index);
15
+ }
@@ -0,0 +1,8 @@
1
+ //************************************************************************//
2
+ // Helper for linear-gradient-parser
3
+ //************************************************************************//
4
+ @function _is-num($char) {
5
+ $strings: "0 1 2 3 4 5 6 7 8 9";
6
+ $index: str-index($strings, $char);
7
+ @return if($index, true, false);
8
+ }
@@ -0,0 +1,25 @@
1
+ // Private function for linear-gradient-parser
2
+ @function _linear-angle-parser($image, $first-val, $prefix, $suffix) {
3
+ $offset: null;
4
+ $unit-short: str-slice($first-val, str-length($first-val) - 2, str-length($first-val));
5
+ $unit-long: str-slice($first-val, str-length($first-val) - 3, str-length($first-val));
6
+
7
+ @if ($unit-long == "grad") or
8
+ ($unit-long == "turn") {
9
+ $offset: if($unit-long == "grad", -100grad * 3, -0.75turn);
10
+ }
11
+
12
+ @else if ($unit-short == "deg") or
13
+ ($unit-short == "rad") {
14
+ $offset: if($unit-short == "deg", -90 * 3, 1.6rad);
15
+ }
16
+
17
+ @if $offset {
18
+ $num: _str-to-num($first-val);
19
+
20
+ @return (
21
+ webkit-image: -webkit- + $prefix + ($offset - $num) + $suffix,
22
+ spec-image: $image
23
+ );
24
+ }
25
+ }
@@ -0,0 +1,41 @@
1
+ @function _linear-gradient-parser($image) {
2
+ $image: unquote($image);
3
+ $gradients: ();
4
+ $start: str-index($image, "(");
5
+ $end: str-index($image, ",");
6
+ $first-val: str-slice($image, $start + 1, $end - 1);
7
+
8
+ $prefix: str-slice($image, 0, $start);
9
+ $suffix: str-slice($image, $end, str-length($image));
10
+
11
+ $has-multiple-vals: str-index($first-val, " ");
12
+ $has-single-position: unquote(_position-flipper($first-val) + "");
13
+ $has-angle: _is-num(str-slice($first-val, 0, 0));
14
+
15
+ @if $has-multiple-vals {
16
+ $gradients: _linear-side-corner-parser($image, $first-val, $prefix, $suffix, $has-multiple-vals);
17
+ }
18
+
19
+ @else if $has-single-position != "" {
20
+ $pos: unquote($has-single-position + "");
21
+
22
+ $gradients: (
23
+ webkit-image: -webkit- + $image,
24
+ spec-image: $prefix + "to " + $pos + $suffix
25
+ );
26
+ }
27
+
28
+ @else if $has-angle {
29
+ // Rotate degree for webkit
30
+ $gradients: _linear-angle-parser($image, $first-val, $prefix, $suffix);
31
+ }
32
+
33
+ @else {
34
+ $gradients: (
35
+ webkit-image: -webkit- + $image,
36
+ spec-image: $image
37
+ );
38
+ }
39
+
40
+ @return $gradients;
41
+ }
@@ -0,0 +1,31 @@
1
+ // Private function for linear-gradient-parser
2
+ @function _linear-side-corner-parser($image, $first-val, $prefix, $suffix, $has-multiple-vals) {
3
+ $val-1: str-slice($first-val, 0, $has-multiple-vals - 1 );
4
+ $val-2: str-slice($first-val, $has-multiple-vals + 1, str-length($first-val));
5
+ $val-3: null;
6
+ $has-val-3: str-index($val-2, " ");
7
+
8
+ @if $has-val-3 {
9
+ $val-3: str-slice($val-2, $has-val-3 + 1, str-length($val-2));
10
+ $val-2: str-slice($val-2, 0, $has-val-3 - 1);
11
+ }
12
+
13
+ $pos: _position-flipper($val-1) _position-flipper($val-2) _position-flipper($val-3);
14
+ $pos: unquote($pos + "");
15
+
16
+ // Use old spec for webkit
17
+ @if $val-1 == "to" {
18
+ @return (
19
+ webkit-image: -webkit- + $prefix + $pos + $suffix,
20
+ spec-image: $image
21
+ );
22
+ }
23
+
24
+ // Bring the code up to spec
25
+ @else {
26
+ @return (
27
+ webkit-image: -webkit- + $image,
28
+ spec-image: $prefix + "to " + $pos + $suffix
29
+ );
30
+ }
31
+ }
@@ -0,0 +1,50 @@
1
+ @function _radial-gradient-parser($image) {
2
+ $image: unquote($image);
3
+ $gradients: ();
4
+ $start: str-index($image, "(");
5
+ $end: str-index($image, ",");
6
+ $first-val: str-slice($image, $start + 1, $end - 1);
7
+
8
+ $prefix: str-slice($image, 0, $start);
9
+ $suffix: str-slice($image, $end, str-length($image));
10
+
11
+ $is-spec-syntax: str-index($first-val, "at");
12
+
13
+ @if $is-spec-syntax and $is-spec-syntax > 1 {
14
+ $keyword: str-slice($first-val, 1, $is-spec-syntax - 2);
15
+ $pos: str-slice($first-val, $is-spec-syntax + 3, str-length($first-val));
16
+ $pos: append($pos, $keyword, comma);
17
+
18
+ $gradients: (
19
+ webkit-image: -webkit- + $prefix + $pos + $suffix,
20
+ spec-image: $image
21
+ )
22
+ }
23
+
24
+ @else if $is-spec-syntax == 1 {
25
+ $pos: str-slice($first-val, $is-spec-syntax + 3, str-length($first-val));
26
+
27
+ $gradients: (
28
+ webkit-image: -webkit- + $prefix + $pos + $suffix,
29
+ spec-image: $image
30
+ )
31
+ }
32
+
33
+ @else if str-index($image, "cover") or str-index($image, "contain") {
34
+ @warn "Radial-gradient needs to be updated to conform to latest spec.";
35
+
36
+ $gradients: (
37
+ webkit-image: null,
38
+ spec-image: $image
39
+ )
40
+ }
41
+
42
+ @else {
43
+ $gradients: (
44
+ webkit-image: -webkit- + $image,
45
+ spec-image: $image
46
+ )
47
+ }
48
+
49
+ @return $gradients;
50
+ }
@@ -16,11 +16,11 @@
16
16
  }
17
17
 
18
18
  @if $vendor {
19
- $vendor-gradients: "-#{$vendor}-#{$gradient-type}-gradient(#{$pre-spec} #{$gradients})";
19
+ $vendor-gradients: -#{$vendor}-#{$gradient-type}-gradient(#{$pre-spec} $gradients);
20
20
  }
21
21
  @else if $vendor == false {
22
22
  $vendor-gradients: "#{$gradient-type}-gradient(#{$spec} #{$gradients})";
23
+ $vendor-gradients: unquote($vendor-gradients);
23
24
  }
24
- $vendor-gradients: unquote($vendor-gradients);
25
25
  @return $vendor-gradients;
26
26
  }
@@ -0,0 +1,50 @@
1
+ //************************************************************************//
2
+ // Helper function for linear/radial-gradient-parsers.
3
+ // Source: http://sassmeister.com/gist/9647408
4
+ //************************************************************************//
5
+ @function _str-to-num($string) {
6
+ // Matrices
7
+ $strings: '0' '1' '2' '3' '4' '5' '6' '7' '8' '9';
8
+ $numbers: 0 1 2 3 4 5 6 7 8 9;
9
+
10
+ // Result
11
+ $result: 0;
12
+ $divider: 0;
13
+ $minus: false;
14
+
15
+ // Looping through all characters
16
+ @for $i from 1 through str-length($string) {
17
+ $character: str-slice($string, $i, $i);
18
+ $index: index($strings, $character);
19
+
20
+ @if $character == '-' {
21
+ $minus: true;
22
+ }
23
+
24
+ @else if $character == '.' {
25
+ $divider: 1;
26
+ }
27
+
28
+ @else {
29
+ @if not $index {
30
+ $result: if($minus, $result * -1, $result);
31
+ @return _convert-units($result, str-slice($string, $i));
32
+ }
33
+
34
+ $number: nth($numbers, $index);
35
+
36
+ @if $divider == 0 {
37
+ $result: $result * 10;
38
+ }
39
+
40
+ @else {
41
+ // Move the decimal dot to the left
42
+ $divider: $divider * 10;
43
+ $number: $number / $divider;
44
+ }
45
+
46
+ $result: $result + $number;
47
+ }
48
+ }
49
+ @return if($minus, $result * -1, $result);
50
+ }
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
6
6
  s.name = "bourbon"
7
7
  s.version = Bourbon::VERSION
8
8
  s.platform = Gem::Platform::RUBY
9
- s.authors = ["Phil LaPier", "Chad Mazzola", "Matt Jankowski", "Nick Quaranto", "Jeremy Raines", "Mike Burns", "Andres Mejia", "Travis Haynes", "Chris Lloyd", "Gabe Berke-Williams", "J. Edward Dewyea", "Reda Lemeden", "Kyle Fiedler"]
9
+ s.authors = ["Phil LaPier", "Chad Mazzola", "Matt Jankowski", "Nick Quaranto", "Jeremy Raines", "Mike Burns", "Andres Mejia", "Travis Haynes", "Chris Lloyd", "Gabe Berke-Williams", "J. Edward Dewyea", "Reda Lemeden"]
10
10
  s.email = ["support@thoughtbot.com"]
11
11
  s.license = 'MIT'
12
12
  s.homepage = "https://github.com/thoughtbot/bourbon"
@@ -27,7 +27,7 @@ that support only CSS3 prefixed properties.
27
27
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
28
28
  s.require_paths = ["lib"]
29
29
 
30
- s.add_dependency('sass', '~> 3.2')
30
+ s.add_dependency('sass', '~> 3.3')
31
31
  s.add_dependency('thor')
32
32
 
33
33
  s.add_development_dependency('aruba', '~> 0.4')
data/bower.json CHANGED
@@ -1,34 +1,17 @@
1
1
  {
2
2
  "name": "bourbon",
3
- "description": "A simple and lightweight mixin library for Sass.",
4
- "version": "3.2.4",
3
+ "homepage": "http://bourbon.io/",
4
+ "version": "4.0.0-rc.1",
5
5
  "main": "dist/_bourbon.scss",
6
- "license": "MIT",
7
6
  "ignore": [
8
- "**/.*",
9
7
  "app",
10
8
  "bin",
11
- "bourbon.gemspec",
12
9
  "features",
13
- "LICENSE.md",
14
10
  "lib",
11
+ ".gitignore",
15
12
  "Gemfile",
16
13
  "Gemfile.lock",
17
- "package.json",
18
- "Rakefile"
19
- ],
20
- "keywords": [
21
- "css",
22
- "mixins",
23
- "sass",
24
- "scss"
25
- ],
26
- "authors": [
27
- "thoughtbot (http://thoughtbot.com)"
28
- ],
29
- "homepage": "http://bourbon.io",
30
- "repository": {
31
- "type": "git",
32
- "url": "https://github.com/thoughtbot/bourbon.git"
33
- }
14
+ "Rakefile",
15
+ "bourbon.gemspec"
16
+ ]
34
17
  }
@@ -2,12 +2,7 @@
2
2
  // These mixins/functions are deprecated
3
3
  // They will be removed in the next MAJOR version release
4
4
  //************************************************************************//
5
- @mixin box-shadow ($shadows...) {
6
- @include prefixer(box-shadow, $shadows, spec);
7
- @warn "box-shadow is deprecated and will be removed in the next major version release";
8
- }
9
-
10
- @mixin background-size ($lengths...) {
11
- @include prefixer(background-size, $lengths, spec);
12
- @warn "background-size is deprecated and will be removed in the next major version release";
5
+ @mixin inline-block {
6
+ display: inline-block;
7
+ @warn "inline-block mixin is deprecated and will be removed in the next major version release";
13
8
  }
@@ -1,31 +1,30 @@
1
- // Bourbon 3.2.4
2
- // http://bourbon.io
3
- // Copyright 2011-2015 thoughtbot, inc.
4
- // MIT License
5
-
6
1
  // Settings
7
2
  @import "settings/prefixer";
8
3
  @import "settings/px-to-em";
9
- @import "settings/asset-pipeline";
10
4
 
11
5
  // Custom Helpers
6
+ @import "helpers/convert-units";
12
7
  @import "helpers/gradient-positions-parser";
8
+ @import "helpers/is-num";
9
+ @import "helpers/linear-angle-parser";
10
+ @import "helpers/linear-gradient-parser";
13
11
  @import "helpers/linear-positions-parser";
12
+ @import "helpers/linear-side-corner-parser";
14
13
  @import "helpers/radial-arg-parser";
15
14
  @import "helpers/radial-positions-parser";
15
+ @import "helpers/radial-gradient-parser";
16
16
  @import "helpers/render-gradients";
17
17
  @import "helpers/shape-size-stripper";
18
+ @import "helpers/str-to-num";
18
19
 
19
20
  // Custom Functions
21
+ @import "functions/assign";
20
22
  @import "functions/color-lightness";
21
23
  @import "functions/flex-grid";
22
24
  @import "functions/golden-ratio";
23
25
  @import "functions/grid-width";
24
- @import "functions/linear-gradient";
25
26
  @import "functions/modular-scale";
26
27
  @import "functions/px-to-em";
27
- @import "functions/px-to-rem";
28
- @import "functions/radial-gradient";
29
28
  @import "functions/strip-units";
30
29
  @import "functions/tint-shade";
31
30
  @import "functions/transition-property-name";
@@ -45,11 +44,9 @@
45
44
  @import "css3/filter";
46
45
  @import "css3/flex-box";
47
46
  @import "css3/font-face";
48
- @import "css3/font-feature-settings";
49
47
  @import "css3/hyphens";
50
48
  @import "css3/hidpi-media-query";
51
49
  @import "css3/image-rendering";
52
- @import "css3/inline-block";
53
50
  @import "css3/keyframes";
54
51
  @import "css3/linear-gradient";
55
52
  @import "css3/perspective";
@@ -69,11 +66,11 @@
69
66
  @import "addons/html5-input-types";
70
67
  @import "addons/position";
71
68
  @import "addons/prefixer";
69
+ @import "addons/rem";
72
70
  @import "addons/retina-image";
73
71
  @import "addons/size";
74
72
  @import "addons/timing-functions";
75
73
  @import "addons/triangle";
76
- @import "addons/word-wrap";
77
74
 
78
75
  // Soon to be deprecated Mixins
79
76
  @import "bourbon-deprecated-upcoming";
@@ -57,6 +57,9 @@
57
57
  $right: $pre + "-right" + if($suf, "-#{$suf}", "");
58
58
  $all: $pre + if($suf, "-#{$suf}", "");
59
59
 
60
+ // Get list inside $vals (is there a better way?)
61
+ @each $val in $vals { $vals: $val; }
62
+
60
63
  $vals: collapse-directionals($vals);
61
64
 
62
65
  @if contains-falsy($vals) {
@@ -91,21 +94,21 @@
91
94
  }
92
95
 
93
96
  @mixin margin($vals...) {
94
- @include directional-property(margin, false, $vals...);
97
+ @include directional-property(margin, false, $vals);
95
98
  }
96
99
 
97
100
  @mixin padding($vals...) {
98
- @include directional-property(padding, false, $vals...);
101
+ @include directional-property(padding, false, $vals);
99
102
  }
100
103
 
101
104
  @mixin border-style($vals...) {
102
- @include directional-property(border, style, $vals...);
105
+ @include directional-property(border, style, $vals);
103
106
  }
104
107
 
105
108
  @mixin border-color($vals...) {
106
- @include directional-property(border, color, $vals...);
109
+ @include directional-property(border, color, $vals);
107
110
  }
108
111
 
109
112
  @mixin border-width($vals...) {
110
- @include directional-property(border, width, $vals...);
113
+ @include directional-property(border, width, $vals);
111
114
  }