neat 1.8.0 → 1.9.0

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: f802639f3eb89eafca425f71ebbfbdb3ed8b1aff
4
- data.tar.gz: 59b52dc35945401d1674dbd35c073cc220aebf61
3
+ metadata.gz: eb26b456c30e4c434a7cc8647c722e8ff437e57e
4
+ data.tar.gz: ac4e317c5cb46d3ef6508bfe9cd780b777d48392
5
5
  SHA512:
6
- metadata.gz: 0ae72e905832fe0dcf0cada066bc786c92b320ae1be4197d8349da3002e7d451f1fda0a627154a2a92e2c24364be45662e1e2dc29d939045465b424578257252
7
- data.tar.gz: 7e99d8de395b034489334a65a63fce9bd041823f6c617f1eeaf0205a54837444a7e8da99b971db60a323612a68cecf454973ccd67a231228628dcd1c64c88602
6
+ metadata.gz: f6a26d940e3a23528ebcf9a906be74c3603f9b9621fc069c3097cf9c7707540bf382f7b7c1ec7d684a209b5d7200bb5480d395ce53d6afd2eef64b22d0255be3
7
+ data.tar.gz: a1160e62fbdbe674ee29ec41b43c0f5255743cd82a5aa119fe532924b964b4f16c6f7d70f5d7ba8154abd810f336bb4dfbbda0366c38d45310769bffdce34701
@@ -0,0 +1 @@
1
+ 2.3.1
data/README.md CHANGED
@@ -1,11 +1,10 @@
1
1
  [![Neat](http://images.thoughtbot.com/bourbon/neat-logo.svg)](http://neat.bourbon.io)
2
2
 
3
- [![Gem Version](http://img.shields.io/gem/v/neat.svg?style=flat)](https://rubygems.org/gems/neat) [![Travis](http://img.shields.io/travis/thoughtbot/neat.svg?style=flat)](https://travis-ci.org/thoughtbot/neat)
4
- [![Gitter](http://img.shields.io/badge/gitter-neat-ae3dd2.svg?style=flat)](https://gitter.im/thoughtbot/neat)
5
- [![Stack Overflow](http://img.shields.io/badge/stack%20overflow-neat-ae3dd2.svg?style=flat)](http://stackoverflow.com/questions/tagged/neat)
6
-
7
3
  ## A lightweight, semantic grid framework
8
4
 
5
+ **Note: This branch is an archive of Neat v1. The current release is v2 on
6
+ `master`.**
7
+
9
8
  Neat is a fluid grid framework with the aim of being easy enough to use out of the box and flexible enough to customize down the road.
10
9
 
11
10
  - **[Demo](http://neat.bourbon.io)**
@@ -269,7 +268,7 @@ Copyright © 2012–2015 [thoughtbot, inc](http://thoughtbot.com). Neat is free
269
268
 
270
269
  ## About thoughtbot
271
270
 
272
- [<img src="http://thoughtbot.github.io/images/signature.svg" width="250" alt="thoughtbot logo">][hire]
271
+ [<img src="http://presskit.thoughtbot.com/images/signature.svg" width="250" alt="thoughtbot logo">][hire]
273
272
 
274
273
  Neat is maintained and funded by thoughtbot, inc.
275
274
  The names and logos for thoughtbot are trademarks of thoughtbot, inc.
@@ -1,4 +1,4 @@
1
- // Neat 1.8.0
1
+ // Neat 1.9.0
2
2
  // http://neat.bourbon.io
3
3
  // Copyright 2012-2015 thoughtbot, inc.
4
4
  // MIT License
@@ -17,6 +17,7 @@
17
17
  @import "grid/pad";
18
18
  @import "grid/fill-parent";
19
19
  @import "grid/media";
20
+ @import "grid/reset-display";
20
21
  @import "grid/to-deprecate";
21
22
  @import "grid/visual-grid";
22
23
  @import "grid/display-context";
@@ -56,22 +56,26 @@
56
56
  // Generates a striped background
57
57
  @function gradient-stops($grid-columns, $color: $visual-grid-color) {
58
58
  $transparent: transparent;
59
+ $alt-color: darken($color, 10%);
59
60
 
60
61
  $column-width: flex-grid(1, $grid-columns);
61
62
  $gutter-width: flex-gutter($grid-columns);
62
63
  $column-offset: $column-width;
64
+ $alternate: false;
63
65
 
64
- $values: ($transparent 0, $color 0);
66
+ $values: ($transparent 0, if($alternate, $color, $alt-color) 0);
65
67
 
66
68
  @for $i from 1 to $grid-columns*2 {
67
69
  @if is-even($i) {
68
70
  $values: append($values, $transparent $column-offset, comma);
69
- $values: append($values, $color $column-offset, comma);
71
+ $values: append($values, if($alternate, $color, $alt-color) $column-offset, comma);
70
72
  $column-offset: $column-offset + $column-width;
71
73
  } @else {
72
- $values: append($values, $color $column-offset, comma);
74
+ $values: append($values, if($alternate, $color, $alt-color) $column-offset, comma);
73
75
  $values: append($values, $transparent $column-offset, comma);
74
76
  $column-offset: $column-offset + $gutter-width;
77
+
78
+ $alternate: not $alternate;
75
79
  }
76
80
  }
77
81
 
@@ -112,3 +116,39 @@
112
116
 
113
117
  @return $opposite-direction;
114
118
  }
119
+
120
+
121
+ @function to-number($string) {
122
+ $string: str-replace($string, " ", "");
123
+ $strings: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9";
124
+ $numbers: 0 1 2 3 4 5 6 7 8 9;
125
+ $result: 0;
126
+
127
+ @for $i from 1 through str-length($string) {
128
+ $character: str-slice($string, $i, $i);
129
+ $index: index($strings, $character);
130
+
131
+ @if not $index {
132
+ @warn "Unknown character `#{$character}`.";
133
+ @return false;
134
+ }
135
+
136
+ $number: nth($numbers, $index);
137
+ $result: $result * 10 + $number;
138
+ }
139
+
140
+ @return $result;
141
+ }
142
+
143
+ @function str-replace($string, $search, $replace: "") {
144
+ $index: str-index($string, $search);
145
+
146
+ @if $index {
147
+ $first: str-slice($string, 1, $index - 1);
148
+ $last-slice: str-slice($string, $index + str-length($search));
149
+ $last: str-replace($last-slice, $search, $replace);
150
+ @return $first + $replace + $last;
151
+ }
152
+
153
+ @return $string;
154
+ }
@@ -79,7 +79,32 @@
79
79
  margin-#{$direction}: 0;
80
80
  }
81
81
 
82
- @if type-of($query) == number and unit($query) == "n" {
82
+ @if type-of($query) == string {
83
+ $query: str-replace($query, " ", "");
84
+ $operator: false;
85
+
86
+ @if str_index($query, "+") {
87
+ $operator: "+";
88
+ } @else if str_index($query, "-") {
89
+ $operator: "-";
90
+ }
91
+
92
+ @if $operator {
93
+ $operator-index: str_index($query, $operator);
94
+ $first: str-slice($query, 0, ($operator-index - 1));
95
+ $last: to-number(str-slice($query, ($operator-index + 1), -1));
96
+ @if $operator == "+" {
97
+ $last: $last + 1;
98
+ } @else if $operator == "-" {
99
+ $last: $last - 1;
100
+ }
101
+ $nth: "#{$first}#{$operator}#{$last}";
102
+
103
+ &:nth-child(#{$nth}) {
104
+ clear: $opposite-direction;
105
+ }
106
+ }
107
+ } @else if type-of($query) == number && unit($query) == "n" {
83
108
  &:nth-child(#{$query}+1) {
84
109
  clear: $opposite-direction;
85
110
  }
@@ -6,18 +6,18 @@ $container-display-table: false !default;
6
6
  $layout-direction: LTR !default;
7
7
 
8
8
  @function flex-grid($columns, $container-columns: $fg-max-columns) {
9
- $width: $columns * $fg-column + ($columns - 1) * $fg-gutter;
10
- $container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter;
9
+ $width: flex-width($columns);
10
+ $container-width: flex-width($container-columns);
11
11
  @return percentage($width / $container-width);
12
12
  }
13
13
 
14
14
  @function flex-gutter($container-columns: $fg-max-columns, $gutter: $fg-gutter) {
15
- $container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter;
15
+ $container-width: flex-width($container-columns);
16
16
  @return percentage($gutter / $container-width);
17
17
  }
18
18
 
19
- @function grid-width($n) {
20
- @return $n * $gw-column + ($n - 1) * $gw-gutter;
19
+ @function flex-width($n, $column-width: $fg-column, $gutter-width: $fg-gutter) {
20
+ @return $n * $column-width + ($n - 1) * $gutter-width;
21
21
  }
22
22
 
23
23
  @function get-parent-columns($columns) {
@@ -0,0 +1,14 @@
1
+ /// Resets the active display property to `block`. Particularly useful when changing the display property in a single row.
2
+ ///
3
+ /// @example scss - Usage
4
+ /// .element {
5
+ /// @include row(table);
6
+ /// // Context changed to table display
7
+ /// }
8
+ ///
9
+ /// @include reset-display;
10
+ /// // Context is reset to block display
11
+
12
+ @mixin reset-display {
13
+ $container-display-table: false !global;
14
+ }
@@ -29,16 +29,9 @@
29
29
  /// }
30
30
 
31
31
  @mixin row($display: default, $direction: $default-layout-direction) {
32
- @if $direction != $default-layout-direction {
33
- @include -neat-warn("The $direction argument will be deprecated in future versions in favor of the direction(){...} mixin.");
34
- }
35
32
 
36
33
  $layout-direction: $direction !global;
37
34
 
38
- @if $display != default {
39
- @include -neat-warn("The $display argument will be deprecated in future versions in favor of the display(){...} mixin.");
40
- }
41
-
42
35
  @if $display == table {
43
36
  display: table;
44
37
  @include fill-parent;
@@ -48,22 +48,6 @@
48
48
  @include omega($nth $display, $direction);
49
49
  }
50
50
 
51
- /// Resets the active display property to `block`. Particularly useful when changing the display property in a single row.
52
- ///
53
- /// @example scss - Usage
54
- /// .element {
55
- /// @include row(table);
56
- /// // Context changed to table display
57
- /// }
58
- ///
59
- /// @include reset-display;
60
- /// // Context is reset to block display
61
-
62
- @mixin reset-display {
63
- $container-display-table: false !global;
64
- @include -neat-warn("Resetting $display will be deprecated in future versions in favor of the display(){...} mixin.");
65
- }
66
-
67
51
  /// Resets the active layout direction to the default value set in `$default-layout-direction`. Particularly useful when changing the layout direction in a single row.
68
52
  ///
69
53
  /// @example scss - Usage
data/bower.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "neat",
3
3
  "description": "A lightweight, semantic grid framework",
4
- "version": "1.8.0",
4
+ "version": "1.9.0",
5
5
  "main": "app/assets/stylesheets/_neat.scss",
6
6
  "license": "MIT",
7
7
  "ignore": [
@@ -1,4 +1,4 @@
1
- @import "../app/assets/stylesheets/neat";
1
+ $visual-grid: true !global;
2
2
 
3
3
  // Grid Settings
4
4
  $column: 90px;
@@ -10,6 +10,8 @@ $max-width: 1200px;
10
10
  $medium-screen: 600px;
11
11
  $large-screen: 900px;
12
12
 
13
+ @import "../app/assets/stylesheets/neat";
14
+
13
15
  $medium-screen-up: new-breakpoint(min-width $medium-screen 4);
14
16
  $large-screen-up: new-breakpoint(min-width $large-screen 8);
15
17
 
@@ -18,7 +20,7 @@ $base-line-height: 1.625;
18
20
  $base-spacing: $base-line-height * 1em;
19
21
 
20
22
  // Visual Grid
21
- $visual-grid: true;
23
+
22
24
  $visual-grid-color: #e6f6ff;
23
25
  $visual-grid-opacity: 0.4;
24
26
 
@@ -27,7 +27,7 @@ module Neat
27
27
  end
28
28
  end
29
29
 
30
- desc "update", "Remove Neat"
30
+ desc "remove", "Remove Neat"
31
31
  def remove
32
32
  if neat_files_already_exist?
33
33
  remove_neat_directory
@@ -1,3 +1,3 @@
1
1
  module Neat
2
- VERSION = "1.8.0"
2
+ VERSION = "1.9.0"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bourbon-neat",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "A lightweight, semantic grid framework",
5
5
  "keywords": [
6
6
  "columns",
@@ -33,7 +33,7 @@
33
33
  "test": "echo \"No test specified\""
34
34
  },
35
35
  "dependencies": {
36
- "node-sass": "^3.4"
36
+ "node-sass": "^4.1.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "gulp": "^3.9",
@@ -7,36 +7,59 @@ describe "@include omega()" do
7
7
 
8
8
  context "with no argument" do
9
9
  it "removes right margin" do
10
- expect(".omega-default").to have_rule("margin-right: 0")
10
+ selector = ".omega-default"
11
+ expect(selector).to have_rule("margin-right: 0")
11
12
  end
12
13
  end
13
14
 
14
15
  context "with argument (4n)" do
15
16
  it "removes right margin of nth-child(4n)" do
16
- expect(".omega-nth-default:nth-child(4n)").to have_rule("margin-right: 0")
17
+ selector = ".omega-nth-default:nth-child(4n)"
18
+ expect(selector).to have_rule("margin-right: 0")
17
19
  end
18
20
 
19
21
  it "adds clear to nth-child(4n+1)" do
20
- expect(".omega-nth-default:nth-child(4n+1)").to have_rule("clear: left")
22
+ selector = ".omega-nth-default:nth-child(4n+1)"
23
+ expect(selector).to have_rule("clear: left")
21
24
  end
22
25
  end
23
26
 
24
27
  context "with argument ('4n+1')" do
25
28
  it "removes right margin of nth-child(4n+1)" do
26
- expect(".omega-complex-nth:nth-child(4n+1)").to have_rule("margin-right: 0")
29
+ selector = ".omega-complex-nth:nth-child(4n+1)"
30
+ expect(selector).to have_rule("margin-right: 0")
31
+ end
32
+
33
+ it "adds clear to nth-child('4n+2')" do
34
+ selector = ".omega-complex-nth:nth-child(4n+2)"
35
+ expect(selector).to have_rule("clear: left")
36
+ end
37
+ end
38
+
39
+ context "with argument ('3n-1')" do
40
+ it "removes right margin of nth-child(3n-1)" do
41
+ selector = ".omega-complex-nth-negative:nth-child(3n-1)"
42
+ expect(selector).to have_rule("margin-right: 0")
43
+ end
44
+
45
+ it "adds clear to nth-child('3n-0')" do
46
+ selector = ".omega-complex-nth-negative:nth-child(3n-0)"
47
+ expect(selector).to have_rule("clear: left")
27
48
  end
28
49
  end
29
50
 
30
51
  context "when called inside an RTL row" do
31
52
  context "with no argument" do
32
53
  it "removes left margin" do
33
- expect("section .omega-default-left").to have_rule("margin-left: 0")
54
+ selector = "section .omega-default-left"
55
+ expect(selector).to have_rule("margin-left: 0")
34
56
  end
35
57
  end
36
58
 
37
59
  context "with argument (4n block)" do
38
60
  it "removes left margin of nth-child(4n)" do
39
- expect("section .omega-nth-default-left:nth-child(4n)").to have_rule("margin-left: 0")
61
+ selector = "section .omega-nth-default-left:nth-child(4n)"
62
+ expect(selector).to have_rule("margin-left: 0")
40
63
  end
41
64
  end
42
65
  end
@@ -12,6 +12,10 @@
12
12
  @include omega("4n+1");
13
13
  }
14
14
 
15
+ .omega-complex-nth-negative {
16
+ @include omega("3n-1");
17
+ }
18
+
15
19
  section {
16
20
  @include row($direction: RTL);
17
21
 
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: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Oliveira
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-06-21 00:00:00.000000000 Z
13
+ date: 2017-06-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sass
@@ -164,6 +164,7 @@ files:
164
164
  - ".gitignore"
165
165
  - ".npmignore"
166
166
  - ".rspec"
167
+ - ".ruby-version"
167
168
  - ".scss-lint.yml"
168
169
  - ".travis.yml"
169
170
  - CONTRIBUTING.md
@@ -186,6 +187,7 @@ files:
186
187
  - app/assets/stylesheets/grid/_outer-container.scss
187
188
  - app/assets/stylesheets/grid/_pad.scss
188
189
  - app/assets/stylesheets/grid/_private.scss
190
+ - app/assets/stylesheets/grid/_reset-display.scss
189
191
  - app/assets/stylesheets/grid/_row.scss
190
192
  - app/assets/stylesheets/grid/_shift.scss
191
193
  - app/assets/stylesheets/grid/_span-columns.scss
@@ -258,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
260
  version: '0'
259
261
  requirements: []
260
262
  rubyforge_project: neat
261
- rubygems_version: 2.5.1
263
+ rubygems_version: 2.6.12
262
264
  signing_key:
263
265
  specification_version: 4
264
266
  summary: A lightweight, semantic grid framework