neat 2.0.0.alpha.1 → 2.0.0.beta.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/bower.json +1 -1
- data/contrib/index.html +13 -0
- data/contrib/patterns/_grid-collapse.scss +3 -0
- data/contrib/styles.scss +1 -0
- data/core/_neat.scss +2 -1
- data/core/neat/mixins/_grid-collapse.scss +36 -0
- data/core/neat/mixins/_grid-column.scss +4 -0
- data/core/neat/mixins/_grid-container.scss +4 -0
- data/core/neat/mixins/_grid-media.scss +4 -0
- data/core/neat/mixins/_grid-push.scss +4 -0
- data/core/neat/mixins/_grid-shift.scss +4 -0
- data/core/neat/settings/_settings.scss +57 -5
- data/lib/neat/version.rb +1 -1
- data/package.json +1 -1
- data/spec/fixtures/mixins/grid-collapse.scss +14 -0
- data/spec/fixtures/mixins/grid-media.scss +39 -0
- data/spec/neat/mixins/grid_collapse_spec.rb +28 -0
- data/spec/neat/mixins/grid_media_spec.rb +25 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3787ca54822b2cc33778821496950fa92f8b8d7
|
4
|
+
data.tar.gz: f521238ccd45444adcd4d66fe39e5d3667d91ea2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 266dbbb6933f76906bcd329300ab318bf8e77ec544848f6b237b4ec7c22defbe5331dfde6d3cebe7baf59d2bf70cfc646d8a01d1696d122f7969ca1b5605a33b
|
7
|
+
data.tar.gz: 2f015d7aabf6bd4d69f5b2514cf3a8701e8825dc7d791d1dbece56a976abb7286c925a204060c18a028fd7ac03cafeb1e8e0b922c9cc608e27479a601a763369
|
data/CHANGELOG.md
CHANGED
@@ -14,6 +14,7 @@ project adheres to [Semantic Versioning](http://semver.org).
|
|
14
14
|
- Added `grid-push` functionality
|
15
15
|
- Added `grid-shift` functionality
|
16
16
|
- Added `grid-media` to allow the creation of media queries with custom grids
|
17
|
+
- Added `grid-collapse` to allow the creation of nested layouts
|
17
18
|
|
18
19
|
### Changed
|
19
20
|
|
data/bower.json
CHANGED
data/contrib/index.html
CHANGED
@@ -64,6 +64,19 @@
|
|
64
64
|
<h3>Grid Media Queries</h3>
|
65
65
|
</div>
|
66
66
|
<div class="grid-column--media-3-to-6 box"></div>
|
67
|
+
<div class="grid__column--full">
|
68
|
+
<h3>Grid collapse</h3>
|
69
|
+
</div>
|
70
|
+
<div class="grid__column--thirds box"></div>
|
71
|
+
<div class="grid__column--thirds">
|
72
|
+
<div class="grid-collapse">
|
73
|
+
<div class="grid__column--thirds box"></div>
|
74
|
+
<div class="grid__column--thirds box"></div>
|
75
|
+
<div class="grid__column--thirds box"></div>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
<div class="grid__column--thirds box"></div>
|
79
|
+
<div class="grid__column--full">
|
67
80
|
</div>
|
68
81
|
</main>
|
69
82
|
</body>
|
data/contrib/styles.scss
CHANGED
data/core/_neat.scss
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
@charset "UTF-8";
|
2
|
-
// Neat 2.0.0-
|
2
|
+
// Neat 2.0.0-beta.1
|
3
3
|
// http://neat.bourbon.io
|
4
4
|
// Copyright 2012 thoughtbot, inc.
|
5
5
|
// MIT License
|
@@ -13,6 +13,7 @@
|
|
13
13
|
@import "neat/functions/neat-parse-columns";
|
14
14
|
@import "neat/functions/neat-parse-media";
|
15
15
|
|
16
|
+
@import "neat/mixins/grid-collapse";
|
16
17
|
@import "neat/mixins/grid-column";
|
17
18
|
@import "neat/mixins/grid-container";
|
18
19
|
@import "neat/mixins/grid-media";
|
@@ -0,0 +1,36 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
/// Creates collapsed grid object that consumes the gutters of its container,
|
3
|
+
/// for use in nested layouts.
|
4
|
+
///
|
5
|
+
/// @group features
|
6
|
+
///
|
7
|
+
/// @name Grid collapse
|
8
|
+
///
|
9
|
+
/// @argument {map} $grid [$neat-grid]
|
10
|
+
/// The grid used to determine gutter size.
|
11
|
+
///
|
12
|
+
/// @example scss
|
13
|
+
/// .element {
|
14
|
+
/// @include grid-collapse;
|
15
|
+
/// }
|
16
|
+
///
|
17
|
+
/// @example css
|
18
|
+
/// .element {
|
19
|
+
/// float: left;
|
20
|
+
/// margin-left: -20px;
|
21
|
+
/// margin-right: -20px;
|
22
|
+
/// width: calc(100% + 40px);
|
23
|
+
/// }
|
24
|
+
|
25
|
+
@mixin grid-collapse($grid: $neat-grid) {
|
26
|
+
$_grid-gutter: _retrieve-neat-setting($grid, gutter);
|
27
|
+
|
28
|
+
@if unit($_grid-gutter) == "%" {
|
29
|
+
@warn "`grid-collapse` is not compatible with percentage based gutters.";
|
30
|
+
}
|
31
|
+
|
32
|
+
float: left;
|
33
|
+
margin-left: -($_grid-gutter);
|
34
|
+
margin-right: -($_grid-gutter);
|
35
|
+
width: calc(100% + #{($_grid-gutter * 2)});
|
36
|
+
}
|
@@ -4,6 +4,10 @@
|
|
4
4
|
/// you would like to scope to. If only a number is defined, it is assumed this
|
5
5
|
/// is a `min-with` value. Your custom grid can then be passed to the mixin.
|
6
6
|
///
|
7
|
+
/// @group features
|
8
|
+
///
|
9
|
+
/// @name Grid media
|
10
|
+
///
|
7
11
|
/// @argument {map} $grid
|
8
12
|
/// The grid used to generate the column.
|
9
13
|
///
|
@@ -1,13 +1,17 @@
|
|
1
1
|
@charset "UTF-8";
|
2
2
|
/// Neat’s default grid.
|
3
3
|
///
|
4
|
+
/// @group settings
|
5
|
+
///
|
4
6
|
/// @type map
|
5
7
|
///
|
8
|
+
/// @name Default settings
|
9
|
+
///
|
6
10
|
/// @property {number (unitless)} columns [12]
|
7
|
-
///
|
11
|
+
/// Default number of the total grid columns.
|
8
12
|
///
|
9
13
|
/// @property {number (with unit)} gutter [20px]
|
10
|
-
/// Default grid gutter width.
|
14
|
+
/// Default grid gutter width between columns.
|
11
15
|
///
|
12
16
|
/// @property {string | number (with unit)} gutter [null]
|
13
17
|
/// Grid media query.
|
@@ -21,16 +25,20 @@ $_neat-grid-defaults: (
|
|
21
25
|
);
|
22
26
|
|
23
27
|
/// This variable is a sass map that overrides Neat's default grid settings.
|
24
|
-
/// Use this to define your project's grid properties incluting gutters
|
28
|
+
/// Use this to define your project's grid properties incluting gutters and
|
25
29
|
/// total column count.
|
26
30
|
///
|
27
31
|
/// @type map
|
28
32
|
///
|
33
|
+
/// @group settings
|
34
|
+
///
|
35
|
+
/// @name Neat grid
|
36
|
+
///
|
29
37
|
/// @property {number (unitless)} columns [12]
|
30
|
-
/// Number of grid columns.
|
38
|
+
/// Number of the total grid columns.
|
31
39
|
///
|
32
40
|
/// @property {number (with unit)} gutter [20px]
|
33
|
-
/// Grid gutter width.
|
41
|
+
/// Grid gutter width between columns.
|
34
42
|
///
|
35
43
|
/// @example scss
|
36
44
|
/// $neat-grid: (
|
@@ -39,3 +47,47 @@ $_neat-grid-defaults: (
|
|
39
47
|
/// );
|
40
48
|
|
41
49
|
$neat-grid: () !default;
|
50
|
+
|
51
|
+
/// If you would like to have multiple grids in a single project, you can do
|
52
|
+
/// this by defining a new map stored within a variable of your choosing. This
|
53
|
+
/// variable can then be passed directly in to any of Neat's mixins like
|
54
|
+
/// [`grid-span(12, $my-custom-grid)`](#grid-span).
|
55
|
+
///
|
56
|
+
/// Custom grids are especially useful with [`grid-media`](#grid-media). By
|
57
|
+
/// defining a `media` attribute within your custom grid, you are able to easily
|
58
|
+
/// define both the attributes of a grid as well as at what breakpoint this grid
|
59
|
+
/// should activate.
|
60
|
+
///
|
61
|
+
/// @type map
|
62
|
+
///
|
63
|
+
/// @group settings
|
64
|
+
///
|
65
|
+
/// @name Custom grids
|
66
|
+
///
|
67
|
+
/// @see {mixin} Grid media
|
68
|
+
///
|
69
|
+
/// @property {number (unitless)} columns [12]
|
70
|
+
/// Number of the total grid columns.
|
71
|
+
///
|
72
|
+
/// @property {number (with unit)} gutter [20px]
|
73
|
+
/// Grid gutter width between columns.
|
74
|
+
///
|
75
|
+
/// @property {number (with unit) | string | null} media [null]
|
76
|
+
/// The `@media` definition that is used by the [`grid-media`](#grid-media)
|
77
|
+
/// mixin to detirmine the media properties.
|
78
|
+
///
|
79
|
+
/// @example scss
|
80
|
+
/// $my-custom-grid: (
|
81
|
+
/// columns: 12,
|
82
|
+
/// gutter: 20px,
|
83
|
+
/// media: 1200px,
|
84
|
+
/// );
|
85
|
+
///
|
86
|
+
/// $other-custom-grid-for-print: (
|
87
|
+
/// columns: 14,
|
88
|
+
/// gutter: 1.5rem,
|
89
|
+
/// media: print,
|
90
|
+
/// );
|
91
|
+
///
|
92
|
+
|
93
|
+
$neat-custom-grid: () !default;
|
data/lib/neat/version.rb
CHANGED
data/package.json
CHANGED
@@ -0,0 +1,39 @@
|
|
1
|
+
@import "setup";
|
2
|
+
|
3
|
+
$medium-screen: 1000px;
|
4
|
+
|
5
|
+
$custom-neat-grid: (
|
6
|
+
columns: 12,
|
7
|
+
gutter: 50px,
|
8
|
+
media: $medium-screen,
|
9
|
+
);
|
10
|
+
|
11
|
+
$specific-neat-grid: (
|
12
|
+
columns: 12,
|
13
|
+
gutter: 80px,
|
14
|
+
media: "only screen and (min-width: 1000px) and (max-width: 1100px)",
|
15
|
+
);
|
16
|
+
|
17
|
+
$print-neat-grid: (
|
18
|
+
columns: 10,
|
19
|
+
gutter: 20px,
|
20
|
+
media: print,
|
21
|
+
);
|
22
|
+
|
23
|
+
.grid-column-media-custom-neat-grid {
|
24
|
+
@include grid-media($custom-neat-grid) {
|
25
|
+
@include grid-column(3);
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
.grid-column-media-specific-neat-grid {
|
30
|
+
@include grid-media($specific-neat-grid) {
|
31
|
+
@include grid-column(6);
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
.grid-column-media-print-neat-grid {
|
36
|
+
@include grid-media($print-neat-grid) {
|
37
|
+
@include grid-column(8);
|
38
|
+
}
|
39
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "grid-collapse" do
|
4
|
+
before(:all) do
|
5
|
+
ParserSupport.parse_file("mixins/grid-collapse")
|
6
|
+
end
|
7
|
+
|
8
|
+
context "called with default settings" do
|
9
|
+
it "adds margin for just the gutter with no specified column" do
|
10
|
+
ruleset = "float: left; " +
|
11
|
+
"margin-left: -20px; " +
|
12
|
+
"margin-right: -20px; " +
|
13
|
+
"width: calc(100% + 40px);"
|
14
|
+
expect(".grid-collapse-default").to have_ruleset(ruleset)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
context "called with custom settings" do
|
19
|
+
it "adds margin for just the gutter with no specified column" do
|
20
|
+
ruleset = "float: left; " +
|
21
|
+
"margin-left: -4rem; " +
|
22
|
+
"margin-right: -4rem; " +
|
23
|
+
"width: calc(100% + 8rem);"
|
24
|
+
|
25
|
+
expect(".grid-collapse-custom").to have_ruleset(ruleset)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "@include grid-media() {...}" do
|
4
|
+
before(:all) do
|
5
|
+
ParserSupport.parse_file("mixins/grid-media")
|
6
|
+
end
|
7
|
+
|
8
|
+
context "with argument ($custom-neat-grid)" do
|
9
|
+
it "outputs @media only screen and (min-width: 1000px)" do
|
10
|
+
expect(".grid-column-media-custom-neat-grid").to be_contained_in("only screen and (min-width: 1000px)")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context "with argument ($specific-neat-grid)" do
|
15
|
+
it "outputs @media only screen and (min-width: 1000px) and (max-width: 1100px)" do
|
16
|
+
expect(".grid-column-media-specific-neat-grid").to be_contained_in("only screen and (min-width: 1000px) and (max-width: 1100px)")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context "with argument ($print-neat-grid)" do
|
21
|
+
it "outputs @media print" do
|
22
|
+
expect(".grid-column-media-print-neat-grid").to be_contained_in("print")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Oliveira
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2016-
|
17
|
+
date: 2016-08-20 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: aruba
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- contrib/index.html
|
142
142
|
- contrib/patterns/_box.scss
|
143
143
|
- contrib/patterns/_global.scss
|
144
|
+
- contrib/patterns/_grid-collapse.scss
|
144
145
|
- contrib/patterns/_grid-media.scss
|
145
146
|
- contrib/patterns/_grid-nested.scss
|
146
147
|
- contrib/patterns/_grid-push.scss
|
@@ -154,6 +155,7 @@ files:
|
|
154
155
|
- core/neat/functions/_neat-parse-columns.scss
|
155
156
|
- core/neat/functions/_neat-parse-media.scss
|
156
157
|
- core/neat/functions/_retrieve-neat-settings.scss
|
158
|
+
- core/neat/mixins/_grid-collapse.scss
|
157
159
|
- core/neat/mixins/_grid-column.scss
|
158
160
|
- core/neat/mixins/_grid-container.scss
|
159
161
|
- core/neat/mixins/_grid-media.scss
|
@@ -173,16 +175,20 @@ files:
|
|
173
175
|
- spec/fixtures/functions/neat-column-width.scss
|
174
176
|
- spec/fixtures/functions/neat-parse-media.scss
|
175
177
|
- spec/fixtures/functions/retrieve-neat-settings.scss
|
178
|
+
- spec/fixtures/mixins/grid-collapse.scss
|
176
179
|
- spec/fixtures/mixins/grid-column.scss
|
177
180
|
- spec/fixtures/mixins/grid-container.scss
|
181
|
+
- spec/fixtures/mixins/grid-media.scss
|
178
182
|
- spec/fixtures/mixins/grid-push.scss
|
179
183
|
- spec/fixtures/mixins/grid-shift.scss
|
180
184
|
- spec/neat/functions/neat_column_default_spec.rb
|
181
185
|
- spec/neat/functions/neat_column_width_spec.rb
|
182
186
|
- spec/neat/functions/neat_parse_media_spec.rb
|
183
187
|
- spec/neat/functions/retrieve_neat_settings_spec.rb
|
188
|
+
- spec/neat/mixins/grid_collapse_spec.rb
|
184
189
|
- spec/neat/mixins/grid_column_spec.rb
|
185
190
|
- spec/neat/mixins/grid_container_spec.rb
|
191
|
+
- spec/neat/mixins/grid_media_spec.rb
|
186
192
|
- spec/neat/mixins/grid_push_spec.rb
|
187
193
|
- spec/neat/mixins/grid_shift_spec.rb
|
188
194
|
- spec/spec_helper.rb
|
@@ -212,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
218
|
version: 1.3.1
|
213
219
|
requirements: []
|
214
220
|
rubyforge_project:
|
215
|
-
rubygems_version: 2.
|
221
|
+
rubygems_version: 2.5.1
|
216
222
|
signing_key:
|
217
223
|
specification_version: 4
|
218
224
|
summary: A lightweight Sass grid framework
|