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.
- checksums.yaml +4 -4
- data/.gitignore +4 -4
- data/.hound.yml +5 -0
- data/.npmignore +0 -4
- data/.scss-lint.yml +3 -1
- data/CHANGELOG.md +45 -23
- data/CONTRIBUTING.md +12 -0
- data/Gemfile +1 -2
- data/Gulpfile.js +5 -6
- data/LICENSE.md +1 -1
- data/README.md +26 -163
- data/RELEASING.md +27 -0
- data/Rakefile +3 -13
- data/bower.json +8 -9
- data/circle.yml +13 -0
- data/contrib/base/_grids.scss +4 -0
- data/contrib/base/_variables.scss +8 -0
- data/contrib/index.html +68 -223
- data/contrib/patterns/_box.scss +11 -0
- data/contrib/patterns/_global.scss +5 -0
- data/contrib/patterns/_grid-media.scss +52 -0
- data/contrib/patterns/_grid-nested.scss +7 -0
- data/contrib/patterns/_grid-push.scss +7 -0
- data/contrib/patterns/_grid-shift.scss +7 -0
- data/contrib/patterns/_grid.scss +31 -0
- data/contrib/styles.scss +12 -293
- data/core/_neat.scss +20 -0
- data/core/neat/functions/_neat-column-default.scss +23 -0
- data/core/neat/functions/_neat-column-ratio.scss +24 -0
- data/core/neat/functions/_neat-column-width.scss +25 -0
- data/core/neat/functions/_neat-parse-columns.scss +22 -0
- data/core/neat/functions/_neat-parse-media.scss +20 -0
- data/core/neat/functions/_retrieve-neat-settings.scss +18 -0
- data/core/neat/mixins/_grid-column.scss +29 -0
- data/{app/assets/stylesheets/mixins/_clearfix.scss → core/neat/mixins/_grid-container.scss} +5 -5
- data/core/neat/mixins/_grid-media.scss +50 -0
- data/core/neat/mixins/_grid-push.scss +32 -0
- data/core/neat/mixins/_grid-shift.scss +31 -0
- data/core/neat/settings/_settings.scss +41 -0
- data/index.js +1 -1
- data/lib/neat.rb +5 -18
- data/lib/neat/generator.rb +1 -1
- data/lib/neat/version.rb +1 -1
- data/neat.gemspec +27 -33
- data/package.json +5 -4
- data/spec/.keep +0 -0
- data/spec/fixtures/_setup.scss +1 -0
- data/spec/fixtures/functions/neat-column-default.scss +22 -0
- data/spec/fixtures/functions/neat-column-width.scss +30 -0
- data/spec/fixtures/functions/neat-parse-media.scss +9 -0
- data/spec/fixtures/functions/retrieve-neat-settings.scss +22 -0
- data/spec/fixtures/mixins/grid-column.scss +57 -0
- data/spec/fixtures/mixins/grid-container.scss +5 -0
- data/spec/fixtures/mixins/grid-push.scss +38 -0
- data/spec/fixtures/mixins/grid-shift.scss +38 -0
- data/spec/neat/functions/neat_column_default_spec.rb +35 -0
- data/spec/neat/functions/neat_column_width_spec.rb +47 -0
- data/spec/neat/functions/neat_parse_media_spec.rb +23 -0
- data/spec/neat/functions/retrieve_neat_settings_spec.rb +35 -0
- data/spec/neat/mixins/grid_column_spec.rb +101 -0
- data/spec/neat/mixins/grid_container_spec.rb +17 -0
- data/spec/neat/mixins/grid_push_spec.rb +59 -0
- data/spec/neat/mixins/grid_shift_spec.rb +59 -0
- data/spec/support/matchers/have_ruleset.rb +20 -0
- data/spec/support/matchers/have_value.rb +9 -7
- data/spec/support/parser_support.rb +8 -1
- data/spec/support/sass_support.rb +1 -1
- metadata +76 -153
- data/.rspec +0 -1
- data/.ruby-version +0 -1
- data/.travis.yml +0 -10
- data/app/assets/stylesheets/_neat-helpers.scss +0 -11
- data/app/assets/stylesheets/_neat.scss +0 -24
- data/app/assets/stylesheets/functions/_new-breakpoint.scss +0 -49
- data/app/assets/stylesheets/functions/_private.scss +0 -154
- data/app/assets/stylesheets/grid/_box-sizing.scss +0 -15
- data/app/assets/stylesheets/grid/_direction-context.scss +0 -33
- data/app/assets/stylesheets/grid/_display-context.scss +0 -28
- data/app/assets/stylesheets/grid/_fill-parent.scss +0 -22
- data/app/assets/stylesheets/grid/_media.scss +0 -92
- data/app/assets/stylesheets/grid/_omega.scss +0 -112
- data/app/assets/stylesheets/grid/_outer-container.scss +0 -34
- data/app/assets/stylesheets/grid/_pad.scss +0 -25
- data/app/assets/stylesheets/grid/_private.scss +0 -35
- data/app/assets/stylesheets/grid/_reset-display.scss +0 -14
- data/app/assets/stylesheets/grid/_row.scss +0 -45
- data/app/assets/stylesheets/grid/_shift.scss +0 -50
- data/app/assets/stylesheets/grid/_span-columns.scss +0 -94
- data/app/assets/stylesheets/grid/_to-deprecate.scss +0 -81
- data/app/assets/stylesheets/grid/_visual-grid.scss +0 -42
- data/app/assets/stylesheets/settings/_disable-warnings.scss +0 -13
- data/app/assets/stylesheets/settings/_grid.scss +0 -51
- data/app/assets/stylesheets/settings/_visual-grid.scss +0 -27
- data/lib/neat/engine.rb +0 -5
- data/lib/tasks/install.rake +0 -19
- data/sache.json +0 -5
- data/spec/neat/columns_spec.rb +0 -73
- data/spec/neat/container_spec.rb +0 -21
- data/spec/neat/default_spec.rb +0 -15
- data/spec/neat/direction_spec.rb +0 -19
- data/spec/neat/display_spec.rb +0 -19
- data/spec/neat/media_spec.rb +0 -55
- data/spec/neat/new_breakpoint_spec.rb +0 -17
- data/spec/neat/omega_spec.rb +0 -66
- data/spec/neat/pad_spec.rb +0 -32
- data/spec/neat/row_spec.rb +0 -39
- data/spec/neat/shift_spec.rb +0 -41
- data/test/_setup.scss +0 -2
- data/test/default.scss +0 -1
- data/test/direction-context.scss +0 -13
- data/test/display-context.scss +0 -15
- data/test/media.scss +0 -39
- data/test/new-breakpoint.scss +0 -13
- data/test/omega.scss +0 -29
- data/test/outer-container.scss +0 -11
- data/test/pad.scss +0 -17
- data/test/row.scss +0 -26
- data/test/shift.scss +0 -36
- data/test/span-columns.scss +0 -21
data/spec/neat/pad_spec.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "@include pad()" do
|
4
|
-
before(:all) do
|
5
|
-
ParserSupport.parse_file("pad")
|
6
|
-
end
|
7
|
-
|
8
|
-
context "with no argument" do
|
9
|
-
it "sets padding to gutter percentage" do
|
10
|
-
expect(".pad-default").to have_rule("padding: 2.35765%")
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
context "with argument (20px)" do
|
15
|
-
it "sets padding to 20px" do
|
16
|
-
expect(".pad-explicit").to have_rule("padding: 20px")
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
context "with argument (30px 20px 10px 5px)" do
|
21
|
-
it "sets padding to 30px 20px 10px 5px" do
|
22
|
-
expect(".pad-shorthand").to have_rule("padding: 30px 20px 10px 5px")
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context "with argument (default)" do
|
27
|
-
it "uses default gutter percentage" do
|
28
|
-
expect(".pad-shorthand-default").to have_rule("padding: 30px 2.35765% 10px 2.35765%")
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
data/spec/neat/row_spec.rb
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "@include row()" do
|
4
|
-
before(:all) do
|
5
|
-
ParserSupport.parse_file("row")
|
6
|
-
end
|
7
|
-
|
8
|
-
context "with no argument" do
|
9
|
-
it "adds clearfix" do
|
10
|
-
expect(".row-default::after").to have_rule("clear: both")
|
11
|
-
end
|
12
|
-
|
13
|
-
it "sets display to block" do
|
14
|
-
expect(".row-default").to have_rule("display: block")
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
context "with argument (table)" do
|
19
|
-
it "sets display to table" do
|
20
|
-
expect(".row-table").to have_rule("display: table")
|
21
|
-
end
|
22
|
-
|
23
|
-
it "forces table-cell display on child elements" do
|
24
|
-
expect(".row-table-reset .block-child").to have_rule("display: table-cell")
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
context "with reset-display()" do
|
29
|
-
it "resets display to block" do
|
30
|
-
expect(".no-row").to have_rule("display: block")
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
context "with invalid display argument" do
|
35
|
-
it "sets display to block" do
|
36
|
-
expect(".row-invalid-display").to have_rule("display: block")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
data/spec/neat/shift_spec.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "@include shift()" do
|
4
|
-
before(:all) do
|
5
|
-
ParserSupport.parse_file("shift")
|
6
|
-
end
|
7
|
-
|
8
|
-
context "with no argument" do
|
9
|
-
it "shifts element one column in the default direction" do
|
10
|
-
expect(".shift-default").to have_rule("margin-left: 8.5298%")
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
context "with argument (2)" do
|
15
|
-
it "shifts element 2 columns in the default direction" do
|
16
|
-
expect(".shift-positive").to have_rule("margin-left: 17.05961%")
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
context "with argument (-3)" do
|
21
|
-
it "shifts element 3 columns in the opposite direction" do
|
22
|
-
expect(".shift-negative").to have_rule("margin-left: -25.58941%")
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context "when nested" do
|
27
|
-
it "shifts element relative to its parent" do
|
28
|
-
expect(".shifted-parent .shifted-child").to have_rule("margin-left: 34.94305%")
|
29
|
-
end
|
30
|
-
|
31
|
-
it "resets nesting context" do
|
32
|
-
expect(".post-nested-shift").to have_rule("margin-left: 17.05961%")
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
context "when layout direction changes" do
|
37
|
-
it "shifts element in the corresponding direction" do
|
38
|
-
expect("section .shift-negative").to have_rule("margin-right: -25.58941%")
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
data/test/_setup.scss
DELETED
data/test/default.scss
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
@import "setup";
|
data/test/direction-context.scss
DELETED
data/test/display-context.scss
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
@import "setup";
|
2
|
-
|
3
|
-
@include display-context(table) {
|
4
|
-
.display-table-block {
|
5
|
-
@include span-columns(6);
|
6
|
-
}
|
7
|
-
}
|
8
|
-
|
9
|
-
@include display-context(table) {
|
10
|
-
@include display-context(block) {
|
11
|
-
.display-nested-block {
|
12
|
-
@include span-columns(6);
|
13
|
-
}
|
14
|
-
}
|
15
|
-
}
|
data/test/media.scss
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
@import "setup";
|
2
|
-
|
3
|
-
$composite: new-breakpoint(max-width 768px min-width 110px orientation portait 6);
|
4
|
-
|
5
|
-
.media-default {
|
6
|
-
@include media(481px) {
|
7
|
-
color: #000;
|
8
|
-
}
|
9
|
-
}
|
10
|
-
|
11
|
-
.media-max-width {
|
12
|
-
@include media(max-width 480px) {
|
13
|
-
position: relative;
|
14
|
-
}
|
15
|
-
}
|
16
|
-
|
17
|
-
.media-min-max-width {
|
18
|
-
@include media(min-width 320px max-width 480px) {
|
19
|
-
position: relative;
|
20
|
-
}
|
21
|
-
}
|
22
|
-
|
23
|
-
.change-media-context {
|
24
|
-
@include media(481px, 6) {
|
25
|
-
@include span-columns(6);
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
.change-media-context-shorthand {
|
30
|
-
@include media(max-width 480px 6) {
|
31
|
-
@include span-columns(6);
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
.composite-media-query {
|
36
|
-
@include media($composite) {
|
37
|
-
@include span-columns(6);
|
38
|
-
}
|
39
|
-
}
|
data/test/new-breakpoint.scss
DELETED
data/test/omega.scss
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
@import "setup";
|
2
|
-
|
3
|
-
.omega-default {
|
4
|
-
@include omega;
|
5
|
-
}
|
6
|
-
|
7
|
-
.omega-nth-default {
|
8
|
-
@include omega(4n)
|
9
|
-
}
|
10
|
-
|
11
|
-
.omega-complex-nth {
|
12
|
-
@include omega("4n+1");
|
13
|
-
}
|
14
|
-
|
15
|
-
.omega-complex-nth-negative {
|
16
|
-
@include omega("3n-1");
|
17
|
-
}
|
18
|
-
|
19
|
-
section {
|
20
|
-
@include row($direction: RTL);
|
21
|
-
|
22
|
-
.omega-default-left {
|
23
|
-
@include omega;
|
24
|
-
}
|
25
|
-
|
26
|
-
.omega-nth-default-left {
|
27
|
-
@include omega(4n block);
|
28
|
-
}
|
29
|
-
}
|
data/test/outer-container.scss
DELETED
data/test/pad.scss
DELETED
data/test/row.scss
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
@import "setup";
|
2
|
-
|
3
|
-
.row-default {
|
4
|
-
@include row;
|
5
|
-
}
|
6
|
-
|
7
|
-
.row-table {
|
8
|
-
@include row(table);
|
9
|
-
}
|
10
|
-
|
11
|
-
.row-invalid-display {
|
12
|
-
@include row(invalid-argument);
|
13
|
-
}
|
14
|
-
|
15
|
-
.row-table-reset {
|
16
|
-
@include row(table);
|
17
|
-
|
18
|
-
.block-child {
|
19
|
-
@include span-columns(4, block);
|
20
|
-
@include reset-display;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
.no-row {
|
25
|
-
@include span-columns(4);
|
26
|
-
}
|
data/test/shift.scss
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
@import "setup";
|
2
|
-
|
3
|
-
.shift-default {
|
4
|
-
@include shift;
|
5
|
-
}
|
6
|
-
|
7
|
-
.shift-positive {
|
8
|
-
@include shift(2);
|
9
|
-
}
|
10
|
-
|
11
|
-
.shift-negative {
|
12
|
-
@include shift(-3);
|
13
|
-
}
|
14
|
-
|
15
|
-
// Nesting
|
16
|
-
.shifted-parent {
|
17
|
-
@include span-columns(6);
|
18
|
-
|
19
|
-
.shifted-child {
|
20
|
-
@include shift(2 of 6);
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
.post-nested-shift {
|
25
|
-
@include shift(2);
|
26
|
-
}
|
27
|
-
|
28
|
-
// Changing direction
|
29
|
-
section {
|
30
|
-
@include row($direction: RTL);
|
31
|
-
|
32
|
-
.shift-negative {
|
33
|
-
@include shift(-3);
|
34
|
-
@include reset-layout-direction;
|
35
|
-
}
|
36
|
-
}
|
data/test/span-columns.scss
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
@import "setup";
|
2
|
-
|
3
|
-
.span-columns-default {
|
4
|
-
@include span-columns(6);
|
5
|
-
|
6
|
-
.span-columns-nested {
|
7
|
-
@include span-columns(2 of 6);
|
8
|
-
}
|
9
|
-
}
|
10
|
-
|
11
|
-
.span-columns-table {
|
12
|
-
@include span-columns(6, table);
|
13
|
-
}
|
14
|
-
|
15
|
-
.span-columns-collapse {
|
16
|
-
@include span-columns(6, block-collapse);
|
17
|
-
}
|
18
|
-
|
19
|
-
.span-columns-no-display {
|
20
|
-
@include span-columns(6, no-display);
|
21
|
-
}
|