neat 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,33 @@
1
+ We love pull requests. Here's a quick guide:
2
+
3
+ 1. Fork the repo.
4
+ 2. Make your changes in a topic branch.
5
+ 3. Squash your commits into a single one (more on that [here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html)).
6
+ 4. Rebase against `origin/master`, push to your fork and submit a pull request.
7
+
8
+ At this point you're waiting on us. We like to at least comment on, if not
9
+ accept, pull requests within three business days (and, typically, one business
10
+ day). We may suggest some changes or improvements or alternatives.
11
+
12
+ Some things that will increase the chance that your pull request is accepted:
13
+
14
+ * Fix a bug, refactor code or expand an existing feature
15
+ * Use the right syntax and naming conventions.
16
+ * Update parts of the documentation that are affected by your contribution.
17
+
18
+ **Git Commit Messages**
19
+
20
+ * Capitalize your commit messages.
21
+ * Start your message with a verb.
22
+ * Use present tense.
23
+ * Refer to the issue/PR number in your squashed commit message.
24
+
25
+ **SCSS Style Guide**
26
+
27
+ * Two spaces, no tabs.
28
+ * Dashes instead of underscores or camel case: `span-columns` **not** `span_columns` or `spanColumns`
29
+ * Names should be descriptive and written in full-words: `$visual-grid-color` **not** `$color` or `$vslgrd-clr`
30
+ * Space between property and value: `width: 20px` **not** `width:20px`
31
+ * Declarations within a block should be ordered alphabetically.
32
+ * Blank lines between rules.
33
+ * No trailing whitespace. Blank lines should not have any space.
data/LICENSE CHANGED
@@ -2,7 +2,7 @@ LICENSE
2
2
 
3
3
  The MIT License
4
4
 
5
- Copyright (c) 2012 thoughtbot, inc.
5
+ Copyright (c) 2012-2013 thoughtbot, inc.
6
6
 
7
7
  Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  of this software and associated documentation files (the "Software"), to deal
data/NEWS.md CHANGED
@@ -1,3 +1,9 @@
1
+ 1.1.0 (2013-01-09)
2
+
3
+ * New: pad() takes shorthand arguments
4
+ * Refactor: Merge omega() and nth-omega()
5
+ * Fix: Last child in table layouts keep its right-padding
6
+
1
7
  1.0.2 (2012-11-19)
2
8
 
3
9
  * Fix [Issue 38](https://github.com/thoughtbot/neat/issues/38) by adding explicit require to the bourbon gem
data/README.md CHANGED
@@ -161,36 +161,29 @@ Please note that the `shift()` mixin is incompatible with display `table`.
161
161
 
162
162
  ### Padding columns
163
163
 
164
- To add padding around the entire column use `pad()`. By default it adds the same value as the grid's gutter but can take any unit value.
164
+ To add padding around the entire column use `pad()`. By default it uses the grid's gutter but can take any argument, including the `padding` shorthand syntax.
165
165
 
166
166
  ```scss
167
- @include pad; // Adds a padding equivalent to the grid's gutter
168
- @include pad(20px); // Adds a padding of 20px
167
+ @include pad; // Adds a padding equivalent to the grid's gutter --> padding: 2.35765%;
168
+ @include pad(20px); // Adds a padding of 20px --> padding: 20px;
169
+ @include pad(30px default); // padding: 30px 2.35765%;
170
+ @include pad(30px 20px 10px default); // padding: 30px 20px 10px 2.35765%;
169
171
  ```
170
172
 
171
173
  The `pad()` mixin works particularly well with `span-columns(x, table)` by adding the necessary padding without breaking your table-based grid layout.
172
174
 
173
175
  ### Removing gutter
174
176
 
175
- Neat automatically removes the last columns's gutter. However, if you are queueing more than one row of columns within the same parent element, you need to specify which columns are considered last in their row to preserve the layout. Use the `omega` mixin to achieve this:
177
+ Neat removes by default the last column's gutter. However, if you are queueing more than one row of columns within the same parent element, you need to specify which columns are considered last in their row to preserve the layout. Use the `omega` mixin to achieve this:
176
178
 
177
179
  ```scss
178
- @include omega; // Removes right gutter
180
+ @include omega; // Removes the right gutter (margin) of the element
181
+ @include omega(table); // Removes the right gutter (padding) of a table-cell element
182
+ @include omega(4n) // Removes every 4th right gutter (margin)
183
+ @include omega(4n table) // Removes every 4th right gutter (padding) of a table-cell element
179
184
  ```
180
185
 
181
- You can also use `nth-omega` to remove the gutter of a specific column or set of columns:
182
-
183
- ```scss
184
- @include nth-omega(nth-child);
185
- ```
186
-
187
- * `nth-child` takes any valid :nth-child value. See [https://developer.mozilla.org/en-US/docs/CSS/:nth-child](Mozilla's :nth-child documentation)
188
-
189
- eg. Remove every 3rd gutter using:
190
-
191
- ```scss
192
- @include nth-omega(3n);
193
- ```
186
+ The `omega` mixin takes any valid `:nth-child` value. Composite values such as `3n+5` should be passed as strings in order to work: `omega('3n+5')`. See [https://developer.mozilla.org/en-US/docs/CSS/:nth-child](Mozilla's :nth-child documentation)
194
187
 
195
188
  ### Filling parent elements
196
189
 
@@ -439,4 +432,4 @@ Bourbon is maintained and funded by [thoughtbot, inc](http://thoughtbot.com/comm
439
432
  License
440
433
  ===
441
434
 
442
- Bourbon Neat is Copyright © 2012 thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.
435
+ Bourbon Neat is Copyright © 2012-2013 thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.
@@ -1,6 +1,6 @@
1
- // Bourbon Neat 1.0.1
1
+ // Bourbon Neat
2
2
  // MIT Licensed
3
- // Copyright (c) 2011 thoughtbot, inc.
3
+ // Copyright (c) 2012-2013 thoughtbot, inc.
4
4
 
5
5
  // Helpers
6
6
  @import "neat-helpers";
@@ -8,4 +8,5 @@
8
8
  // Grid
9
9
  @import "grid/global-variables";
10
10
  @import "grid/grid";
11
+ @import "grid/omega";
11
12
  @import "grid/visual-grid";
@@ -18,6 +18,15 @@
18
18
  @return false;
19
19
  }
20
20
 
21
+ // Contains display value
22
+ @function contains-display-value($query) {
23
+ @if belongs-to(table, $query) or belongs-to(block, $query) or belongs-to(inline-block, $query) or belongs-to(inline, $query) {
24
+ @return true;
25
+ }
26
+
27
+ @return false;
28
+ }
29
+
21
30
  // Parses the first argument of span-columns()
22
31
  @function container-span($span: $span) {
23
32
  @if length($span) == 3 {
@@ -39,7 +39,7 @@ $fg-max-width: $max-width;
39
39
  width: flex-grid($columns, $container-columns) + flex-gutter($container-columns);
40
40
 
41
41
  &:last-child {
42
- padding-right: 0;
42
+ width: flex-grid($columns, $container-columns);
43
43
  }
44
44
  }
45
45
 
@@ -85,32 +85,12 @@ $fg-max-width: $max-width;
85
85
 
86
86
  // Pad
87
87
  @mixin pad($padding: flex-gutter()) {
88
- padding: $padding;
89
- }
90
-
91
- // Remove element gutter
92
- @mixin omega($display: block, $direction: right) {
93
- @if $display == table {
94
- padding-#{$direction}: 0;
95
- }
96
-
97
- @else {
98
- margin-#{$direction}: 0;
99
- }
100
- }
101
-
102
- @mixin nth-omega($nth, $display: block, $direction: right) {
103
- @if $display == table {
104
- &:nth-child(#{$nth}) {
105
- padding-#{$direction}: 0;
106
- }
107
- }
108
-
109
- @else {
110
- &:nth-child(#{$nth}) {
111
- margin-#{$direction}: 0;
112
- }
88
+ $padding-list: null;
89
+ @each $value in $padding {
90
+ $value: if($value == 'default', flex-gutter(), $value);
91
+ $padding-list: join($padding-list, $value);
113
92
  }
93
+ padding: $padding-list;
114
94
  }
115
95
 
116
96
  // Fill 100% of parent
@@ -0,0 +1,68 @@
1
+ // Remove last element gutter
2
+ @mixin omega($query: block, $direction: right) {
3
+ $table: if(belongs-to(table, $query), true, false);
4
+ $auto: if(belongs-to(auto, $query), true, false);
5
+
6
+ @if length($query) == 1 {
7
+ @if $auto {
8
+ &:last-child {
9
+ margin-#{$direction}: 0;
10
+ }
11
+ }
12
+
13
+ @else if contains-display-value($query) {
14
+ @if $table {
15
+ padding-#{$direction}: 0;
16
+ }
17
+
18
+ @else {
19
+ margin-#{$direction}: 0;
20
+ }
21
+ }
22
+
23
+ @else {
24
+ &:nth-child(#{$query}) {
25
+ margin-#{$direction}: 0;
26
+ }
27
+ }
28
+ }
29
+
30
+ @else if length($query) == 2 {
31
+ @if $table {
32
+ @if $auto {
33
+ &:last-child {
34
+ padding-#{$direction}: 0;
35
+ }
36
+ }
37
+
38
+ @else {
39
+ &:nth-child(#{nth($query, 1)}) {
40
+ padding-#{$direction}: 0;
41
+ }
42
+ }
43
+ }
44
+
45
+ @else {
46
+ @if $auto {
47
+ &:last-child {
48
+ margin-#{$direction}: 0;
49
+ }
50
+ }
51
+
52
+ @else {
53
+ &:nth-child(#{nth($query, 1)}) {
54
+ margin-#{$direction}: 0;
55
+ }
56
+ }
57
+ }
58
+ }
59
+
60
+ @else {
61
+ @warn "Too many arguments passed to the omega() mixin."
62
+ }
63
+ }
64
+
65
+ @mixin nth-omega($nth, $display: block, $direction: right) {
66
+ @warn "The nth-omega() mixin is deprecated. Please use omega() instead.";
67
+ @include omega($nth $display, $direction);
68
+ }
data/lib/neat/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Neat
2
- VERSION = '1.0.2'
2
+ VERSION = '1.1.0'
3
3
  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: 1.0.2
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-11-19 00:00:00.000000000 Z
14
+ date: 2013-01-09 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: sass
18
- requirement: !ruby/object:Gem::Requirement
18
+ requirement: &70352051553640 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,15 +23,10 @@ dependencies:
23
23
  version: '3.2'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
- requirements:
29
- - - ! '>='
30
- - !ruby/object:Gem::Version
31
- version: '3.2'
26
+ version_requirements: *70352051553640
32
27
  - !ruby/object:Gem::Dependency
33
28
  name: bourbon
34
- requirement: !ruby/object:Gem::Requirement
29
+ requirement: &70352051532700 !ruby/object:Gem::Requirement
35
30
  none: false
36
31
  requirements:
37
32
  - - ! '>='
@@ -39,15 +34,10 @@ dependencies:
39
34
  version: '2.1'
40
35
  type: :runtime
41
36
  prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
- requirements:
45
- - - ! '>='
46
- - !ruby/object:Gem::Version
47
- version: '2.1'
37
+ version_requirements: *70352051532700
48
38
  - !ruby/object:Gem::Dependency
49
39
  name: aruba
50
- requirement: !ruby/object:Gem::Requirement
40
+ requirement: &70352051530620 !ruby/object:Gem::Requirement
51
41
  none: false
52
42
  requirements:
53
43
  - - ~>
@@ -55,15 +45,10 @@ dependencies:
55
45
  version: '0.4'
56
46
  type: :development
57
47
  prerelease: false
58
- version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
- requirements:
61
- - - ~>
62
- - !ruby/object:Gem::Version
63
- version: '0.4'
48
+ version_requirements: *70352051530620
64
49
  - !ruby/object:Gem::Dependency
65
50
  name: rake
66
- requirement: !ruby/object:Gem::Requirement
51
+ requirement: &70352051528300 !ruby/object:Gem::Requirement
67
52
  none: false
68
53
  requirements:
69
54
  - - ! '>='
@@ -71,12 +56,7 @@ dependencies:
71
56
  version: '0'
72
57
  type: :development
73
58
  prerelease: false
74
- version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
- requirements:
77
- - - ! '>='
78
- - !ruby/object:Gem::Version
79
- version: '0'
59
+ version_requirements: *70352051528300
80
60
  description: ! 'Neat is an open source grid framework built on top of Bourbon with
81
61
  the aim of being easy enough to use out of the box and flexible enough to customize
82
62
  down the road.
@@ -90,6 +70,7 @@ extensions: []
90
70
  extra_rdoc_files: []
91
71
  files:
92
72
  - .gitignore
73
+ - CONTRIBUTING.md
93
74
  - Gemfile
94
75
  - LICENSE
95
76
  - NEWS.md
@@ -102,6 +83,7 @@ files:
102
83
  - app/assets/stylesheets/functions/_px-to-em.scss
103
84
  - app/assets/stylesheets/grid/_global-variables.scss
104
85
  - app/assets/stylesheets/grid/_grid.scss
86
+ - app/assets/stylesheets/grid/_omega.scss
105
87
  - app/assets/stylesheets/grid/_visual-grid.scss
106
88
  - app/assets/stylesheets/settings/_grid.scss
107
89
  - app/assets/stylesheets/settings/_visual-grid.scss
@@ -124,17 +106,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
106
  - - ! '>='
125
107
  - !ruby/object:Gem::Version
126
108
  version: '0'
109
+ segments:
110
+ - 0
111
+ hash: 1950241024261928513
127
112
  required_rubygems_version: !ruby/object:Gem::Requirement
128
113
  none: false
129
114
  requirements:
130
115
  - - ! '>='
131
116
  - !ruby/object:Gem::Version
132
117
  version: '0'
118
+ segments:
119
+ - 0
120
+ hash: 1950241024261928513
133
121
  requirements: []
134
122
  rubyforge_project: neat
135
- rubygems_version: 1.8.24
123
+ rubygems_version: 1.8.15
136
124
  signing_key:
137
125
  specification_version: 3
138
126
  summary: A fluid grid framework on top of Bourbon
139
127
  test_files: []
140
- has_rdoc: