bourbon 4.1.1 → 4.2.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -3
  3. data/.hound.yml +4 -0
  4. data/.npmignore +5 -2
  5. data/.scss-lint.yml +175 -0
  6. data/README.md +7 -12
  7. data/Rakefile +6 -4
  8. data/app/assets/stylesheets/_bourbon-deprecated-upcoming.scss +16 -7
  9. data/app/assets/stylesheets/_bourbon.scss +27 -26
  10. data/app/assets/stylesheets/addons/_border-color.scss +26 -0
  11. data/app/assets/stylesheets/addons/_border-radius.scss +48 -0
  12. data/app/assets/stylesheets/addons/_border-style.scss +25 -0
  13. data/app/assets/stylesheets/addons/_border-width.scss +25 -0
  14. data/app/assets/stylesheets/addons/_buttons.scss +64 -0
  15. data/app/assets/stylesheets/addons/_clearfix.scss +17 -10
  16. data/app/assets/stylesheets/addons/_ellipsis.scss +22 -0
  17. data/app/assets/stylesheets/addons/{_font-family.scss → _font-stacks.scss} +26 -0
  18. data/app/assets/stylesheets/addons/_hide-text.scss +23 -8
  19. data/app/assets/stylesheets/addons/_margin.scss +26 -0
  20. data/app/assets/stylesheets/addons/_padding.scss +26 -0
  21. data/app/assets/stylesheets/addons/_position.scss +24 -2
  22. data/app/assets/stylesheets/addons/_prefixer.scss +36 -15
  23. data/app/assets/stylesheets/addons/_size.scss +30 -1
  24. data/app/assets/stylesheets/addons/_text-inputs.scss +112 -0
  25. data/app/assets/stylesheets/addons/_timing-functions.scss +7 -5
  26. data/app/assets/stylesheets/addons/_triangle.scss +11 -11
  27. data/app/assets/stylesheets/addons/_word-wrap.scss +19 -0
  28. data/app/assets/stylesheets/css3/_animation.scss +14 -23
  29. data/app/assets/stylesheets/css3/_appearance.scss +1 -1
  30. data/app/assets/stylesheets/css3/_backface-visibility.scss +0 -3
  31. data/app/assets/stylesheets/css3/_background-image.scss +1 -1
  32. data/app/assets/stylesheets/css3/_background.scss +3 -3
  33. data/app/assets/stylesheets/css3/_border-image.scss +3 -3
  34. data/app/assets/stylesheets/css3/_calc.scss +1 -1
  35. data/app/assets/stylesheets/css3/_columns.scss +8 -8
  36. data/app/assets/stylesheets/css3/_filter.scss +0 -1
  37. data/app/assets/stylesheets/css3/_flex-box.scss +16 -47
  38. data/app/assets/stylesheets/css3/_font-feature-settings.scss +1 -7
  39. data/app/assets/stylesheets/css3/_hyphens.scss +2 -2
  40. data/app/assets/stylesheets/css3/_image-rendering.scss +6 -6
  41. data/app/assets/stylesheets/css3/_keyframes.scss +1 -0
  42. data/app/assets/stylesheets/css3/_linear-gradient.scss +11 -11
  43. data/app/assets/stylesheets/css3/_radial-gradient.scss +14 -14
  44. data/app/assets/stylesheets/css3/_selection.scss +39 -11
  45. data/app/assets/stylesheets/css3/_transform.scss +5 -5
  46. data/app/assets/stylesheets/css3/_transition.scss +17 -23
  47. data/app/assets/stylesheets/css3/_user-select.scss +2 -2
  48. data/app/assets/stylesheets/functions/{_assign.scss → _assign-inputs.scss} +2 -2
  49. data/app/assets/stylesheets/functions/_contains-falsy.scss +20 -0
  50. data/app/assets/stylesheets/functions/_contains.scss +16 -2
  51. data/app/assets/stylesheets/functions/_is-length.scss +5 -1
  52. data/app/assets/stylesheets/functions/_is-light.scss +21 -0
  53. data/app/assets/stylesheets/functions/_is-number.scss +11 -0
  54. data/app/assets/stylesheets/functions/_is-size.scss +8 -1
  55. data/app/assets/stylesheets/functions/_px-to-em.scss +2 -2
  56. data/app/assets/stylesheets/functions/_px-to-rem.scss +2 -2
  57. data/app/assets/stylesheets/functions/_shade.scss +24 -0
  58. data/app/assets/stylesheets/functions/_strip-units.scss +15 -3
  59. data/app/assets/stylesheets/functions/_tint.scss +24 -0
  60. data/app/assets/stylesheets/functions/_transition-property-name.scss +14 -14
  61. data/app/assets/stylesheets/functions/_unpack.scss +18 -8
  62. data/app/assets/stylesheets/helpers/_convert-units.scss +2 -2
  63. data/app/assets/stylesheets/helpers/_directional-values.scss +96 -0
  64. data/app/assets/stylesheets/helpers/_font-source-declaration.scss +2 -1
  65. data/app/assets/stylesheets/helpers/_linear-gradient-parser.scss +1 -1
  66. data/app/assets/stylesheets/helpers/_linear-positions-parser.scss +1 -1
  67. data/app/assets/stylesheets/helpers/_radial-arg-parser.scss +10 -10
  68. data/app/assets/stylesheets/helpers/_radial-gradient-parser.scss +4 -4
  69. data/app/assets/stylesheets/helpers/_radial-positions-parser.scss +2 -2
  70. data/app/assets/stylesheets/helpers/_str-to-num.scss +3 -3
  71. data/app/assets/stylesheets/settings/_asset-pipeline.scss +6 -0
  72. data/app/assets/stylesheets/settings/_prefixer.scss +5 -2
  73. data/bourbon.gemspec +4 -2
  74. data/bower.json +8 -6
  75. data/lib/bourbon/version.rb +1 -1
  76. data/package.json +1 -1
  77. data/spec/bourbon/functions/assign_inputs_spec.rb +50 -0
  78. data/spec/bourbon/functions/contains_spec.rb +27 -0
  79. data/spec/bourbon/functions/is_length_spec.rb +49 -0
  80. data/spec/bourbon/functions/is_light_spec.rb +37 -0
  81. data/spec/bourbon/functions/is_number_spec.rb +43 -0
  82. data/spec/bourbon/functions/is_size_spec.rb +43 -0
  83. data/spec/bourbon/functions/modular_scale_spec.rb +43 -0
  84. data/spec/bourbon/functions/px_to_em_spec.rb +31 -0
  85. data/spec/fixtures/_setup.scss +1 -0
  86. data/spec/fixtures/functions/assign-inputs.scss +19 -0
  87. data/spec/fixtures/functions/contains.scss +28 -0
  88. data/spec/fixtures/functions/is-length.scss +35 -0
  89. data/spec/fixtures/functions/is-light.scss +29 -0
  90. data/spec/fixtures/functions/is-number.scss +31 -0
  91. data/spec/fixtures/functions/is-size.scss +31 -0
  92. data/spec/fixtures/functions/modular-scale.scss +29 -0
  93. data/spec/fixtures/functions/px-to-em.scss +17 -0
  94. data/spec/spec_helper.rb +22 -0
  95. data/spec/support/matchers/be_contained_in.rb +10 -0
  96. data/spec/support/matchers/have_rule.rb +35 -0
  97. data/spec/support/matchers/have_value.rb +15 -0
  98. data/spec/support/parser_support.rb +16 -0
  99. data/spec/support/sass_support.rb +10 -0
  100. metadata +102 -19
  101. data/app/assets/stylesheets/addons/_directional-values.scss +0 -111
  102. data/app/assets/stylesheets/addons/_html5-input-types.scss +0 -90
  103. data/app/assets/stylesheets/css3/_border-radius.scss +0 -22
  104. data/app/assets/stylesheets/css3/_box-sizing.scss +0 -4
  105. data/app/assets/stylesheets/functions/_color-lightness.scss +0 -13
  106. data/app/assets/stylesheets/functions/_tint-shade.scss +0 -9
  107. data/app/assets/stylesheets/helpers/_is-num.scss +0 -5
@@ -18,7 +18,7 @@
18
18
  $gradients: (
19
19
  webkit-image: -webkit- + $prefix + $pos + $suffix,
20
20
  spec-image: $image
21
- )
21
+ );
22
22
  }
23
23
 
24
24
  @else if $is-spec-syntax == 1 {
@@ -27,7 +27,7 @@
27
27
  $gradients: (
28
28
  webkit-image: -webkit- + $prefix + $pos + $suffix,
29
29
  spec-image: $image
30
- )
30
+ );
31
31
  }
32
32
 
33
33
  @else if str-index($image, "cover") or str-index($image, "contain") {
@@ -36,14 +36,14 @@
36
36
  $gradients: (
37
37
  webkit-image: null,
38
38
  spec-image: $image
39
- )
39
+ );
40
40
  }
41
41
 
42
42
  @else {
43
43
  $gradients: (
44
44
  webkit-image: -webkit- + $image,
45
45
  spec-image: $image
46
- )
46
+ );
47
47
  }
48
48
 
49
49
  @return $gradients;
@@ -10,8 +10,8 @@
10
10
  $spec: "#{$shape-size-spec} #{$pos-spec}";
11
11
 
12
12
  // Add comma
13
- @if ($spec != ' ') {
14
- $spec: "#{$spec},"
13
+ @if ($spec != " ") {
14
+ $spec: "#{$spec},";
15
15
  }
16
16
 
17
17
  @return $pre-spec $spec;
@@ -4,7 +4,7 @@
4
4
  //************************************************************************//
5
5
  @function _str-to-num($string) {
6
6
  // Matrices
7
- $strings: '0' '1' '2' '3' '4' '5' '6' '7' '8' '9';
7
+ $strings: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9";
8
8
  $numbers: 0 1 2 3 4 5 6 7 8 9;
9
9
 
10
10
  // Result
@@ -17,11 +17,11 @@
17
17
  $character: str-slice($string, $i, $i);
18
18
  $index: index($strings, $character);
19
19
 
20
- @if $character == '-' {
20
+ @if $character == "-" {
21
21
  $minus: true;
22
22
  }
23
23
 
24
- @else if $character == '.' {
24
+ @else if $character == "." {
25
25
  $divider: 1;
26
26
  }
27
27
 
@@ -1 +1,7 @@
1
+ @charset "UTF-8";
2
+
3
+ /// A global setting to enable or disable the `$asset-pipeline` variable for all functions that accept it.
4
+ ///
5
+ /// @type Bool
6
+
1
7
  $asset-pipeline: false !default;
@@ -1,6 +1,9 @@
1
- // Variable settings for /addons/prefixer.scss
1
+ @charset "UTF-8";
2
+
3
+ /// Global variables to enable or disable vendor prefixes
4
+
2
5
  $prefix-for-webkit: true !default;
3
6
  $prefix-for-mozilla: true !default;
4
7
  $prefix-for-microsoft: true !default;
5
8
  $prefix-for-opera: true !default;
6
- $prefix-for-spec: true !default; // required for keyframe mixin
9
+ $prefix-for-spec: true !default;
@@ -24,9 +24,11 @@ meaning they should be as close to the original CSS syntax as possible.
24
24
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
25
25
  s.require_paths = ['lib']
26
26
 
27
- s.add_dependency('sass', '~> 3.3')
27
+ s.add_dependency('sass', '~> 3.4')
28
28
  s.add_dependency('thor')
29
29
 
30
- s.add_development_dependency('aruba', '~> 0.4')
30
+ s.add_development_dependency('aruba')
31
31
  s.add_development_dependency('rake')
32
+ s.add_development_dependency('rspec')
33
+ s.add_development_dependency('css_parser')
32
34
  end
data/bower.json CHANGED
@@ -1,21 +1,23 @@
1
1
  {
2
2
  "name": "bourbon",
3
3
  "description": "A simple and lightweight mixin library for Sass.",
4
- "version": "4.1.1",
4
+ "version": "4.2.0.beta",
5
5
  "main": "app/assets/stylesheets/_bourbon.scss",
6
6
  "license": "MIT",
7
7
  "ignore": [
8
8
  "**/.*",
9
+ "CONTRIBUTING.md",
10
+ "Gemfile",
11
+ "Gemfile.lock",
12
+ "Rakefile",
13
+ "_site",
9
14
  "bin",
10
15
  "bourbon.gemspec",
11
- "CONTRIBUTING.md",
12
16
  "features",
13
- "LICENSE.md",
14
17
  "lib",
15
- "Gemfile",
16
- "Gemfile.lock",
17
18
  "package.json",
18
- "Rakefile"
19
+ "sache.json",
20
+ "spec"
19
21
  ],
20
22
  "keywords": [
21
23
  "css",
@@ -1,3 +1,3 @@
1
1
  module Bourbon
2
- VERSION = "4.1.1"
2
+ VERSION = "4.2.0.beta"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bourbon",
3
- "version": "4.1.1",
3
+ "version": "4.2.0.beta",
4
4
  "description": "A simple and lightweight mixin library for Sass.",
5
5
  "keywords": [
6
6
  "css",
@@ -0,0 +1,50 @@
1
+ require "spec_helper"
2
+
3
+ describe "assign-inputs" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("functions/assign-inputs")
6
+ @text_inputs_list = [
7
+ "input[type=\"password\"]",
8
+ "input[type=\"text\"]",
9
+ "textarea"
10
+ ]
11
+ end
12
+
13
+ context "expands plain text inputs" do
14
+ it "finds selectors" do
15
+ @text_inputs_list.each do |input|
16
+ expect(input).to have_rule("color: #ff0000")
17
+ end
18
+ end
19
+ end
20
+
21
+ context "expands text inputs with pseudo classes" do
22
+ it "finds selectors" do
23
+ list = @text_inputs_list.dup
24
+ list.map! { |input| input + ":active" }
25
+ list.each do |input|
26
+ expect(input).to have_rule("color: #00ff00")
27
+ end
28
+ end
29
+ end
30
+
31
+ context "expands text inputs when first in list" do
32
+ it "finds selectors" do
33
+ list = @text_inputs_list.dup
34
+ list.push "select"
35
+ list.each do |input|
36
+ expect(input).to have_rule("color: #0000ff")
37
+ end
38
+ end
39
+ end
40
+
41
+ context "expands text inputs when middle of list" do
42
+ it "finds selectors" do
43
+ list = @text_inputs_list.dup
44
+ list.unshift "input[type=\"file\"]"
45
+ list.each do |input|
46
+ expect(input).to have_rule("color: #ff00ff")
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,27 @@
1
+ require "spec_helper"
2
+
3
+ describe "contains" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("functions/contains")
6
+ end
7
+
8
+ context "called on array with single item" do
9
+ it "contains item" do
10
+ expect(".single").to have_rule("color: #fff")
11
+ end
12
+
13
+ it "doesn't contain missing item" do
14
+ expect(".single-missing").to have_rule("color: #000")
15
+ end
16
+ end
17
+
18
+ context "called with array with multiple items" do
19
+ it "contains item" do
20
+ expect(".multiple").to have_rule("color: #fff")
21
+ end
22
+
23
+ it "doesn't contain missing item" do
24
+ expect(".multiple-missing").to have_rule("color: #000")
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,49 @@
1
+ require "spec_helper"
2
+
3
+ describe "is-length" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("functions/is-length")
6
+ end
7
+
8
+ context "checks if unitless integer can be represented as a length" do
9
+ it "returns false" do
10
+ expect(".integer").not_to have_rule("color: #fff")
11
+ end
12
+ end
13
+
14
+ context "checks if px can be represented as a length" do
15
+ it "returns true" do
16
+ expect(".pixels").to have_rule("color: #fff")
17
+ end
18
+ end
19
+
20
+ context "checks if em can be represented as a length" do
21
+ it "returns true" do
22
+ expect(".ems").to have_rule("color: #fff")
23
+ end
24
+ end
25
+
26
+ context "checks if percent can be represented as a length" do
27
+ it "returns true" do
28
+ expect(".percent").to have_rule("color: #fff")
29
+ end
30
+ end
31
+
32
+ context "parses calculated values" do
33
+ it "returns true" do
34
+ expect(".calc").to have_rule("color: #fff")
35
+ end
36
+ end
37
+
38
+ context "checks if strings can be represented as a length" do
39
+ it "returns false" do
40
+ expect(".string").not_to have_rule("color: #fff")
41
+ end
42
+ end
43
+
44
+ context "checks if null can be represented as a length" do
45
+ it "returns false" do
46
+ expect(".null").not_to have_rule("color: #fff")
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,37 @@
1
+ require "spec_helper"
2
+
3
+ describe "is-light" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("functions/is-light")
6
+ end
7
+
8
+ context "takes a light color" do
9
+ it "and returns true" do
10
+ expect(".pink").to have_rule("color: #000")
11
+ end
12
+ end
13
+
14
+ context "takes a medium-light color" do
15
+ it "and returns true" do
16
+ expect(".sky").to have_rule("color: #000")
17
+ end
18
+ end
19
+
20
+ context "takes a medium-dark color" do
21
+ it "and returns false" do
22
+ expect(".medium-gray").to have_rule("color: #fff")
23
+ end
24
+ end
25
+
26
+ context "takes a dark color" do
27
+ it "and returns false" do
28
+ expect(".charcoal").to have_rule("color: #fff")
29
+ end
30
+ end
31
+
32
+ context "takes a translucent color" do
33
+ it "and processes as an opaque color" do
34
+ expect(".translucent").to have_rule("color: #000")
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,43 @@
1
+ require "spec_helper"
2
+
3
+ describe "is-number" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("functions/is-number")
6
+ end
7
+
8
+ context "called with integer" do
9
+ it "is a number" do
10
+ expect(".integer").to have_rule("line-height: 1")
11
+ end
12
+ end
13
+
14
+ context "called with px" do
15
+ it "is a number" do
16
+ expect(".px").to have_rule("line-height: 2px")
17
+ end
18
+ end
19
+
20
+ context "called with em" do
21
+ it "is a number" do
22
+ expect(".em").to have_rule("line-height: 3em")
23
+ end
24
+ end
25
+
26
+ context "called with rem" do
27
+ it "is a number" do
28
+ expect(".rem").to have_rule("line-height: 4rem")
29
+ end
30
+ end
31
+
32
+ context "called with percent" do
33
+ it "is a number" do
34
+ expect(".percent").to have_rule("line-height: 5%")
35
+ end
36
+ end
37
+
38
+ context "called with string" do
39
+ it "is not a number" do
40
+ expect(".string").to_not have_rule("line-height: \"stringy\"")
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ require "spec_helper"
2
+
3
+ describe "is-size" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("functions/is-size")
6
+ end
7
+
8
+ context "called with integer" do
9
+ it "is not a size" do
10
+ expect(".integer").to_not have_rule("margin-top: 1")
11
+ end
12
+ end
13
+
14
+ context "called with px" do
15
+ it "is a size" do
16
+ expect(".px").to have_rule("margin-top: 2px")
17
+ end
18
+ end
19
+
20
+ context "called with em" do
21
+ it "is a size" do
22
+ expect(".em").to have_rule("margin-top: 3em")
23
+ end
24
+ end
25
+
26
+ context "called with rem" do
27
+ it "is a size" do
28
+ expect(".rem").to have_rule("margin-top: 4rem")
29
+ end
30
+ end
31
+
32
+ context "called with percent" do
33
+ it "is a size" do
34
+ expect(".percent").to have_rule("margin-top: 5%")
35
+ end
36
+ end
37
+
38
+ context "called with string" do
39
+ it "is not a size" do
40
+ expect(".string").to_not have_rule("margin-top: \"stringy\"")
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ require "spec_helper"
2
+
3
+ describe "modular-scale" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("functions/modular-scale")
6
+ end
7
+
8
+ context "called with arguments (1, $value: 2em)" do
9
+ it "outputs double the first value from the default scale" do
10
+ expect(".one-base-two").to have_rule("font-size: 2.666em")
11
+ end
12
+ end
13
+
14
+ context "called with arguments (1, $value: 3em)" do
15
+ it "outputs triple the first value from the default scale" do
16
+ expect(".one-base-three").to have_rule("font-size: 3.999em")
17
+ end
18
+ end
19
+
20
+ context "called with arguments (1, $value: 4em 6em)" do
21
+ it "outputs quadruple the first value from the default scale" do
22
+ expect(".one-double-value").to have_rule("font-size: 1.12556em")
23
+ end
24
+ end
25
+
26
+ context "called with arguments (1, $ratio: $golden-ratio)" do
27
+ it "output the first value from the golden ratio scale" do
28
+ expect(".one-golden-ratio").to have_rule("font-size: 1.618em")
29
+ end
30
+ end
31
+
32
+ context "called with argument (2)" do
33
+ it "outputs the second value from the default scale" do
34
+ expect(".two-base-one").to have_rule("font-size: 1.77689em")
35
+ end
36
+ end
37
+
38
+ context "called with arguments (2, $value: 4em 6em)" do
39
+ it "outputs sextuple the second value from the default scale" do
40
+ expect(".two-double-value").to have_rule("font-size: 3.55378em")
41
+ end
42
+ end
43
+ end