neat 2.0.0.beta.1 → 2.0.0.beta.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3787ca54822b2cc33778821496950fa92f8b8d7
4
- data.tar.gz: f521238ccd45444adcd4d66fe39e5d3667d91ea2
3
+ metadata.gz: 0244ce326d07ed8e5a37123b8560c95683526b34
4
+ data.tar.gz: 1749d9865aeb8be2230fa47754ee2a55ae9d5a5f
5
5
  SHA512:
6
- metadata.gz: 266dbbb6933f76906bcd329300ab318bf8e77ec544848f6b237b4ec7c22defbe5331dfde6d3cebe7baf59d2bf70cfc646d8a01d1696d122f7969ca1b5605a33b
7
- data.tar.gz: 2f015d7aabf6bd4d69f5b2514cf3a8701e8825dc7d791d1dbece56a976abb7286c925a204060c18a028fd7ac03cafeb1e8e0b922c9cc608e27479a601a763369
6
+ metadata.gz: ceac4186355f6d0945795cdd97f61ac39fe07ff0e1148f1ee95eb77c6eee5301096eaadf8dd2bcc1cab0df1cd192488d281f23c8e18a7d20912611ad2d6a121b
7
+ data.tar.gz: e13819e5b69fddc15afe7d260f366725f48c047af3733ea4681a87f0afd60426715b7f032c64ae0264a9272d0894de8d532d16c6177003ca88d12a3de0b3c489
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.3.1
data/CHANGELOG.md CHANGED
@@ -5,6 +5,32 @@ project adheres to [Semantic Versioning](http://semver.org).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [2.0.0.beta.2]
9
+
10
+ ### Added
11
+
12
+ - Added `grid-visual` to show visual grid guides
13
+ - Added ltr/rtl support
14
+
15
+ ### Removed
16
+
17
+ - Removed `node-sass` dependency from `package.json`
18
+
19
+ ## [2.0.0.beta.1]
20
+
21
+ ### Added
22
+
23
+ - Added `grid-collapse` to allow the creation of nested layouts
24
+
25
+ ## [2.0.0.alpha.1]
26
+
27
+ ### Added
28
+
29
+ - Added `grid-shift` functionality
30
+ - Added `grid-media` to allow the creation of media queries with custom grids
31
+
32
+ ## [2.0.0.alpha.0]
33
+
8
34
  ### Added
9
35
 
10
36
  - Added `$neat-grid` map to store user defined default grid properties
@@ -12,9 +38,6 @@ project adheres to [Semantic Versioning](http://semver.org).
12
38
  - Added improved documentation and releasing information
13
39
  - Added `grid-container` for floated grid which contains a simple clearfix
14
40
  - Added `grid-push` functionality
15
- - Added `grid-shift` functionality
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
18
41
 
19
42
  ### Changed
20
43
 
@@ -54,6 +77,7 @@ project adheres to [Semantic Versioning](http://semver.org).
54
77
  - `$visual-grid-index` has been removed
55
78
  - `$visual-grid-opacity` has been removed
56
79
 
80
+
57
81
  ## 1.8.0 - 2016-06-21
58
82
 
59
83
  ### Added
@@ -279,4 +303,8 @@ project adheres to [Semantic Versioning](http://semver.org).
279
303
 
280
304
  - Initial release
281
305
 
282
- [Unreleased]: https://github.com/thoughtbot/neat/compare/v1.8.0...neat-2.0.0
306
+ [Unreleased]: https://github.com/thoughtbot/neat/compare/v2.0.0.beta.1...neat-2.0.0
307
+ [2.0.0.beta.2]: https://github.com/thoughtbot/neat/compare/v2.0.0.beta.1...v2.0.0.beta.2
308
+ [2.0.0.beta.1]: https://github.com/thoughtbot/neat/compare/v2.0.0.alpha.1...v2.0.0.beta.1
309
+ [2.0.0.alpha.1]: https://github.com/thoughtbot/neat/compare/v2.0.0.alpha.0...v2.0.0.alpha.1
310
+ [2.0.0.alpha.0]: https://github.com/thoughtbot/neat/compare/v1.8.0...v2.0.0.alpha.0
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-beta.1",
4
+ "version": "2.0.0-beta.2",
5
5
  "main": "core/_neat.scss",
6
6
  "license": "MIT",
7
7
  "ignore": [
@@ -2,3 +2,7 @@ $grid--nested: (
2
2
  columns: 3,
3
3
  gutter: 0,
4
4
  );
5
+
6
+ $grid--rtl: (
7
+ direction: rtl,
8
+ );
data/contrib/index.html CHANGED
@@ -19,7 +19,7 @@
19
19
  </p>
20
20
  </header>
21
21
  <main role="main">
22
- <div class="grid">
22
+ <div class="grid grid-visual">
23
23
  <div class="grid__column--full">
24
24
  <h3>Basic Floated Grid</h3>
25
25
  </div>
@@ -35,6 +35,12 @@
35
35
  <div class="grid__column box"></div>
36
36
  <div class="grid__column box"></div>
37
37
  <div class="grid__column box"></div>
38
+ <div class="grid__column--full">
39
+ <h3>RTL Grid</h3>
40
+ </div>
41
+ <div class="grid--rtl__column--thirds box">&nbsp;First</div>
42
+ <div class="grid--rtl__column--thirds box">&nbsp;Second</div>
43
+ <div class="grid--rtl__column--thirds box">&nbsp;Third</div>
38
44
  <div class="grid__column--full">
39
45
  <h3>Nested Grid</h3>
40
46
  </div>
@@ -48,7 +54,6 @@
48
54
  <div class="grid__column--full">
49
55
  <h3>Push Grid</h3>
50
56
  </div>
51
- <div class="grid__column--thirds box grid-push--3"></div>
52
57
  <div class="grid__column--full">
53
58
  <h3>Shift Grid</h3>
54
59
  </div>
@@ -76,7 +81,6 @@
76
81
  </div>
77
82
  </div>
78
83
  <div class="grid__column--thirds box"></div>
79
- <div class="grid__column--full">
80
84
  </div>
81
85
  </main>
82
86
  </body>
@@ -0,0 +1,3 @@
1
+ .grid-visual {
2
+ @include grid-visual;
3
+ }
@@ -10,6 +10,10 @@
10
10
  @include grid-column(4);
11
11
  }
12
12
 
13
+ .grid--rtl__column--thirds {
14
+ @include grid-column(4, $grid--rtl);
15
+ }
16
+
13
17
  .grid__column--4 {
14
18
  @include grid-column(4);
15
19
  }
data/contrib/styles.scss CHANGED
@@ -11,3 +11,4 @@
11
11
  @import "patterns/grid-push";
12
12
  @import "patterns/grid-shift";
13
13
  @import "patterns/grid-media";
14
+ @import "patterns/grid-visual";
data/core/_neat.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  @charset "UTF-8";
2
- // Neat 2.0.0-beta.1
2
+ // Neat 2.0.0-beta.2
3
3
  // http://neat.bourbon.io
4
4
  // Copyright 2012 thoughtbot, inc.
5
5
  // MIT License
@@ -10,8 +10,11 @@
10
10
  @import "neat/functions/neat-column-default";
11
11
  @import "neat/functions/neat-column-width";
12
12
  @import "neat/functions/neat-column-ratio";
13
+ @import "neat/functions/neat-float-direction";
14
+ @import "neat/functions/neat-opposite-direction";
13
15
  @import "neat/functions/neat-parse-columns";
14
16
  @import "neat/functions/neat-parse-media";
17
+ @import "neat/functions/neat-append-grid-visual";
15
18
 
16
19
  @import "neat/mixins/grid-collapse";
17
20
  @import "neat/mixins/grid-column";
@@ -19,3 +22,4 @@
19
22
  @import "neat/mixins/grid-media";
20
23
  @import "neat/mixins/grid-push";
21
24
  @import "neat/mixins/grid-shift";
25
+ @import "neat/mixins/grid-visual";
@@ -0,0 +1,21 @@
1
+ @charset "UTF-8";
2
+ /// Append attributes to a the `$_grid-visual` variable in `grid-visual` mixin
3
+ ///
4
+ /// @argument {map} $grid
5
+ ///
6
+ /// @argument {number (unitless) | null} $columns
7
+ ///
8
+ /// @return {number}
9
+ ///
10
+ /// @example scss
11
+ /// _neat-column-default($neat-grid, 4)
12
+ ///
13
+ /// @access private
14
+
15
+ @function _neat-append-grid-visual($grid-visual-list, $attributes) {
16
+ @each $attribute in $attributes {
17
+ $grid-visual-list: append($grid-visual-list, $attribute, comma);
18
+ }
19
+
20
+ @return $grid-visual-list;
21
+ }
@@ -0,0 +1,22 @@
1
+ @charset "UTF-8";
2
+ /// Return the float direction of the grid.
3
+ ///
4
+ /// @argument {map} $grid
5
+ ///
6
+ /// @return {string}
7
+ ///
8
+ /// @example scss
9
+ /// _neat-float-direction($neat-grid)
10
+ ///
11
+ /// @access private
12
+
13
+ @function _neat-float-direction($grid) {
14
+ $_direction: _retrieve-neat-setting($grid, direction);
15
+ $_float-direction: null;
16
+ @if $_direction == "ltr" {
17
+ $_float-direction: left;
18
+ } @else if $_direction == "rtl" {
19
+ $_float-direction: right;
20
+ }
21
+ @return $_float-direction;
22
+ }
@@ -0,0 +1,22 @@
1
+ @charset "UTF-8";
2
+ /// Return the oppoite of the float direction of the grid.
3
+ ///
4
+ /// @argument {map} $grid
5
+ ///
6
+ /// @return {string}
7
+ ///
8
+ /// @example scss
9
+ /// _neat-opposite-direction($neat-grid)
10
+ ///
11
+ /// @access private
12
+
13
+ @function _neat-opposite-direction($grid) {
14
+ $_direction: _retrieve-neat-setting($grid, direction);
15
+ $_float-direction: null;
16
+ @if $_direction == "ltr" {
17
+ $_float-direction: right;
18
+ } @else if $_direction == "rtl" {
19
+ $_float-direction: left;
20
+ }
21
+ @return $_float-direction;
22
+ }
@@ -29,8 +29,8 @@
29
29
  @warn "`grid-collapse` is not compatible with percentage based gutters.";
30
30
  }
31
31
 
32
- float: left;
33
- margin-left: -($_grid-gutter);
34
- margin-right: -($_grid-gutter);
32
+ float: _neat-float-direction($grid);
33
+ margin-#{_neat-float-direction($grid)}: -($_grid-gutter);
34
+ margin-#{_neat-opposite-direction($grid)}: -($_grid-gutter);
35
35
  width: calc(100% + #{($_grid-gutter * 2)});
36
36
  }
@@ -28,6 +28,6 @@
28
28
  $_grid-gutter: _retrieve-neat-setting($grid, gutter);
29
29
 
30
30
  width: calc(#{_neat-column-width($grid, $columns)});
31
- float: left;
32
- margin-left: $_grid-gutter;
31
+ float: _neat-float-direction($grid);
32
+ margin-#{_neat-float-direction($grid)}: $_grid-gutter;
33
33
  }
@@ -28,9 +28,9 @@
28
28
  @if $push {
29
29
  $_gutter-affordance: $_grid-gutter * 2;
30
30
  $_margin-value: calc(#{_neat-column-width($grid, $push)} + #{$_gutter-affordance});
31
- margin-left: $_margin-value;
31
+ margin-#{_neat-float-direction($grid)}: $_margin-value;
32
32
  } @else {
33
33
  $_margin-value: _retrieve-neat-setting($grid, gutter);
34
- margin-left: $_margin-value;
34
+ margin-#{_neat-float-direction($grid)}: $_margin-value;
35
35
  }
36
36
  }
@@ -26,9 +26,9 @@
26
26
  @mixin grid-shift($shift: false, $grid: $neat-grid) {
27
27
  @if $shift {
28
28
  $_shift-value: calc(#{_neat-column-width($grid, $shift)} + #{_retrieve-neat-setting($grid, gutter)});
29
- left: $_shift-value;
29
+ #{_neat-float-direction($grid)}: $_shift-value;
30
30
  } @else {
31
- left: auto;
31
+ #{_neat-float-direction($grid)}: auto;
32
32
  }
33
33
 
34
34
  position: relative;
@@ -0,0 +1,85 @@
1
+ @charset "UTF-8";
2
+ /// Creates a guide on a grid container to visualise the columns.
3
+ ///
4
+ /// @group features
5
+ ///
6
+ /// @name Grid visual
7
+ ///
8
+ /// @argument {color} $color
9
+ /// The color of the guide lines created.
10
+ ///
11
+ /// @argument {map} $grid [$neat-grid]
12
+ /// The grid used to determine the guide
13
+ ///
14
+ /// @example scss
15
+ /// .element {
16
+ /// @include grid-visual;
17
+ /// }
18
+ ///
19
+ /// @example css
20
+ /// .element {
21
+ /// background-image: … ;
22
+ /// }
23
+
24
+ @mixin grid-visual($color: null, $grid: $neat-grid) {
25
+ @if not $color {
26
+ $color: _retrieve-neat-setting($grid, color);
27
+ }
28
+
29
+ $_grid-columns: _retrieve-neat-setting($grid, columns);
30
+ $_grid-gutter: _retrieve-neat-setting($grid, gutter);
31
+ $_grid-visual-object: () !default;
32
+ $_grid-visual:
33
+ $color,
34
+ $color 1px,
35
+ transparent 1px,
36
+ transparent $_grid-gutter,
37
+ $color calc(#{$_grid-gutter} + 1px),
38
+ transparent calc(#{$_grid-gutter} + 2px),
39
+ ;
40
+
41
+ @for $i from 1 to $_grid-columns {
42
+ $_grid-visual-local: (
43
+ #{$i}: "#{_neat-column-width($grid, $i)} + #{$_grid-gutter}",
44
+ );
45
+
46
+ $_grid-visual-object: map-merge($_grid-visual-object, $_grid-visual-local);
47
+ }
48
+
49
+ @each $stop, $location in $_grid-visual-object {
50
+ $_grid-visual-loop-list:
51
+ transparent calc(#{$location}),
52
+ $color calc(#{$location}),
53
+ $color calc(#{$location} + 1px),
54
+ transparent calc(#{$location} + 1px),
55
+ transparent calc(#{$location} + #{$_grid-gutter}),
56
+ $color calc(#{$location} + #{$_grid-gutter}),
57
+ $color calc(#{$location} + #{$_grid-gutter} + 1px),
58
+ transparent calc(#{$location} + #{$_grid-gutter} + 1px),
59
+ ;
60
+
61
+ $_grid-visual: _neat-append-grid-visual($_grid-visual, $_grid-visual-loop-list);
62
+ }
63
+
64
+ $_grid-visual-loop-list:
65
+ transparent calc(100% - #{$_grid-gutter}),
66
+ $color calc(100% - #{$_grid-gutter}),
67
+ $color calc(100% - #{$_grid-gutter} + 1px),
68
+ transparent calc(100% - #{$_grid-gutter} + 1px),
69
+ transparent calc(100% - 1px),
70
+ $color calc(100% - 1px),
71
+ ;
72
+
73
+ $_grid-visual: _neat-append-grid-visual($_grid-visual, $_grid-visual-loop-list);
74
+
75
+ background-image:
76
+ linear-gradient(to right, $_grid-visual),
77
+ linear-gradient(to bottom,
78
+ $color,
79
+ $color 1px,
80
+ transparent 1px,
81
+ transparent calc(100% - 1px),
82
+ $color calc(100% - 1px),
83
+ $color
84
+ );
85
+ }
@@ -16,12 +16,17 @@
16
16
  /// @property {string | number (with unit)} gutter [null]
17
17
  /// Grid media query.
18
18
  ///
19
+ /// @property {color} color [rgba(#00d4ff, 0.25)]
20
+ /// Default visual grid color.
21
+ ///
19
22
  /// @access private
20
23
 
21
24
  $_neat-grid-defaults: (
22
25
  columns: 12,
23
26
  gutter: 20px,
24
27
  media: null,
28
+ color: rgba(#00d4ff, 0.25),
29
+ direction: ltr,
25
30
  );
26
31
 
27
32
  /// This variable is a sass map that overrides Neat's default grid settings.
data/lib/neat/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Neat
2
- VERSION = "2.0.0.beta.1"
2
+ VERSION = "2.0.0.beta.2"
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bourbon-neat",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.2",
4
4
  "description": "A lightweight, semantic grid framework built with Bourbon",
5
5
  "keywords": [
6
6
  "columns",
@@ -33,9 +33,6 @@
33
33
  "contrib": "gulp",
34
34
  "test": "bundle exec rake"
35
35
  },
36
- "dependencies": {
37
- "node-sass": "^3.8"
38
- },
39
36
  "devDependencies": {
40
37
  "gulp": "^3.9",
41
38
  "gulp-autoprefixer": "^3.1",
@@ -0,0 +1,17 @@
1
+ @import "setup";
2
+
3
+ $ltr-grid: (
4
+ direction: ltr,
5
+ );
6
+
7
+ $rtl-grid: (
8
+ direction: rtl,
9
+ );
10
+
11
+ .neat-float-direction-ltr {
12
+ content: _neat-float-direction($ltr-grid);
13
+ }
14
+
15
+ .neat-float-direction-rtl {
16
+ content: _neat-float-direction($rtl-grid);
17
+ }
@@ -0,0 +1,17 @@
1
+ @import "setup";
2
+
3
+ $ltr-grid: (
4
+ direction: ltr,
5
+ );
6
+
7
+ $rtl-grid: (
8
+ direction: rtl,
9
+ );
10
+
11
+ .neat-opposite-direction-ltr {
12
+ content: _neat-opposite-direction($ltr-grid);
13
+ }
14
+
15
+ .neat-opposite-direction-rtl {
16
+ content: _neat-opposite-direction($rtl-grid);
17
+ }
@@ -0,0 +1,23 @@
1
+ require "spec_helper"
2
+
3
+ describe "neat-float-direction" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("functions/neat-float-direction")
6
+ end
7
+
8
+ context "called with ltr" do
9
+ it "returns left" do
10
+ rule = "content: left"
11
+
12
+ expect(".neat-float-direction-ltr").to have_rule(rule)
13
+ end
14
+ end
15
+
16
+ context "called with rtl" do
17
+ it "returns right" do
18
+ rule = "content: right"
19
+
20
+ expect(".neat-float-direction-rtl").to have_rule(rule)
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ require "spec_helper"
2
+
3
+ describe "neat-opposite-direction" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("functions/neat-opposite-direction")
6
+ end
7
+
8
+ context "called with ltr" do
9
+ it "returns right" do
10
+ rule = "content: right"
11
+
12
+ expect(".neat-opposite-direction-ltr").to have_rule(rule)
13
+ end
14
+ end
15
+
16
+ context "called with rtl" do
17
+ it "returns left" do
18
+ rule = "content: left"
19
+
20
+ expect(".neat-opposite-direction-rtl").to have_rule(rule)
21
+ end
22
+ end
23
+ 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.beta.1
4
+ version: 2.0.0.beta.2
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-08-20 00:00:00.000000000 Z
17
+ date: 2016-12-08 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: aruba
@@ -124,6 +124,7 @@ files:
124
124
  - ".gitignore"
125
125
  - ".hound.yml"
126
126
  - ".npmignore"
127
+ - ".ruby-version"
127
128
  - ".scss-lint.yml"
128
129
  - CHANGELOG.md
129
130
  - CONTRIBUTING.md
@@ -146,12 +147,16 @@ files:
146
147
  - contrib/patterns/_grid-nested.scss
147
148
  - contrib/patterns/_grid-push.scss
148
149
  - contrib/patterns/_grid-shift.scss
150
+ - contrib/patterns/_grid-visual.scss
149
151
  - contrib/patterns/_grid.scss
150
152
  - contrib/styles.scss
151
153
  - core/_neat.scss
154
+ - core/neat/functions/_neat-append-grid-visual.scss
152
155
  - core/neat/functions/_neat-column-default.scss
153
156
  - core/neat/functions/_neat-column-ratio.scss
154
157
  - core/neat/functions/_neat-column-width.scss
158
+ - core/neat/functions/_neat-float-direction.scss
159
+ - core/neat/functions/_neat-opposite-direction.scss
155
160
  - core/neat/functions/_neat-parse-columns.scss
156
161
  - core/neat/functions/_neat-parse-media.scss
157
162
  - core/neat/functions/_retrieve-neat-settings.scss
@@ -161,6 +166,7 @@ files:
161
166
  - core/neat/mixins/_grid-media.scss
162
167
  - core/neat/mixins/_grid-push.scss
163
168
  - core/neat/mixins/_grid-shift.scss
169
+ - core/neat/mixins/_grid-visual.scss
164
170
  - core/neat/settings/_settings.scss
165
171
  - eyeglass-exports.js
166
172
  - index.js
@@ -173,6 +179,8 @@ files:
173
179
  - spec/fixtures/_setup.scss
174
180
  - spec/fixtures/functions/neat-column-default.scss
175
181
  - spec/fixtures/functions/neat-column-width.scss
182
+ - spec/fixtures/functions/neat-float-direction.scss
183
+ - spec/fixtures/functions/neat-opposite-direction.scss
176
184
  - spec/fixtures/functions/neat-parse-media.scss
177
185
  - spec/fixtures/functions/retrieve-neat-settings.scss
178
186
  - spec/fixtures/mixins/grid-collapse.scss
@@ -183,6 +191,8 @@ files:
183
191
  - spec/fixtures/mixins/grid-shift.scss
184
192
  - spec/neat/functions/neat_column_default_spec.rb
185
193
  - spec/neat/functions/neat_column_width_spec.rb
194
+ - spec/neat/functions/neat_float_direction_spec.rb
195
+ - spec/neat/functions/neat_opposite_direction_spec.rb
186
196
  - spec/neat/functions/neat_parse_media_spec.rb
187
197
  - spec/neat/functions/retrieve_neat_settings_spec.rb
188
198
  - spec/neat/mixins/grid_collapse_spec.rb
@@ -218,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
228
  version: 1.3.1
219
229
  requirements: []
220
230
  rubyforge_project:
221
- rubygems_version: 2.5.1
231
+ rubygems_version: 2.6.8
222
232
  signing_key:
223
233
  specification_version: 4
224
234
  summary: A lightweight Sass grid framework