bourbon 4.2.1 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,63 @@
1
+ require "spec_helper"
2
+
3
+ describe "text-inputs" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("addons/text-inputs")
6
+
7
+ @inputs_list = [
8
+ "input[type=\"color\"]",
9
+ "input[type=\"date\"]",
10
+ "input[type=\"datetime\"]",
11
+ "input[type=\"datetime-local\"]",
12
+ "input[type=\"email\"]",
13
+ "input[type=\"month\"]",
14
+ "input[type=\"number\"]",
15
+ "input[type=\"password\"]",
16
+ "input[type=\"search\"]",
17
+ "input[type=\"tel\"]",
18
+ "input[type=\"text\"]",
19
+ "input[type=\"time\"]",
20
+ "input[type=\"url\"]",
21
+ "input[type=\"week\"]",
22
+ "textarea"
23
+ ]
24
+ end
25
+
26
+ context "expands plain text inputs" do
27
+ it "finds selectors" do
28
+ @inputs_list.each do |input|
29
+ expect(input).to have_rule("color: #ff0000")
30
+ end
31
+ end
32
+ end
33
+
34
+ context "expands active text inputs" do
35
+ it "finds selectors" do
36
+ list = @inputs_list.dup
37
+ list.map! { |input| input + ":active" }
38
+ list.each do |input|
39
+ expect(input).to have_rule("color: #00ff00")
40
+ end
41
+ end
42
+ end
43
+
44
+ context "expands focus text inputs" do
45
+ it "finds selectors" do
46
+ list = @inputs_list.dup
47
+ list.map! { |input| input + ":focus" }
48
+ list.each do |input|
49
+ expect(input).to have_rule("color: #0000ff")
50
+ end
51
+ end
52
+ end
53
+
54
+ context "expands hover text inputs" do
55
+ it "finds selectors" do
56
+ list = @inputs_list.dup
57
+ list.map! { |input| input + ":hover" }
58
+ list.each do |input|
59
+ expect(input).to have_rule("color: #ff00ff")
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,32 @@
1
+ require "spec_helper"
2
+
3
+ describe "triangle" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("addons/triangle")
6
+ end
7
+
8
+ context "called on element" do
9
+ it "adds triangle" do
10
+ input = ".triangle-down"
11
+ ruleset = "height: 0; " +
12
+ "width: 0; " +
13
+ "border-left: 6px solid transparent; " +
14
+ "border-right: 6px solid transparent; " +
15
+ "border-top: 6px solid #ffffff;"
16
+
17
+ expect(input).to have_ruleset(ruleset)
18
+ end
19
+ end
20
+
21
+ context "called on element with corner arguments" do
22
+ it "adds triangle on corner" do
23
+ input = ".triangle-corner"
24
+ ruleset = "height: 0; " +
25
+ "width: 0; " +
26
+ "border-top: 6px solid #000000; " +
27
+ "border-right: 12px solid #aaaaaa;"
28
+
29
+ expect(input).to have_ruleset(ruleset)
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,29 @@
1
+ require "spec_helper"
2
+
3
+ describe "word-wrap" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("addons/word-wrap")
6
+ end
7
+
8
+ context "called on element" do
9
+ it "adds word-wrap" do
10
+ input = ".word-wrap"
11
+ ruleset = "overflow-wrap: break-word; " +
12
+ "word-wrap: break-word; " +
13
+ "word-break: break-all;"
14
+
15
+ expect(input).to have_ruleset(ruleset)
16
+ end
17
+ end
18
+
19
+ context "called on element with break" do
20
+ it "adds break" do
21
+ input = ".word-wrap-break"
22
+ ruleset = "overflow-wrap: normal; " +
23
+ "word-wrap: normal; " +
24
+ "word-break: normal;"
25
+
26
+ expect(input).to have_ruleset(ruleset)
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,45 @@
1
+ require "spec_helper"
2
+
3
+ describe "font-face" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("css3/font-face")
6
+ end
7
+
8
+ context "called with defaults" do
9
+ it "outputs defaults" do
10
+ ruleset = "font-family: \"Helvetica\"; " +
11
+ "font-style: normal; " +
12
+ "font-weight: normal; " +
13
+ "src: url(\"/fonts.eot?#iefix\") " +
14
+ "format(\"embedded-opentype\"), " +
15
+ "url(\"/fonts.woff2\") format(\"woff2\"), " +
16
+ "url(\"/fonts.woff\") format(\"woff\"), " +
17
+ "url(\"/fonts.ttf\") format(\"truetype\"), " +
18
+ "url(\"/fonts.svg#Helvetica\") format(\"svg\");; " +
19
+ "font-family: \"Verdana\"; " +
20
+ "font-style: \"italic\"; " +
21
+ "font-weight: \"bold\"; " +
22
+ "src: url(\"/assets/fonts.eot?#iefix\") " +
23
+ "format(\"embedded-opentype\"), url(\"/assets/fonts.woff2\") " +
24
+ "format(\"woff2\"), url(\"/assets/fonts.woff\") " +
25
+ "format(\"woff\"), url(\"/assets/fonts.ttf\") " +
26
+ "format(\"truetype\"), url(\"/assets/fonts.svg#Verdana\") " +
27
+ "format(\"svg\");; " +
28
+ "font-family: \"Georgia\"; " +
29
+ "font-style: \"normal\"; " +
30
+ "font-weight: \"normal\"; " +
31
+ "src: url(\"/assets.eot?#iefix\") " +
32
+ "format(\"embedded-opentype\"), url(\"/assets.woff2\") " +
33
+ "format(\"woff2\"), url(\"/assets.woff\") format(\"woff\"), " +
34
+ "url(\"/assets.ttf\") format(\"truetype\"), " +
35
+ "url(\"/assets.svg#Georgia\") format(\"svg\");; " +
36
+ "font-family: \"Arial\"; " +
37
+ "font-style: \"normal\"; " +
38
+ "font-weight: \"normal\"; " +
39
+ "src: url(\"/.woff2\") format(\"woff2\"), " +
40
+ "url(\"/.svg#Arial\") format(\"svg\");"
41
+
42
+ expect("@font-face").to have_ruleset(ruleset)
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,23 @@
1
+ require "spec_helper"
2
+
3
+ describe "hidpi-media-query" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("css3/hidpi-media-query")
6
+ end
7
+
8
+ context "called with defaults" do
9
+ it "outputs defaults" do
10
+ rule = "color: #ff0000"
11
+
12
+ expect(".hidpi-defaults").to have_rule(rule)
13
+ end
14
+ end
15
+
16
+ context "called with ratio" do
17
+ it "outputs ratio" do
18
+ rule = "color: #00ff00"
19
+
20
+ expect(".hidpi-ratio").to have_rule(rule)
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,39 @@
1
+ require "spec_helper"
2
+
3
+ describe "directional-values" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("helpers/directional-values")
6
+ end
7
+
8
+ context "collapse-directionals" do
9
+ it "returns four distinct lengths unaltered" do
10
+ expect(".four").to have_rule("padding: 10px 20px 30px 40px")
11
+ end
12
+
13
+ it "returns collapsed horizontal lengths" do
14
+ expect(".three").to have_rule("padding: 5px 10px 5px 20px")
15
+ end
16
+
17
+ it "returns collapsed vertical and horizontal lengths" do
18
+ expect(".two").to have_rule("padding: 50px 100px")
19
+ end
20
+
21
+ it "returns collapsed lengths when all match" do
22
+ expect(".one").to have_rule("padding: 10px")
23
+ end
24
+ end
25
+
26
+ context "directional-property" do
27
+ it "returns property and values with four distinct lengths" do
28
+ expect(".border-all").to have_rule("border-width: 2px 5px 8px 12px")
29
+ end
30
+
31
+ it "returns property and value with one length" do
32
+ expect(".border-top").to have_rule("border-top: 10px")
33
+ end
34
+
35
+ it "returns property and value with vertical and horizontal values" do
36
+ expect(".border-color").to have_rule("border-color: #ffffff #000000")
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,29 @@
1
+ require "spec_helper"
2
+
3
+ describe "font-source-declaration" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("helpers/font-source-declaration")
6
+ end
7
+
8
+ context "called with pipeline" do
9
+ it "returns pipeline path" do
10
+ rule = 'src: font-url("b.eot?#iefix") format("embedded-opentype"), ' +
11
+ 'font-url("b.woff2") format("woff2"), ' +
12
+ 'font-url("b.woff") format("woff"), ' +
13
+ 'font-url("b.ttf") format("truetype"), ' +
14
+ 'font-url("b.svg#a") format("svg")'
15
+ expect(".has-pipeline").to have_rule(rule)
16
+ end
17
+ end
18
+
19
+ context "called with no pipeline" do
20
+ it "does not return pipeline path" do
21
+ rule = 'src: url("b.eot?#iefix") format("embedded-opentype"), ' +
22
+ 'url("b.woff2") format("woff2"), ' +
23
+ 'url("b.woff") format("woff"), ' +
24
+ 'url("b.ttf") format("truetype"), ' +
25
+ 'url("b.svg#a") format("svg")'
26
+ expect(".no-pipeline").to have_rule(rule)
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,25 @@
1
+ require "spec_helper"
2
+
3
+ describe "str-to-num" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("helpers/str-to-num")
6
+ end
7
+
8
+ context "called with integer string" do
9
+ it "is converted to integer" do
10
+ expect(".string-to-integer").to have_rule("height: 10")
11
+ end
12
+ end
13
+
14
+ context "called with px string" do
15
+ it "is converted to px" do
16
+ expect(".string-to-px").to have_rule("height: 15px")
17
+ end
18
+ end
19
+
20
+ context "called with negative px string" do
21
+ it "is converted to negative px" do
22
+ expect(".string-to-negative-px").to have_rule("height: -25px")
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,26 @@
1
+ @import "setup";
2
+
3
+ $red: #ff0000;
4
+ $blue: #00ff00;
5
+ $green: #0000ff;
6
+ $purple: #ffff00;
7
+
8
+ .border-color-all {
9
+ @include border-color($red);
10
+ }
11
+
12
+ .border-color-alternate {
13
+ @include border-color($blue $green);
14
+ }
15
+
16
+ .border-color-implied-left {
17
+ @include border-color($red $blue $green);
18
+ }
19
+
20
+ .border-color-explicit {
21
+ @include border-color($green $blue $red $purple);
22
+ }
23
+
24
+ .border-color-false-third {
25
+ @include border-color($blue $purple null $green);
26
+ }
@@ -0,0 +1,17 @@
1
+ @import "setup";
2
+
3
+ .border-top-radius {
4
+ @include border-top-radius(1em);
5
+ }
6
+
7
+ .border-left-radius {
8
+ @include border-left-radius(2em);
9
+ }
10
+
11
+ .border-right-radius {
12
+ @include border-right-radius(3em);
13
+ }
14
+
15
+ .border-bottom-radius {
16
+ @include border-bottom-radius(4em);
17
+ }
@@ -0,0 +1,21 @@
1
+ @import "setup";
2
+
3
+ .border-style-all {
4
+ @include border-style(solid);
5
+ }
6
+
7
+ .border-style-alternate {
8
+ @include border-style(dotted dashed);
9
+ }
10
+
11
+ .border-style-implied-left {
12
+ @include border-style(dashed double solid);
13
+ }
14
+
15
+ .border-style-explicit {
16
+ @include border-style(dotted groove ridge none);
17
+ }
18
+
19
+ .border-style-false-third {
20
+ @include border-style(inset none null double);
21
+ }
@@ -0,0 +1,21 @@
1
+ @import "setup";
2
+
3
+ .border-width-all {
4
+ @include border-width(1px);
5
+ }
6
+
7
+ .border-width-alternate {
8
+ @include border-width(2px 3px);
9
+ }
10
+
11
+ .border-width-implied-left {
12
+ @include border-width(4px 5px 6px);
13
+ }
14
+
15
+ .border-width-explicit {
16
+ @include border-width(7px 8px 9px 10px);
17
+ }
18
+
19
+ .border-width-false-third {
20
+ @include border-width(11px 12px null 13px);
21
+ }
@@ -0,0 +1,17 @@
1
+ @import "setup";
2
+
3
+ #{$all-button-inputs} {
4
+ color: #ff0000;
5
+ }
6
+
7
+ #{$all-button-inputs-active} {
8
+ color: #00ff00;
9
+ }
10
+
11
+ #{$all-button-inputs-focus} {
12
+ color: #0000ff;
13
+ }
14
+
15
+ #{$all-button-inputs-hover} {
16
+ color: #ff00ff;
17
+ }
@@ -0,0 +1,5 @@
1
+ @import "setup";
2
+
3
+ .clearfix {
4
+ @include clearfix;
5
+ }
@@ -0,0 +1,5 @@
1
+ @import "setup";
2
+
3
+ .ellipsis {
4
+ @include ellipsis;
5
+ }
@@ -0,0 +1,21 @@
1
+ @import "setup";
2
+
3
+ .georgia {
4
+ font-family: $georgia;
5
+ }
6
+
7
+ .helvetica {
8
+ font-family: $helvetica;
9
+ }
10
+
11
+ .lucida-grande {
12
+ font-family: $lucida-grande;
13
+ }
14
+
15
+ .monospace {
16
+ font-family: $monospace;
17
+ }
18
+
19
+ .verdana {
20
+ font-family: $verdana;
21
+ }
@@ -0,0 +1,5 @@
1
+ @import "setup";
2
+
3
+ .hide-text {
4
+ @include hide-text;
5
+ }