bourbon 4.2.1 → 4.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.hound.yml +1 -0
  3. data/.npmignore +1 -0
  4. data/.scss-lint.yml +2 -163
  5. data/.travis.yml +7 -0
  6. data/README.md +18 -5
  7. data/app/assets/stylesheets/_bourbon.scss +1 -1
  8. data/app/assets/stylesheets/css3/_flex-box.scss +2 -4
  9. data/app/assets/stylesheets/helpers/_convert-units.scss +8 -2
  10. data/bower.json +1 -1
  11. data/features/step_definitions/bourbon_steps.rb +1 -1
  12. data/lib/bourbon/version.rb +1 -1
  13. data/package.json +1 -1
  14. data/spec/bourbon/addons/border_color_spec.rb +51 -0
  15. data/spec/bourbon/addons/border_radius_spec.rb +25 -0
  16. data/spec/bourbon/addons/border_style_spec.rb +51 -0
  17. data/spec/bourbon/addons/border_width_spec.rb +51 -0
  18. data/spec/bourbon/addons/buttons_spec.rb +52 -0
  19. data/spec/bourbon/addons/clearfix_spec.rb +18 -0
  20. data/spec/bourbon/addons/ellipsis_spec.rb +20 -0
  21. data/spec/bourbon/addons/font_stacks_spec.rb +25 -0
  22. data/spec/bourbon/addons/hide_text_spec.rb +17 -0
  23. data/spec/bourbon/addons/margin_spec.rb +51 -0
  24. data/spec/bourbon/addons/padding_spec.rb +51 -0
  25. data/spec/bourbon/addons/position_spec.rb +67 -0
  26. data/spec/bourbon/addons/retina_image_spec.rb +57 -0
  27. data/spec/bourbon/addons/size_spec.rb +31 -0
  28. data/spec/bourbon/addons/text_inputs_spec.rb +63 -0
  29. data/spec/bourbon/addons/triangle_spec.rb +32 -0
  30. data/spec/bourbon/addons/word_wrap_spec.rb +29 -0
  31. data/spec/bourbon/css3/font_face_spec.rb +45 -0
  32. data/spec/bourbon/css3/hidpi_media_query_spec.rb +23 -0
  33. data/spec/bourbon/helpers/directional_values_spec.rb +39 -0
  34. data/spec/bourbon/helpers/font_source_declaration_spec.rb +29 -0
  35. data/spec/bourbon/helpers/str_to_num_spec.rb +25 -0
  36. data/spec/fixtures/addons/border-color.scss +26 -0
  37. data/spec/fixtures/addons/border-radius.scss +17 -0
  38. data/spec/fixtures/addons/border-style.scss +21 -0
  39. data/spec/fixtures/addons/border-width.scss +21 -0
  40. data/spec/fixtures/addons/buttons.scss +17 -0
  41. data/spec/fixtures/addons/clearfix.scss +5 -0
  42. data/spec/fixtures/addons/ellipsis.scss +5 -0
  43. data/spec/fixtures/addons/font-stacks.scss +21 -0
  44. data/spec/fixtures/addons/hide-text.scss +5 -0
  45. data/spec/fixtures/addons/margin.scss +21 -0
  46. data/spec/fixtures/addons/padding.scss +21 -0
  47. data/spec/fixtures/addons/position.scss +25 -0
  48. data/spec/fixtures/addons/retina-image.scss +21 -0
  49. data/spec/fixtures/addons/size.scss +13 -0
  50. data/spec/fixtures/addons/text-inputs.scss +17 -0
  51. data/spec/fixtures/addons/triangle.scss +9 -0
  52. data/spec/fixtures/addons/word-wrap.scss +9 -0
  53. data/spec/fixtures/css3/font-face.scss +6 -0
  54. data/spec/fixtures/css3/hidpi-media-query.scss +13 -0
  55. data/spec/fixtures/helpers/convert-units.scss +4 -4
  56. data/spec/fixtures/helpers/directional-values.scss +29 -0
  57. data/spec/fixtures/helpers/font-source-declaration.scss +10 -0
  58. data/spec/fixtures/helpers/str-to-num.scss +13 -0
  59. data/spec/support/matchers/have_ruleset.rb +20 -0
  60. data/spec/support/sass_support.rb +1 -1
  61. metadata +93 -2
@@ -0,0 +1,51 @@
1
+ require "spec_helper"
2
+
3
+ describe "border-width" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("addons/border-width")
6
+ end
7
+
8
+ context "called with one color" do
9
+ it "applies same width to all sides" do
10
+ rule = "border-width: 1px"
11
+
12
+ expect(".border-width-all").to have_rule(rule)
13
+ end
14
+ end
15
+
16
+ context "called with two widths" do
17
+ it "applies to alternating sides" do
18
+ rule = "border-width: 2px 3px"
19
+
20
+ expect(".border-width-alternate").to have_rule(rule)
21
+ end
22
+ end
23
+
24
+ context "called with three widths" do
25
+ it "applies second width to left and right" do
26
+ rule = "border-width: 4px 5px 6px"
27
+
28
+ expect(".border-width-implied-left").to have_rule(rule)
29
+ end
30
+ end
31
+
32
+ context "called with four widths" do
33
+ it "applies different widths to all sides" do
34
+ rule = "border-width: 7px 8px 9px 10px"
35
+
36
+ expect(".border-width-explicit").to have_rule(rule)
37
+ end
38
+ end
39
+
40
+ context "called with null values" do
41
+ it "writes rules for other three" do
42
+ ruleset = "border-top-width: 11px; " +
43
+ "border-right-width: 12px; " +
44
+ "border-left-width: 13px;"
45
+ bad_rule = "border-bottom-width: null;"
46
+
47
+ expect(".border-width-false-third").to have_ruleset(ruleset)
48
+ expect(".border-width-false-third").to_not have_rule(bad_rule)
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,52 @@
1
+ require "spec_helper"
2
+
3
+ describe "buttons" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("addons/buttons")
6
+
7
+ @buttons_list = [
8
+ "button",
9
+ "input[type=\"button\"]",
10
+ "input[type=\"reset\"]",
11
+ "input[type=\"submit\"]"
12
+ ]
13
+ end
14
+
15
+ context "expands plain buttons" do
16
+ it "finds selectors" do
17
+ @buttons_list.each do |input|
18
+ expect(input).to have_rule("color: #ff0000")
19
+ end
20
+ end
21
+ end
22
+
23
+ context "expands active buttons" do
24
+ it "finds selectors" do
25
+ list = @buttons_list.dup
26
+ list.map! { |input| input + ":active" }
27
+ list.each do |input|
28
+ expect(input).to have_rule("color: #00ff00")
29
+ end
30
+ end
31
+ end
32
+
33
+ context "expands focus buttons" do
34
+ it "finds selectors" do
35
+ list = @buttons_list.dup
36
+ list.map! { |input| input + ":focus" }
37
+ list.each do |input|
38
+ expect(input).to have_rule("color: #0000ff")
39
+ end
40
+ end
41
+ end
42
+
43
+ context "expands hover buttons" do
44
+ it "finds selectors" do
45
+ list = @buttons_list.dup
46
+ list.map! { |input| input + ":hover" }
47
+ list.each do |input|
48
+ expect(input).to have_rule("color: #ff00ff")
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,18 @@
1
+ require "spec_helper"
2
+
3
+ describe "clearfix" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("addons/clearfix")
6
+ end
7
+
8
+ context "called on element" do
9
+ it "adds clearfix" do
10
+ input = ".clearfix::after"
11
+ ruleset = "clear: both; " +
12
+ "content: \"\"; " +
13
+ "display: table;"
14
+
15
+ expect(input).to have_ruleset(ruleset)
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,20 @@
1
+ require "spec_helper"
2
+
3
+ describe "ellipsis" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("addons/ellipsis")
6
+ end
7
+
8
+ context "called on element" do
9
+ it "adds ellipsis" do
10
+ ruleset = "display: inline-block; " +
11
+ "max-width: 100%; " +
12
+ "overflow: hidden; " +
13
+ "text-overflow: ellipsis; " +
14
+ "white-space: nowrap; " +
15
+ "word-wrap: normal;"
16
+
17
+ expect(".ellipsis").to have_ruleset(ruleset)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,25 @@
1
+ require "spec_helper"
2
+
3
+ describe "font-stacks" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("addons/font-stacks")
6
+ end
7
+
8
+ context "stacks used in variable" do
9
+ it "output stacks" do
10
+ georgia = '"Georgia", "Cambria", "Times New Roman", "Times", serif'
11
+ helvetica = '"Helvetica Neue", "Helvetica", "Roboto", ' +
12
+ '"Arial", sans-serif'
13
+ lucida_grande = '"Lucida Grande", "Tahoma", "Verdana", ' +
14
+ '"Arial", sans-serif'
15
+ monospace = '"Bitstream Vera Sans Mono", "Consolas", "Courier", monospace'
16
+ verdana = '"Verdana", "Geneva", sans-serif'
17
+
18
+ expect(".georgia").to have_rule("font-family: #{georgia}")
19
+ expect(".helvetica").to have_rule("font-family: #{helvetica}")
20
+ expect(".lucida-grande").to have_rule("font-family: #{lucida_grande}")
21
+ expect(".monospace").to have_rule("font-family: #{monospace}")
22
+ expect(".verdana").to have_rule("font-family: #{verdana}")
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,17 @@
1
+ require "spec_helper"
2
+
3
+ describe "hide-text" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("addons/hide-text")
6
+ end
7
+
8
+ context "called on element" do
9
+ it "adds hide-text" do
10
+ ruleset = "overflow: hidden; " +
11
+ "text-indent: 101%; " +
12
+ "white-space: nowrap;"
13
+
14
+ expect(".hide-text").to have_ruleset(ruleset)
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,51 @@
1
+ require "spec_helper"
2
+
3
+ describe "margin" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("addons/margin")
6
+ end
7
+
8
+ context "called with one size" do
9
+ it "applies same width to all sides" do
10
+ rule = "margin: 1px"
11
+
12
+ expect(".margin-all").to have_rule(rule)
13
+ end
14
+ end
15
+
16
+ context "called with two sizes" do
17
+ it "applies to alternating sides" do
18
+ rule = "margin: 2px 3px"
19
+
20
+ expect(".margin-alternate").to have_rule(rule)
21
+ end
22
+ end
23
+
24
+ context "called with three sizes" do
25
+ it "applies second width to left and right" do
26
+ rule = "margin: 4px 5px 6px"
27
+
28
+ expect(".margin-implied-left").to have_rule(rule)
29
+ end
30
+ end
31
+
32
+ context "called with four sizes" do
33
+ it "applies different widths to all sides" do
34
+ rule = "margin: 7px 8px 9px 10px"
35
+
36
+ expect(".margin-explicit").to have_rule(rule)
37
+ end
38
+ end
39
+
40
+ context "called with null values" do
41
+ it "writes rules for other three" do
42
+ ruleset = "margin-top: 11px; " +
43
+ "margin-right: 12px; " +
44
+ "margin-left: 13px;"
45
+ bad_rule = "margin-bottom: null;"
46
+
47
+ expect(".margin-false-third").to have_ruleset(ruleset)
48
+ expect(".margin-false-third").to_not have_rule(bad_rule)
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,51 @@
1
+ require "spec_helper"
2
+
3
+ describe "padding" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("addons/padding")
6
+ end
7
+
8
+ context "called with one size" do
9
+ it "applies same width to all sides" do
10
+ rule = "padding: 1px"
11
+
12
+ expect(".padding-all").to have_rule(rule)
13
+ end
14
+ end
15
+
16
+ context "called with two sizes" do
17
+ it "applies to alternating sides" do
18
+ rule = "padding: 2px 3px"
19
+
20
+ expect(".padding-alternate").to have_rule(rule)
21
+ end
22
+ end
23
+
24
+ context "called with three sizes" do
25
+ it "applies second width to left and right" do
26
+ rule = "padding: 4px 5px 6px"
27
+
28
+ expect(".padding-implied-left").to have_rule(rule)
29
+ end
30
+ end
31
+
32
+ context "called with four sizes" do
33
+ it "applies different widths to all sides" do
34
+ rule = "padding: 7px 8px 9px 10px"
35
+
36
+ expect(".padding-explicit").to have_rule(rule)
37
+ end
38
+ end
39
+
40
+ context "called with null values" do
41
+ it "writes rules for other three" do
42
+ ruleset = "padding-top: 11px; " +
43
+ "padding-right: 12px; " +
44
+ "padding-left: 13px;"
45
+ bad_rule = "padding-bottom: null;"
46
+
47
+ expect(".padding-false-third").to have_ruleset(ruleset)
48
+ expect(".padding-false-third").to_not have_rule(bad_rule)
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,67 @@
1
+ require "spec_helper"
2
+
3
+ describe "position" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("addons/position")
6
+ end
7
+
8
+ context "called with one size" do
9
+ it "applies same width to all sides" do
10
+ ruleset = "position: fixed; " +
11
+ "top: 1em; " +
12
+ "right: 1em; " +
13
+ "bottom: 1em; " +
14
+ "left: 1em;"
15
+
16
+ expect(".position-all").to have_ruleset(ruleset)
17
+ end
18
+ end
19
+
20
+ context "called with two sizes" do
21
+ it "applies to alternating sides" do
22
+ ruleset = "position: absolute; " +
23
+ "top: 2px; " +
24
+ "right: 3px; " +
25
+ "bottom: 2px; " +
26
+ "left: 3px;"
27
+
28
+ expect(".position-alternate").to have_ruleset(ruleset)
29
+ end
30
+ end
31
+
32
+ context "called with three sizes" do
33
+ it "applies second width to left and right" do
34
+ ruleset = "position: relative; " +
35
+ "top: 4px; " +
36
+ "right: 5px; " +
37
+ "bottom: 6px; " +
38
+ "left: 5px;"
39
+
40
+ expect(".position-implied-left").to have_ruleset(ruleset)
41
+ end
42
+ end
43
+
44
+ context "called with four sizes" do
45
+ it "applies different widths to all sides" do
46
+ ruleset = "position: fixed; " +
47
+ "top: 7px; " +
48
+ "right: 8px; " +
49
+ "bottom: 9px; " +
50
+ "left: 10px;"
51
+
52
+ expect(".position-explicit").to have_ruleset(ruleset)
53
+ end
54
+ end
55
+
56
+ context "called with null values" do
57
+ it "writes rules for others" do
58
+ ruleset = "position: static; " +
59
+ "top: 11px; " +
60
+ "left: 13px;"
61
+ bad_rule = "position-bottom: null; position-right: null;"
62
+
63
+ expect(".position-false-third").to have_ruleset(ruleset)
64
+ expect(".position-false-third").to_not have_rule(bad_rule)
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,57 @@
1
+ require "spec_helper"
2
+
3
+ describe "retina-image" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("addons/retina-image")
6
+ end
7
+
8
+ context "called with defaults" do
9
+ it "applies defaults" do
10
+ ruleset = 'background-image: url("retina-default.png");; ' +
11
+ 'background-image: url("retina-default_2x.png"); ' +
12
+ 'background-size: "320px 480px";'
13
+
14
+ expect(".retina-default").to have_ruleset(ruleset)
15
+ end
16
+ end
17
+
18
+ context "called with extension" do
19
+ it "applies file extension" do
20
+ ruleset = 'background-image: url("retina-extension.jpg");; ' +
21
+ 'background-image: url("retina-extension_2x.jpg"); ' +
22
+ 'background-size: "20px 40px";'
23
+
24
+ expect(".retina-extension").to have_ruleset(ruleset)
25
+ end
26
+ end
27
+
28
+ context "called with custom retina filename" do
29
+ it "applies filename" do
30
+ ruleset = 'background-image: url("default.png");; ' +
31
+ 'background-image: url("custom.png"); ' +
32
+ 'background-size: "10px 5px";'
33
+
34
+ expect(".retina-custom-name").to have_ruleset(ruleset)
35
+ end
36
+ end
37
+
38
+ context "called with custom retina suffix" do
39
+ it "applies suffix" do
40
+ ruleset = 'background-image: url("default.png");; ' +
41
+ 'background-image: url("default@2x.png"); ' +
42
+ 'background-size: "3em 2em";'
43
+
44
+ expect(".retina-custom-suffix").to have_ruleset(ruleset)
45
+ end
46
+ end
47
+
48
+ context "called with no pipeline" do
49
+ it "applies suffix" do
50
+ ruleset = 'background-image: url("default.jpg");; ' +
51
+ 'background-image: url("default.jpg"); ' +
52
+ 'background-size: "100px 20px";'
53
+
54
+ expect(".retina-pipeline").to have_ruleset(ruleset)
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,31 @@
1
+ require "spec_helper"
2
+
3
+ describe "size" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("addons/size")
6
+ end
7
+
8
+ context "called with one size" do
9
+ it "applies same width to both height and width" do
10
+ rule = "height: 10px; width: 10px;"
11
+
12
+ expect(".size-implicit").to have_ruleset(rule)
13
+ end
14
+ end
15
+
16
+ context "called with two sizes" do
17
+ it "applies to height and width" do
18
+ rule = "height: 2em; width: 1em;"
19
+
20
+ expect(".size-both").to have_ruleset(rule)
21
+ end
22
+ end
23
+
24
+ context "called with auto" do
25
+ it "applies to auto to height" do
26
+ rule = "height: auto; width: 100px;"
27
+
28
+ expect(".size-auto").to have_ruleset(rule)
29
+ end
30
+ end
31
+ end