neat 1.7.4 → 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: 8eb2762209caf54b43f3de40b58e45e74ab60745
4
- data.tar.gz: 595b9703a3de3a9e00ed77b01c453c8b959f4aba
3
+ metadata.gz: eb26b456c30e4c434a7cc8647c722e8ff437e57e
4
+ data.tar.gz: ac4e317c5cb46d3ef6508bfe9cd780b777d48392
5
5
  SHA512:
6
- metadata.gz: fcb8d041bc31c465512fc0010af419c261d82f1afb46c2d27f43241a2f64da93968168565c220f8e9dad43bc3bd0bb72af2014a0c75b5b24e8de2fdd29bdbf58
7
- data.tar.gz: 5bcce3921f4a9664d5fec025755f31c0e18ea4ebf59743de499879ad5a56f48957bd0b311fed63bb7f9a4609c878d78b4490b933d05b555c2bb841e3aacffeaf
6
+ metadata.gz: f6a26d940e3a23528ebcf9a906be74c3603f9b9621fc069c3097cf9c7707540bf382f7b7c1ec7d684a209b5d7200bb5480d395ce53d6afd2eef64b22d0255be3
7
+ data.tar.gz: a1160e62fbdbe674ee29ec41b43c0f5255743cd82a5aa119fe532924b964b4f16c6f7d70f5d7ba8154abd810f336bb4dfbbda0366c38d45310769bffdce34701
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.3.1
data/Gulpfile.js CHANGED
@@ -1,5 +1,4 @@
1
- var bourbon = require("bourbon").includePaths,
2
- autoprefix = require("gulp-autoprefixer"),
1
+ var autoprefix = require("gulp-autoprefixer"),
3
2
  connect = require("gulp-connect"),
4
3
  gulp = require("gulp"),
5
4
  sass = require("gulp-sass");
@@ -13,7 +12,7 @@ var paths = {
13
12
  gulp.task("sass", function () {
14
13
  return gulp.src(paths.scss)
15
14
  .pipe(sass({
16
- includePaths: ["styles"].concat(bourbon)
15
+ sourcemaps: true
17
16
  }))
18
17
  .pipe(autoprefix("last 2 versions"))
19
18
  .pipe(gulp.dest("./contrib"))
data/README.md CHANGED
@@ -1,12 +1,11 @@
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)
3
+ ## A lightweight, semantic grid framework
6
4
 
7
- ## A lightweight, semantic grid framework built with Bourbon
5
+ **Note: This branch is an archive of Neat v1. The current release is v2 on
6
+ `master`.**
8
7
 
9
- Neat is a fluid grid framework built with [Bourbon](https://github.com/thoughtbot/bourbon) with the aim of being easy enough to use out of the box and flexible enough to customize down the road.
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)**
12
11
  - **[Documentation](http://thoughtbot.github.io/neat-docs/latest)**
@@ -19,7 +18,6 @@ for updates.
19
18
  ## Requirements
20
19
 
21
20
  - [Sass](https://github.com/sass/sass) 3.3+
22
- - [Bourbon](https://github.com/thoughtbot/bourbon) 4.0+
23
21
  - :warning: If you need **Sass 3.2 support**, you should [use Neat 1.5.1](#installing-older-versions-of-neat)
24
22
 
25
23
  ## Installation
@@ -39,23 +37,16 @@ For command line help, visit our wiki page on Neat’s [command line interface](
39
37
  ```bash
40
38
  gem install sass # or gem update sass
41
39
  ```
42
- ```bash
43
- gem install bourbon # or gem update bourbon
44
- ```
45
40
 
46
41
  3. Install the Neat library into the current directory:
47
42
 
48
- ```bash
49
- bourbon install # if not already installed
50
- ```
51
43
  ```bash
52
44
  neat install
53
45
  ```
54
46
 
55
- 4. Import Neat in your stylesheet, after Bourbon:
47
+ 4. Import Neat in your stylesheet:
56
48
 
57
49
  ```scss
58
- @import "bourbon/bourbon";
59
50
  @import "neat/neat";
60
51
  ```
61
52
 
@@ -81,10 +72,9 @@ For command line help, visit our wiki page on Neat’s [command line interface](
81
72
  bundle update sass
82
73
  ```
83
74
 
84
- 3. Import Neat in your `application.scss`, after Bourbon:
75
+ 3. Import Neat in your `application.scss`:
85
76
 
86
77
  ```scss
87
- @import "bourbon";
88
78
  @import "neat";
89
79
  ```
90
80
 
@@ -98,12 +88,11 @@ For command line help, visit our wiki page on Neat’s [command line interface](
98
88
  npm install --save bourbon-neat
99
89
  ```
100
90
 
101
- 1. If you’re using [Eyeglass](http://eyeglass.rocks), skip to Step 3. Otherwise, you’ll need to add Bourbon and Neat to your node-sass `includePaths` option. `require("bourbon-neat").includePaths` is an array of directories that you should pass to node-sass. How you do this depends on how node-sass is integrated into your project. You will also need to ensure that Bourbon is in the `includePaths` passed to node-sass.
91
+ 1. If you’re using [Eyeglass](http://eyeglass.rocks), skip to Step 3. Otherwise, you’ll need to add Neat to your node-sass `includePaths` option. `require("bourbon-neat").includePaths` is an array of directories that you should pass to node-sass. How you do this depends on how node-sass is integrated into your project.
102
92
 
103
- 1. Import Neat into your Sass files, after Bourbon:
93
+ 1. Import Neat into your Sass files:
104
94
 
105
95
  ```scss
106
- @import "bourbon";
107
96
  @import "neat";
108
97
  ```
109
98
 
@@ -128,7 +117,6 @@ For command line help, visit our wiki page on Neat’s [command line interface](
128
117
  First off, if you are planning to override the default grid settings (12 columns), it is recommended to create a `_grid-settings.scss` file for that purpose. Make sure to import it right *before* importing Neat:
129
118
 
130
119
  ```scss
131
- @import "bourbon/bourbon"; // or "bourbon" when in Rails
132
120
  @import "grid-settings";
133
121
  @import "neat/neat"; // or "neat" when in Rails
134
122
  ```
@@ -280,7 +268,7 @@ Copyright © 2012–2015 [thoughtbot, inc](http://thoughtbot.com). Neat is free
280
268
 
281
269
  ## About thoughtbot
282
270
 
283
- [<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]
284
272
 
285
273
  Neat is maintained and funded by thoughtbot, inc.
286
274
  The names and logos for thoughtbot are trademarks of thoughtbot, inc.
data/Rakefile CHANGED
@@ -8,15 +8,11 @@ RSpec::Core::RakeTask.new(:spec)
8
8
  task :default => :spec
9
9
 
10
10
  task :test do
11
- puts "Creating a Bourbon directory..."
12
- `bourbon install --path test`
13
11
  puts "Generating CSS..."
14
12
  `sass -I . --watch test:css/ --style expanded`
15
13
  end
16
14
 
17
15
  task :clean do
18
- puts "Deleting Bourbon directory..."
19
- `rm -rf test/bourbon`
20
16
  puts "Deleting generated CSS..."
21
17
  `rm -rf css/`
22
18
  end
@@ -1,3 +1,6 @@
1
+ // Mixins
2
+ @import "mixins/clearfix";
3
+
1
4
  // Functions
2
5
  @import "functions/private";
3
6
  @import "functions/new-breakpoint";
@@ -1,4 +1,4 @@
1
- // Neat 1.7.4
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
  }
@@ -13,19 +13,15 @@
13
13
  ///
14
14
  /// @example css - CSS Output
15
15
  /// .element {
16
- /// *zoom: 1;
17
16
  /// max-width: 100%;
18
17
  /// margin-left: auto;
19
18
  /// margin-right: auto;
20
19
  /// }
21
20
  ///
22
- /// .element:before, .element:after {
23
- /// content: " ";
24
- /// display: table;
25
- /// }
26
- ///
27
- /// .element:after {
21
+ /// .element::after {
28
22
  /// clear: both;
23
+ /// content: "";
24
+ /// display: table;
29
25
  /// }
30
26
 
31
27
  @mixin outer-container($local-max-width: $max-width) {
@@ -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
@@ -0,0 +1,25 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Provides an easy way to include a clearfix for containing floats.
4
+ ///
5
+ /// @link http://goo.gl/yP5hiZ
6
+ ///
7
+ /// @example scss
8
+ /// .element {
9
+ /// @include clearfix;
10
+ /// }
11
+ ///
12
+ /// @example css
13
+ /// .element::after {
14
+ /// clear: both;
15
+ /// content: "";
16
+ /// display: block;
17
+ /// }
18
+
19
+ @mixin clearfix {
20
+ &::after {
21
+ clear: both;
22
+ content: "";
23
+ display: block;
24
+ }
25
+ }
@@ -1,16 +1,16 @@
1
1
  @charset "UTF-8";
2
2
 
3
- /// Sets the relative width of a single grid column. The unit used should be the same one used to define `$gutter`. To learn more about `modular-scale()` see [Bourbon docs](http://bourbon.io/docs/#modular-scale). Set with a `!global` flag.
3
+ /// Sets the relative width of a single grid column. The unit used should be the same one used to define `$gutter`. Set with a `!global` flag.
4
4
  ///
5
5
  /// @type Number (Unit)
6
6
 
7
- $column: modular-scale(3, 1em, $golden) !default;
7
+ $column: 4.2358em !default;
8
8
 
9
- /// Sets the relative width of a single grid gutter. The unit used should be the same one used to define `$column`. To learn more about `modular-scale()` see [Bourbon docs](http://bourbon.io/docs/#modular-scale). Set with the `!global` flag.
9
+ /// Sets the relative width of a single grid gutter. The unit used should be the same one used to define `$column`. Set with the `!global` flag.
10
10
  ///
11
11
  /// @type Number (Unit)
12
12
 
13
- $gutter: modular-scale(1, 1em, $golden) !default;
13
+ $gutter: 1.618em !default;
14
14
 
15
15
  /// Sets the total number of columns in the grid. Its value can be overridden inside a media query using the `media()` mixin. Set with the `!global` flag.
16
16
  ///
data/bin/neat CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "neat"
3
+ require File.dirname(__FILE__) + "/../lib/neat.rb"
4
4
 
5
- Neat::Generator.new(ARGV).run
5
+ Neat::Generator.start
data/bower.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "neat",
3
- "description": "A lightweight, semantic grid framework built with Bourbon",
4
- "version": "1.7.4",
3
+ "description": "A lightweight, semantic grid framework",
4
+ "version": "1.9.0",
5
5
  "main": "app/assets/stylesheets/_neat.scss",
6
6
  "license": "MIT",
7
7
  "ignore": [
@@ -19,7 +19,6 @@
19
19
  "test"
20
20
  ],
21
21
  "keywords": [
22
- "bourbon",
23
22
  "columns",
24
23
  "grid",
25
24
  "layout",
@@ -38,8 +37,5 @@
38
37
  "repository": {
39
38
  "type": "git",
40
39
  "url": "https://github.com/thoughtbot/neat.git"
41
- },
42
- "dependencies": {
43
- "bourbon": ">=4.0"
44
40
  }
45
41
  }
data/contrib/styles.scss CHANGED
@@ -1,5 +1,4 @@
1
- @import "bourbon";
2
- @import "../app/assets/stylesheets/neat";
1
+ $visual-grid: true !global;
3
2
 
4
3
  // Grid Settings
5
4
  $column: 90px;
@@ -11,6 +10,8 @@ $max-width: 1200px;
11
10
  $medium-screen: 600px;
12
11
  $large-screen: 900px;
13
12
 
13
+ @import "../app/assets/stylesheets/neat";
14
+
14
15
  $medium-screen-up: new-breakpoint(min-width $medium-screen 4);
15
16
  $large-screen-up: new-breakpoint(min-width $large-screen 8);
16
17
 
@@ -19,7 +20,7 @@ $base-line-height: 1.625;
19
20
  $base-spacing: $base-line-height * 1em;
20
21
 
21
22
  // Visual Grid
22
- $visual-grid: true;
23
+
23
24
  $visual-grid-color: #e6f6ff;
24
25
  $visual-grid-opacity: 0.4;
25
26
 
@@ -35,7 +36,7 @@ $darkerblue: #072f44;
35
36
 
36
37
  body {
37
38
  color: $darkerblue;
38
- font-family: $helvetica;
39
+ font-family: sans-serif;
39
40
  line-height: $base-line-height;
40
41
  margin: 0 0 (1.5rem * 2);
41
42
  text-align: center;
@@ -62,17 +63,17 @@ code {
62
63
  // ============================================
63
64
 
64
65
  .container {
65
- @include margin(null auto);
66
- @include padding(null $gutter);
66
+ margin: 0 auto;
67
67
  max-width: 500px;
68
+ padding: 0 $gutter;
68
69
  position: relative;
69
70
  }
70
71
 
71
72
  .welcome-message {
72
73
  @include clearfix();
73
- @include padding($base-spacing null);
74
74
  background-color: $blue;
75
75
  margin-bottom: 1.5rem;
76
+ padding: $base-spacing 0;
76
77
  text-align: center;
77
78
  }
78
79
 
@@ -1,21 +1,22 @@
1
+ require "neat/version"
1
2
  require "fileutils"
3
+ require "thor"
2
4
 
3
5
  module Neat
4
- class Generator
5
- def initialize(arguments)
6
- @subcommand = arguments.first
7
- end
6
+ class Generator < Thor
7
+ map ["-v", "--version"] => :version
8
8
 
9
- def run
10
- if @subcommand == "install"
11
- install
12
- elsif @subcommand == "update"
13
- update
14
- elsif @subcommand == "remove"
15
- remove
9
+ desc "install", "Install Neat into your project"
10
+ def install
11
+ if neat_files_already_exist?
12
+ puts "Neat files already installed, doing nothing."
13
+ else
14
+ install_files
15
+ puts "Neat files installed to neat/"
16
16
  end
17
17
  end
18
18
 
19
+ desc "update", "Update Neat"
19
20
  def update
20
21
  if neat_files_already_exist?
21
22
  remove_neat_directory
@@ -26,15 +27,7 @@ module Neat
26
27
  end
27
28
  end
28
29
 
29
- def install
30
- if neat_files_already_exist?
31
- puts "Neat files already installed, doing nothing."
32
- else
33
- install_files
34
- puts "Neat files installed to neat/"
35
- end
36
- end
37
-
30
+ desc "remove", "Remove Neat"
38
31
  def remove
39
32
  if neat_files_already_exist?
40
33
  remove_neat_directory
@@ -44,6 +37,11 @@ module Neat
44
37
  end
45
38
  end
46
39
 
40
+ desc "version", "Show Neat version"
41
+ def version
42
+ say "Neat #{Neat::VERSION}"
43
+ end
44
+
47
45
  private
48
46
 
49
47
  def neat_files_already_exist?
data/lib/neat/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Neat
2
- VERSION = "1.7.4"
2
+ VERSION = "1.9.0"
3
3
  end
data/lib/neat.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require "sass"
2
- require "bourbon"
3
2
  require "neat/generator"
4
3
 
5
4
  module Neat
@@ -1,20 +1,18 @@
1
1
  require "fileutils"
2
2
  require "find"
3
3
 
4
- namespace :bourbon do
5
- namespace :neat do
6
- desc "Copy Neat's files to the Rails assets directory."
7
- task :install, [:sass_path] do |t, args|
8
- args.with_defaults(:sass_path => 'public/stylesheets/sass')
9
- source_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
10
- FileUtils.mkdir_p("#{Rails.root}/#{args.sass_path}/neat")
11
- FileUtils.cp_r("#{source_root}/app/assets/stylesheets/.", "#{Rails.root}/#{args.sass_path}/neat", { :preserve => true })
4
+ namespace :neat do
5
+ desc "Copy Neat's files to the Rails assets directory."
6
+ task :install, [:sass_path] do |t, args|
7
+ args.with_defaults(:sass_path => 'public/stylesheets/sass')
8
+ source_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
9
+ FileUtils.mkdir_p("#{Rails.root}/#{args.sass_path}/neat")
10
+ FileUtils.cp_r("#{source_root}/app/assets/stylesheets/.", "#{Rails.root}/#{args.sass_path}/neat", { :preserve => true })
12
11
 
13
- Find.find("#{Rails.root}/#{args.sass_path}/neat") do |path|
14
- if path.end_with?(".css.scss")
15
- path_without_css_extension = path.gsub(/\.css\.scss$/, ".scss")
16
- FileUtils.mv(path, path_without_css_extension)
17
- end
12
+ Find.find("#{Rails.root}/#{args.sass_path}/neat") do |path|
13
+ if path.end_with?(".css.scss")
14
+ path_without_css_extension = path.gsub(/\.css\.scss$/, ".scss")
15
+ FileUtils.mv(path, path_without_css_extension)
18
16
  end
19
17
  end
20
18
  end
data/neat.gemspec CHANGED
@@ -9,11 +9,11 @@ Gem::Specification.new do |s|
9
9
  s.authors = ['Joel Oliveira', 'Kyle Fiedler', 'Reda Lemeden']
10
10
  s.email = 'design+bourbon@thoughtbot.com'
11
11
  s.homepage = 'http://neat.bourbon.io'
12
- s.summary = 'A lightweight, semantic grid framework built with Bourbon'
12
+ s.summary = 'A lightweight, semantic grid framework'
13
13
  s.license = 'MIT'
14
14
  s.description = <<-DESC
15
- Neat is a fluid grid framework built with Bourbon with the aim of being easy
16
- enough to use out of the box and flexible enough to customize down the road.
15
+ Neat is a fluid grid framework built with the aim of being easy enough to use
16
+ out of the box and flexible enough to customize down the road.
17
17
  DESC
18
18
 
19
19
  s.rubyforge_project = 'neat'
@@ -24,7 +24,7 @@ enough to use out of the box and flexible enough to customize down the road.
24
24
  s.require_paths = ['lib']
25
25
 
26
26
  s.add_dependency('sass', '>= 3.3')
27
- s.add_dependency('bourbon', '>= 4.0')
27
+ s.add_dependency("thor", "~> 0.19")
28
28
 
29
29
  s.add_development_dependency("scss_lint", "~> 0.43")
30
30
  s.add_development_dependency('aruba', '~> 0.5.0')
data/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "bourbon-neat",
3
- "version": "1.7.4",
4
- "description": "A lightweight, semantic grid framework built with Bourbon",
3
+ "version": "1.9.0",
4
+ "description": "A lightweight, semantic grid framework",
5
5
  "keywords": [
6
- "bourbon",
7
6
  "columns",
8
7
  "grid",
9
8
  "layout",
@@ -34,8 +33,7 @@
34
33
  "test": "echo \"No test specified\""
35
34
  },
36
35
  "dependencies": {
37
- "bourbon": "^4.2",
38
- "node-sass": "^3.4"
36
+ "node-sass": "^4.1.1"
39
37
  },
40
38
  "devDependencies": {
41
39
  "gulp": "^3.9",
data/sache.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "Neat",
3
- "description": "A lightweight, semantic grid framework built with Bourbon",
4
- "tags": ["bourbon", "columns", "grid", "layout", "media", "media-queries", "neat", "queries", "sass", "scss", "semantic"]
3
+ "description": "A lightweight, semantic grid framework",
4
+ "tags": ["columns", "grid", "layout", "media", "media-queries", "neat", "queries", "sass", "scss", "semantic"]
5
5
  }
@@ -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
data/spec/spec_helper.rb CHANGED
@@ -7,19 +7,16 @@ require "css_parser"
7
7
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
8
8
 
9
9
  RSpec.configure do |config|
10
- config.include BourbonSupport
11
10
  config.include SassSupport
12
11
  config.include CssParser
13
12
  config.include ParserSupport
14
13
  config.include Aruba::Api
15
14
 
16
15
  config.before(:all) do
17
- install_bourbon_files
18
16
  generate_css
19
17
  end
20
18
 
21
19
  config.after(:all) do
22
- remove_bourbon_files
23
20
  clean_up
24
21
  end
25
22
  end
@@ -1,14 +1,16 @@
1
1
  RSpec::Matchers.define :have_rule do |expected|
2
- match do |actual|
3
- @rules = rules_from_selector(actual)
2
+ match do |selector|
3
+ @rules = rules_from_selector(selector)
4
4
  @rules.include? expected
5
5
  end
6
6
 
7
- failure_message do |actual|
7
+ failure_message do |selector|
8
8
  if @rules.empty?
9
- %{no CSS rules for selector #{actual} were found}
9
+ %{no CSS for selector #{selector} were found}
10
10
  else
11
- %{expected selector #{actual} to have CSS rule "#{expected}"}
11
+ rules = @rules.join("; ")
12
+ %{Expected selector #{selector} to have CSS rule "#{expected}".
13
+ Had "#{rules}".}
12
14
  end
13
15
  end
14
16
 
data/test/_setup.scss CHANGED
@@ -1,3 +1,2 @@
1
- @import "bourbon/bourbon";
2
1
  @import "../app/assets/stylesheets/neat";
3
2
  $disable-warnings: true !global;
data/test/omega.scss CHANGED
@@ -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.7.4
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-03-04 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
@@ -27,19 +27,19 @@ dependencies:
27
27
  - !ruby/object:Gem::Version
28
28
  version: '3.3'
29
29
  - !ruby/object:Gem::Dependency
30
- name: bourbon
30
+ name: thor
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ">="
33
+ - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '4.0'
35
+ version: '0.19'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ">="
40
+ - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '4.0'
42
+ version: '0.19'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: scss_lint
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -153,8 +153,8 @@ dependencies:
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0'
155
155
  description: |
156
- Neat is a fluid grid framework built with Bourbon with the aim of being easy
157
- enough to use out of the box and flexible enough to customize down the road.
156
+ Neat is a fluid grid framework built with the aim of being easy enough to use
157
+ out of the box and flexible enough to customize down the road.
158
158
  email: design+bourbon@thoughtbot.com
159
159
  executables:
160
160
  - neat
@@ -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,11 +187,13 @@ 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
192
194
  - app/assets/stylesheets/grid/_to-deprecate.scss
193
195
  - app/assets/stylesheets/grid/_visual-grid.scss
196
+ - app/assets/stylesheets/mixins/_clearfix.scss
194
197
  - app/assets/stylesheets/settings/_disable-warnings.scss
195
198
  - app/assets/stylesheets/settings/_grid.scss
196
199
  - app/assets/stylesheets/settings/_visual-grid.scss
@@ -220,7 +223,6 @@ files:
220
223
  - spec/neat/row_spec.rb
221
224
  - spec/neat/shift_spec.rb
222
225
  - spec/spec_helper.rb
223
- - spec/support/bourbon_support.rb
224
226
  - spec/support/matchers/be_contained_in.rb
225
227
  - spec/support/matchers/have_rule.rb
226
228
  - spec/support/matchers/have_value.rb
@@ -258,10 +260,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
260
  version: '0'
259
261
  requirements: []
260
262
  rubyforge_project: neat
261
- rubygems_version: 2.5.2
263
+ rubygems_version: 2.6.12
262
264
  signing_key:
263
265
  specification_version: 4
264
- summary: A lightweight, semantic grid framework built with Bourbon
266
+ summary: A lightweight, semantic grid framework
265
267
  test_files:
266
268
  - spec/neat/columns_spec.rb
267
269
  - spec/neat/container_spec.rb
@@ -275,7 +277,6 @@ test_files:
275
277
  - spec/neat/row_spec.rb
276
278
  - spec/neat/shift_spec.rb
277
279
  - spec/spec_helper.rb
278
- - spec/support/bourbon_support.rb
279
280
  - spec/support/matchers/be_contained_in.rb
280
281
  - spec/support/matchers/have_rule.rb
281
282
  - spec/support/matchers/have_value.rb
@@ -293,4 +294,3 @@ test_files:
293
294
  - test/row.scss
294
295
  - test/shift.scss
295
296
  - test/span-columns.scss
296
- has_rdoc:
@@ -1,9 +0,0 @@
1
- module BourbonSupport
2
- def install_bourbon_files
3
- `bundle exec bourbon install --path test`
4
- end
5
-
6
- def remove_bourbon_files
7
- FileUtils.rm_rf("test/bourbon")
8
- end
9
- end