neat 1.9.1 → 2.0.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -4
  3. data/.hound.yml +5 -0
  4. data/.npmignore +0 -4
  5. data/.scss-lint.yml +3 -1
  6. data/CHANGELOG.md +45 -23
  7. data/CONTRIBUTING.md +12 -0
  8. data/Gemfile +1 -2
  9. data/Gulpfile.js +5 -6
  10. data/LICENSE.md +1 -1
  11. data/README.md +26 -163
  12. data/RELEASING.md +27 -0
  13. data/Rakefile +3 -13
  14. data/bower.json +8 -9
  15. data/circle.yml +13 -0
  16. data/contrib/base/_grids.scss +4 -0
  17. data/contrib/base/_variables.scss +8 -0
  18. data/contrib/index.html +68 -223
  19. data/contrib/patterns/_box.scss +11 -0
  20. data/contrib/patterns/_global.scss +5 -0
  21. data/contrib/patterns/_grid-media.scss +52 -0
  22. data/contrib/patterns/_grid-nested.scss +7 -0
  23. data/contrib/patterns/_grid-push.scss +7 -0
  24. data/contrib/patterns/_grid-shift.scss +7 -0
  25. data/contrib/patterns/_grid.scss +31 -0
  26. data/contrib/styles.scss +12 -293
  27. data/core/_neat.scss +20 -0
  28. data/core/neat/functions/_neat-column-default.scss +23 -0
  29. data/core/neat/functions/_neat-column-ratio.scss +24 -0
  30. data/core/neat/functions/_neat-column-width.scss +25 -0
  31. data/core/neat/functions/_neat-parse-columns.scss +22 -0
  32. data/core/neat/functions/_neat-parse-media.scss +20 -0
  33. data/core/neat/functions/_retrieve-neat-settings.scss +18 -0
  34. data/core/neat/mixins/_grid-column.scss +29 -0
  35. data/{app/assets/stylesheets/mixins/_clearfix.scss → core/neat/mixins/_grid-container.scss} +5 -5
  36. data/core/neat/mixins/_grid-media.scss +50 -0
  37. data/core/neat/mixins/_grid-push.scss +32 -0
  38. data/core/neat/mixins/_grid-shift.scss +31 -0
  39. data/core/neat/settings/_settings.scss +41 -0
  40. data/index.js +1 -1
  41. data/lib/neat.rb +5 -18
  42. data/lib/neat/generator.rb +1 -1
  43. data/lib/neat/version.rb +1 -1
  44. data/neat.gemspec +27 -33
  45. data/package.json +5 -4
  46. data/spec/.keep +0 -0
  47. data/spec/fixtures/_setup.scss +1 -0
  48. data/spec/fixtures/functions/neat-column-default.scss +22 -0
  49. data/spec/fixtures/functions/neat-column-width.scss +30 -0
  50. data/spec/fixtures/functions/neat-parse-media.scss +9 -0
  51. data/spec/fixtures/functions/retrieve-neat-settings.scss +22 -0
  52. data/spec/fixtures/mixins/grid-column.scss +57 -0
  53. data/spec/fixtures/mixins/grid-container.scss +5 -0
  54. data/spec/fixtures/mixins/grid-push.scss +38 -0
  55. data/spec/fixtures/mixins/grid-shift.scss +38 -0
  56. data/spec/neat/functions/neat_column_default_spec.rb +35 -0
  57. data/spec/neat/functions/neat_column_width_spec.rb +47 -0
  58. data/spec/neat/functions/neat_parse_media_spec.rb +23 -0
  59. data/spec/neat/functions/retrieve_neat_settings_spec.rb +35 -0
  60. data/spec/neat/mixins/grid_column_spec.rb +101 -0
  61. data/spec/neat/mixins/grid_container_spec.rb +17 -0
  62. data/spec/neat/mixins/grid_push_spec.rb +59 -0
  63. data/spec/neat/mixins/grid_shift_spec.rb +59 -0
  64. data/spec/support/matchers/have_ruleset.rb +20 -0
  65. data/spec/support/matchers/have_value.rb +9 -7
  66. data/spec/support/parser_support.rb +8 -1
  67. data/spec/support/sass_support.rb +1 -1
  68. metadata +76 -153
  69. data/.rspec +0 -1
  70. data/.ruby-version +0 -1
  71. data/.travis.yml +0 -10
  72. data/app/assets/stylesheets/_neat-helpers.scss +0 -11
  73. data/app/assets/stylesheets/_neat.scss +0 -24
  74. data/app/assets/stylesheets/functions/_new-breakpoint.scss +0 -49
  75. data/app/assets/stylesheets/functions/_private.scss +0 -154
  76. data/app/assets/stylesheets/grid/_box-sizing.scss +0 -15
  77. data/app/assets/stylesheets/grid/_direction-context.scss +0 -33
  78. data/app/assets/stylesheets/grid/_display-context.scss +0 -28
  79. data/app/assets/stylesheets/grid/_fill-parent.scss +0 -22
  80. data/app/assets/stylesheets/grid/_media.scss +0 -92
  81. data/app/assets/stylesheets/grid/_omega.scss +0 -112
  82. data/app/assets/stylesheets/grid/_outer-container.scss +0 -34
  83. data/app/assets/stylesheets/grid/_pad.scss +0 -25
  84. data/app/assets/stylesheets/grid/_private.scss +0 -35
  85. data/app/assets/stylesheets/grid/_reset-display.scss +0 -14
  86. data/app/assets/stylesheets/grid/_row.scss +0 -45
  87. data/app/assets/stylesheets/grid/_shift.scss +0 -50
  88. data/app/assets/stylesheets/grid/_span-columns.scss +0 -94
  89. data/app/assets/stylesheets/grid/_to-deprecate.scss +0 -81
  90. data/app/assets/stylesheets/grid/_visual-grid.scss +0 -42
  91. data/app/assets/stylesheets/settings/_disable-warnings.scss +0 -13
  92. data/app/assets/stylesheets/settings/_grid.scss +0 -51
  93. data/app/assets/stylesheets/settings/_visual-grid.scss +0 -27
  94. data/lib/neat/engine.rb +0 -5
  95. data/lib/tasks/install.rake +0 -19
  96. data/sache.json +0 -5
  97. data/spec/neat/columns_spec.rb +0 -73
  98. data/spec/neat/container_spec.rb +0 -21
  99. data/spec/neat/default_spec.rb +0 -15
  100. data/spec/neat/direction_spec.rb +0 -19
  101. data/spec/neat/display_spec.rb +0 -19
  102. data/spec/neat/media_spec.rb +0 -55
  103. data/spec/neat/new_breakpoint_spec.rb +0 -17
  104. data/spec/neat/omega_spec.rb +0 -66
  105. data/spec/neat/pad_spec.rb +0 -32
  106. data/spec/neat/row_spec.rb +0 -39
  107. data/spec/neat/shift_spec.rb +0 -41
  108. data/test/_setup.scss +0 -2
  109. data/test/default.scss +0 -1
  110. data/test/direction-context.scss +0 -13
  111. data/test/display-context.scss +0 -15
  112. data/test/media.scss +0 -39
  113. data/test/new-breakpoint.scss +0 -13
  114. data/test/omega.scss +0 -29
  115. data/test/outer-container.scss +0 -11
  116. data/test/pad.scss +0 -17
  117. data/test/row.scss +0 -26
  118. data/test/shift.scss +0 -36
  119. data/test/span-columns.scss +0 -21
@@ -0,0 +1,30 @@
1
+ @import "setup";
2
+
3
+ $six-grid: (
4
+ columns: 6,
5
+ gutter: 10px
6
+ );
7
+
8
+ .neat-column-width-1-of-12 {
9
+ width: calc(#{_neat-column-width($neat-grid, 1)});
10
+ }
11
+
12
+ .neat-column-width-6-of-12 {
13
+ width: calc(#{_neat-column-width($neat-grid, 6)});
14
+ }
15
+
16
+ .neat-column-width-12-of-12 {
17
+ width: calc(#{_neat-column-width($neat-grid, 12)});
18
+ }
19
+
20
+ .neat-column-width-1-of-6 {
21
+ width: calc(#{_neat-column-width($six-grid, 1)});
22
+ }
23
+
24
+ .neat-column-width-2-of-6 {
25
+ width: calc(#{_neat-column-width($six-grid, 2)});
26
+ }
27
+
28
+ .neat-column-width-6-of-6 {
29
+ width: calc(#{_neat-column-width($six-grid, 6)});
30
+ }
@@ -0,0 +1,9 @@
1
+ @import "setup";
2
+
3
+ .neat-parse-media-number {
4
+ content: _neat-parse-media(100px);
5
+ }
6
+
7
+ .neat-parse-media-string {
8
+ content: _neat-parse-media("only screen and (max-width: 25rem)");
9
+ }
@@ -0,0 +1,22 @@
1
+ @import "setup";
2
+
3
+ $eighteen-grid: (
4
+ columns: 18,
5
+ gutter: 33px
6
+ );
7
+
8
+ .neat-settings-default-columns {
9
+ content: _retrieve-neat-setting($neat-grid, columns);
10
+ }
11
+
12
+ .neat-settings-default-gutter {
13
+ content: _retrieve-neat-setting($neat-grid, gutter);
14
+ }
15
+
16
+ .neat-settings-eighteen-columns {
17
+ content: _retrieve-neat-setting($eighteen-grid, columns);
18
+ }
19
+
20
+ .neat-settings-eighteen-gutter {
21
+ content: _retrieve-neat-setting($eighteen-grid, gutter);
22
+ }
@@ -0,0 +1,57 @@
1
+ @import "setup";
2
+
3
+ $six-grid: (
4
+ columns: 6,
5
+ gutter: 1em,
6
+ );
7
+
8
+ $seventeen-grid: (
9
+ columns: 17,
10
+ gutter: 10px,
11
+ );
12
+
13
+ .grid-column-1-of-default {
14
+ @include grid-column(1);
15
+ }
16
+
17
+ .grid-column-6-of-default {
18
+ @include grid-column(6);
19
+ }
20
+
21
+ .grid-column-12-of-default {
22
+ @include grid-column(12);
23
+ }
24
+
25
+ .grid-column-3-of-5-shorthand {
26
+ @include grid-column(3 of 5);
27
+ }
28
+
29
+ .grid-column-1-of-6 {
30
+ @include grid-column(1, $six-grid);
31
+ }
32
+
33
+ .grid-column-4-of-6 {
34
+ @include grid-column(4, $six-grid);
35
+ }
36
+
37
+ .grid-column-6-of-6 {
38
+ @include grid-column(6, $six-grid);
39
+ }
40
+
41
+ .grid-column-3-of-5-shorthand-six-grid {
42
+ @include grid-column(3 of 5, $six-grid);
43
+ }
44
+
45
+ .grid-column-5-of-17 {
46
+ @include grid-column(1, $seventeen-grid);
47
+ }
48
+
49
+ .grid-column-11-of-17 {
50
+ @include grid-column(6, $seventeen-grid);
51
+ }
52
+
53
+ .grid-column-13-of-17 {
54
+ @include grid-column(12, $seventeen-grid);
55
+ }
56
+
57
+
@@ -0,0 +1,5 @@
1
+ @import "setup";
2
+
3
+ .grid-container {
4
+ @include grid-container;
5
+ }
@@ -0,0 +1,38 @@
1
+ @import "setup";
2
+
3
+ $six-grid: (
4
+ columns: 6,
5
+ gutter: 2rem,
6
+ );
7
+
8
+ .grid-push-default {
9
+ @include grid-push;
10
+ }
11
+
12
+ .grid-push-1-default {
13
+ @include grid-push(1);
14
+ }
15
+
16
+ .grid-push-6-default {
17
+ @include grid-push(6);
18
+ }
19
+
20
+ .grid-push-neg-6-default {
21
+ @include grid-push(-6);
22
+ }
23
+
24
+ .grid-push-0-six {
25
+ @include grid-push(false, $six-grid);
26
+ }
27
+
28
+ .grid-push-1-six {
29
+ @include grid-push(1, $six-grid);
30
+ }
31
+
32
+ .grid-push-3-six {
33
+ @include grid-push(3, $six-grid);
34
+ }
35
+
36
+ .grid-push-neg-3-six {
37
+ @include grid-push(-3, $six-grid);
38
+ }
@@ -0,0 +1,38 @@
1
+ @import "setup";
2
+
3
+ $six-grid: (
4
+ columns: 6,
5
+ gutter: 2rem,
6
+ );
7
+
8
+ .grid-shift-default {
9
+ @include grid-shift;
10
+ }
11
+
12
+ .grid-shift-1-default {
13
+ @include grid-shift(1);
14
+ }
15
+
16
+ .grid-shift-6-default {
17
+ @include grid-shift(6);
18
+ }
19
+
20
+ .grid-shift-neg-6-default {
21
+ @include grid-shift(-6);
22
+ }
23
+
24
+ .grid-shift-0-six {
25
+ @include grid-shift(false, $six-grid);
26
+ }
27
+
28
+ .grid-shift-1-six {
29
+ @include grid-shift(1, $six-grid);
30
+ }
31
+
32
+ .grid-shift-3-six {
33
+ @include grid-shift(3, $six-grid);
34
+ }
35
+
36
+ .grid-shift-neg-3-six {
37
+ @include grid-shift(-3, $six-grid);
38
+ }
@@ -0,0 +1,35 @@
1
+ require "spec_helper"
2
+
3
+ describe "neat-column-default" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("functions/neat-column-default")
6
+ end
7
+
8
+ context "called with default grid" do
9
+ it "gets default columns" do
10
+ rule = "content: 12"
11
+
12
+ expect(".neat-column-default-grid").to have_rule(rule)
13
+ end
14
+
15
+ it "gets custom columns" do
16
+ rule = "content: 10"
17
+
18
+ expect(".neat-column-default-grid-custom-col").to have_rule(rule)
19
+ end
20
+ end
21
+
22
+ context "called with custom grid" do
23
+ it "gets default columns" do
24
+ rule = "content: 18"
25
+
26
+ expect(".neat-column-custom-grid").to have_rule(rule)
27
+ end
28
+
29
+ it "gets custom columns" do
30
+ rule = "content: 10"
31
+
32
+ expect(".neat-column-custom-grid-custom-col").to have_rule(rule)
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,47 @@
1
+ require "spec_helper"
2
+
3
+ describe "neat-column-width" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("functions/neat-column-width")
6
+ end
7
+
8
+ context "called with a default twelve column grid" do
9
+ it "applies one column" do
10
+ rule = "width: calc(8.33333% - 21.66667px)"
11
+
12
+ expect(".neat-column-width-1-of-12").to have_rule(rule)
13
+ end
14
+
15
+ it "applies six columns" do
16
+ rule = "width: calc(50% - 30px)"
17
+
18
+ expect(".neat-column-width-6-of-12").to have_rule(rule)
19
+ end
20
+
21
+ it "applies twelve columns" do
22
+ rule = "width: calc(100% - 40px)"
23
+
24
+ expect(".neat-column-width-12-of-12").to have_rule(rule)
25
+ end
26
+ end
27
+
28
+ context "called with a custom 6 column grid" do
29
+ it "applies one column" do
30
+ rule = "width: calc(16.66667% - 11.66667px)"
31
+
32
+ expect(".neat-column-width-1-of-6").to have_rule(rule)
33
+ end
34
+
35
+ it "applies six columns" do
36
+ rule = "width: calc(33.33333% - 13.33333px)"
37
+
38
+ expect(".neat-column-width-2-of-6").to have_rule(rule)
39
+ end
40
+
41
+ it "applies twelve columns" do
42
+ rule = "width: calc(100% - 20px)"
43
+
44
+ expect(".neat-column-width-6-of-6").to have_rule(rule)
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,23 @@
1
+ require "spec_helper"
2
+
3
+ describe "neat-parse-media" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("functions/neat-parse-media")
6
+ end
7
+
8
+ context "called with number" do
9
+ it "gets min-width wraped number" do
10
+ rule = 'content: "only screen and (min-width: 100px)"'
11
+
12
+ expect(".neat-parse-media-number").to have_rule(rule)
13
+ end
14
+ end
15
+
16
+ context "called with string" do
17
+ it "gets the string" do
18
+ rule = 'content: "only screen and (max-width: 25rem)"'
19
+
20
+ expect(".neat-parse-media-string").to have_rule(rule)
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,35 @@
1
+ require "spec_helper"
2
+
3
+ describe "retrieve-neat-settings" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("functions/retrieve-neat-settings")
6
+ end
7
+
8
+ context "called with default settings" do
9
+ it "gets default columns" do
10
+ rule = "content: 12"
11
+
12
+ expect(".neat-settings-default-columns").to have_rule(rule)
13
+ end
14
+
15
+ it "gets default gutter" do
16
+ rule = "content: 20px"
17
+
18
+ expect(".neat-settings-default-gutter").to have_rule(rule)
19
+ end
20
+ end
21
+
22
+ context "called with custom settings" do
23
+ it "gets default columns" do
24
+ rule = "content: 18"
25
+
26
+ expect(".neat-settings-eighteen-columns").to have_rule(rule)
27
+ end
28
+
29
+ it "gets default gutter" do
30
+ rule = "content: 33px"
31
+
32
+ expect(".neat-settings-eighteen-gutter").to have_rule(rule)
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,101 @@
1
+ require "spec_helper"
2
+
3
+ describe "grid-column" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("mixins/grid-column")
6
+ end
7
+
8
+ context "called without a specified grid" do
9
+ it "applies one column in the default 12-column grid" do
10
+ ruleset = "width: calc(8.33333% - 21.66667px); " +
11
+ "float: left; " +
12
+ "margin-left: 20px;"
13
+
14
+ expect(".grid-column-1-of-default").to have_ruleset(ruleset)
15
+ end
16
+
17
+ it "applies six columns in the default 12-column grid" do
18
+ ruleset = "width: calc(50% - 30px); " +
19
+ "float: left; " +
20
+ "margin-left: 20px;"
21
+
22
+ expect(".grid-column-6-of-default").to have_ruleset(ruleset)
23
+ end
24
+
25
+ it "applies twelve columns in the default 12-column grid" do
26
+ ruleset = "width: calc(100% - 40px); " +
27
+ "float: left; " +
28
+ "margin-left: 20px;"
29
+
30
+ expect(".grid-column-12-of-default").to have_ruleset(ruleset)
31
+ end
32
+
33
+ it "applies a three fifths column in shorthand with the default grid" do
34
+ ruleset = "width: calc(60% - 32px); " +
35
+ "float: left; " +
36
+ "margin-left: 20px;"
37
+
38
+ expect(".grid-column-3-of-5-shorthand").to have_ruleset(ruleset)
39
+ end
40
+ end
41
+
42
+ context "called with a custom grid" do
43
+ it "applies one column" do
44
+ ruleset = "width: calc(16.66667% - 1.16667em); " +
45
+ "float: left; " +
46
+ "margin-left: 1em;"
47
+
48
+ expect(".grid-column-1-of-6").to have_ruleset(ruleset)
49
+ end
50
+
51
+ it "applies four columns" do
52
+ ruleset = "width: calc(66.66667% - 1.66667em); " +
53
+ "float: left; " +
54
+ "margin-left: 1em;"
55
+
56
+ expect(".grid-column-4-of-6").to have_ruleset(ruleset)
57
+ end
58
+
59
+ it "applies six columns" do
60
+ ruleset = "width: calc(100% - 2em); " +
61
+ "float: left; " +
62
+ "margin-left: 1em;"
63
+
64
+ expect(".grid-column-6-of-6").to have_ruleset(ruleset)
65
+ end
66
+
67
+ it "applies a three fifths column in shorthand" do
68
+ ruleset = "width: calc(60% - 1.6em); " +
69
+ "float: left; " +
70
+ "margin-left: 1em;"
71
+
72
+ expect(".grid-column-3-of-5-shorthand-six-grid").to have_ruleset(ruleset)
73
+ end
74
+ end
75
+
76
+ context "called with a weirder custom grid" do
77
+ it "applies five columns" do
78
+ ruleset = "width: calc(5.88235% - 10.58824px); " +
79
+ "float: left; " +
80
+ "margin-left: 10px;"
81
+
82
+ expect(".grid-column-5-of-17").to have_ruleset(ruleset)
83
+ end
84
+
85
+ it "applies eleven columns" do
86
+ ruleset = "width: calc(35.29412% - 13.52941px); " +
87
+ "float: left; " +
88
+ "margin-left: 10px;"
89
+
90
+ expect(".grid-column-11-of-17").to have_ruleset(ruleset)
91
+ end
92
+
93
+ it "applies thirteen columns" do
94
+ ruleset = "width: calc(70.58824% - 17.05882px); " +
95
+ "float: left; " +
96
+ "margin-left: 10px;"
97
+
98
+ expect(".grid-column-13-of-17").to have_ruleset(ruleset)
99
+ end
100
+ end
101
+ end