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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 110fa26ad3c105db28d667bf2258b342e374db69
4
- data.tar.gz: bdd7576a1b0f4d0a0f0bbc18988366711115a587
3
+ metadata.gz: c3787ca54822b2cc33778821496950fa92f8b8d7
4
+ data.tar.gz: f521238ccd45444adcd4d66fe39e5d3667d91ea2
5
5
  SHA512:
6
- metadata.gz: 0b9b5db6ca0f9db09b2570c80a4c3e3f99bc5e181ce9e01d303940273460a4a8c0fe167c459a44e122a536ec789c45453afc18fb710e8102ac83642bedce99bd
7
- data.tar.gz: 46bc3ad0014c093d8679044070a0e720996056a2e082dfa708e4989c943cb258185b18f454269a08f1db38b7a55d580b1f224c9e3f9055c3f9c44f9e450f35c3
6
+ metadata.gz: 266dbbb6933f76906bcd329300ab318bf8e77ec544848f6b237b4ec7c22defbe5331dfde6d3cebe7baf59d2bf70cfc646d8a01d1696d122f7969ca1b5605a33b
7
+ data.tar.gz: 2f015d7aabf6bd4d69f5b2514cf3a8701e8825dc7d791d1dbece56a976abb7286c925a204060c18a028fd7ac03cafeb1e8e0b922c9cc608e27479a601a763369
@@ -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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "neat",
3
3
  "description": "A lightweight, semantic grid framework built with Bourbon",
4
- "version": "2.0.0-alpha.1",
4
+ "version": "2.0.0-beta.1",
5
5
  "main": "core/_neat.scss",
6
6
  "license": "MIT",
7
7
  "ignore": [
@@ -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>
@@ -0,0 +1,3 @@
1
+ .grid-collapse {
2
+ @include grid-collapse;
3
+ }
@@ -6,6 +6,7 @@
6
6
  @import "patterns/box";
7
7
  @import "patterns/global";
8
8
  @import "patterns/grid";
9
+ @import "patterns/grid-collapse";
9
10
  @import "patterns/grid-nested";
10
11
  @import "patterns/grid-push";
11
12
  @import "patterns/grid-shift";
@@ -1,5 +1,5 @@
1
1
  @charset "UTF-8";
2
- // Neat 2.0.0-alpha.1
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
+ }
@@ -1,6 +1,10 @@
1
1
  @charset "UTF-8";
2
2
  /// Creates Neat a grid column of requested size.
3
3
  ///
4
+ /// @group features
5
+ ///
6
+ /// @name Grid column
7
+ ///
4
8
  /// @argument {number (unitless)} $columns [null]
5
9
  ///
6
10
  /// @argument {map} $grid [$neat-grid]
@@ -1,6 +1,10 @@
1
1
  @charset "UTF-8";
2
2
  /// Creates a Neat grid container with clearfix.
3
3
  ///
4
+ /// @group features
5
+ ///
6
+ /// @name Grid containter
7
+ ///
4
8
  /// @argument {map} $grid [$neat-grid]
5
9
  /// The type of grid for this column.
6
10
  ///
@@ -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,6 +1,10 @@
1
1
  @charset "UTF-8";
2
2
  /// Push or pull a Neat grid column by manipulating its left margin.
3
3
  ///
4
+ /// @group features
5
+ ///
6
+ /// @name Grid push
7
+ ///
4
8
  /// @argument {number (unitless)} $push [false]
5
9
  ///
6
10
  /// @argument {map} $grid [$neat-grid]
@@ -2,6 +2,10 @@
2
2
  /// Shift columns and reorder them within their container using relative
3
3
  /// positioning.
4
4
  ///
5
+ /// @group features
6
+ ///
7
+ /// @name Grid shift
8
+ ///
5
9
  /// @argument {number (unitless)} $shift [false]
6
10
  ///
7
11
  /// @argument {map} $grid [$neat-grid]
@@ -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
- /// Deefault number of grid columns.
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, and
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;
@@ -1,3 +1,3 @@
1
1
  module Neat
2
- VERSION = "2.0.0.alpha.1"
2
+ VERSION = "2.0.0.beta.1"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bourbon-neat",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-beta.1",
4
4
  "description": "A lightweight, semantic grid framework built with Bourbon",
5
5
  "keywords": [
6
6
  "columns",
@@ -0,0 +1,14 @@
1
+ @import "setup";
2
+
3
+ $custom-grid: (
4
+ columns: 6,
5
+ gutter: 4rem,
6
+ );
7
+
8
+ .grid-collapse-default {
9
+ @include grid-collapse;
10
+ }
11
+
12
+ .grid-collapse-custom {
13
+ @include grid-collapse($custom-grid);
14
+ }
@@ -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.alpha.1
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-07-23 00:00:00.000000000 Z
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.6.6
221
+ rubygems_version: 2.5.1
216
222
  signing_key:
217
223
  specification_version: 4
218
224
  summary: A lightweight Sass grid framework