neat 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS.md +12 -6
- data/README.md +42 -285
- data/Rakefile +2 -2
- data/app/assets/stylesheets/grid/_row.scss +3 -0
- data/app/assets/stylesheets/settings/_visual-grid.scss +1 -1
- data/lib/neat.rb +2 -0
- data/lib/neat/version.rb +1 -1
- data/spec/neat/media_spec.rb +7 -7
- data/spec/neat/new_breakpoint_spec.rb +19 -0
- data/spec/support/matchers/have_value.rb +15 -0
- data/test/new-breakpoint.scss +13 -0
- metadata +26 -20
data/NEWS.md
CHANGED
@@ -1,24 +1,30 @@
|
|
1
|
-
1.2.
|
1
|
+
### 1.2.1 (2013-04-04)
|
2
|
+
|
3
|
+
* New: Add stylesheets path to Sass.load_paths
|
4
|
+
* Fixed: Force full-width and fixed table-layout on `row(table)`
|
5
|
+
* Official Docset
|
6
|
+
|
7
|
+
### 1.2.0 (2013-02-18)
|
2
8
|
|
3
9
|
* New: Auto-detect table layout when `span-columns()` is called inside `row(table)`
|
4
10
|
* Fix: Make `shift()` reset context after each nested call
|
5
11
|
|
6
|
-
1.1.0 (2013-01-09)
|
12
|
+
### 1.1.0 (2013-01-09)
|
7
13
|
|
8
14
|
* New: `pad()` takes shorthand arguments
|
9
15
|
* Refactor: Merge `omega()` and `nth-omega()`
|
10
16
|
* Fix: Last child in table layouts keeps its right-padding
|
11
17
|
|
12
|
-
1.0.2 (2012-11-19)
|
18
|
+
### 1.0.2 (2012-11-19)
|
13
19
|
|
14
20
|
* Fix: Add explicit require to the bourbon gem [#38](https://github.com/thoughtbot/neat/issues/38)
|
15
21
|
|
16
|
-
1.0.1 (2012-11-06)
|
22
|
+
### 1.0.1 (2012-11-06)
|
17
23
|
|
18
24
|
* Fix: Make `em()` always return a number
|
19
25
|
* Fix: Relative path imports in Rails
|
20
26
|
|
21
|
-
1.0.0 (2012-10-29)
|
27
|
+
### 1.0.0 (2012-10-29)
|
22
28
|
|
23
29
|
* New: Add executable for non-Rails projects
|
24
30
|
* New: Add visual grid
|
@@ -27,6 +33,6 @@
|
|
27
33
|
* Fix: Make `shift()` work properly in nested contexts
|
28
34
|
* Refactor: Remove typography mixins and settings
|
29
35
|
|
30
|
-
0.4.2 (2012-08-31)
|
36
|
+
### 0.4.2 (2012-08-31)
|
31
37
|
|
32
38
|
* Initial release
|
data/README.md
CHANGED
@@ -2,14 +2,13 @@
|
|
2
2
|
|
3
3
|
**Neat** is an open source fluid grid framework built on top of [Bourbon](http://bourbon.io) with the aim of being easy enough to use out of the box and flexible enough to customize down the road.
|
4
4
|
|
5
|
-
Learn more about Neat and why we built it [here](http://neat.bourbon.io).
|
6
5
|
|
7
6
|
Requirements
|
8
7
|
===
|
9
8
|
- Sass 3.2+
|
10
9
|
- Bourbon 2.1+
|
11
10
|
|
12
|
-
|
11
|
+
Install Instructions
|
13
12
|
===
|
14
13
|
Install/update the dependencies first:
|
15
14
|
|
@@ -36,19 +35,19 @@ In your main stylesheet:
|
|
36
35
|
@import "neat/neat";
|
37
36
|
```
|
38
37
|
|
39
|
-
To update Neat, run:
|
38
|
+
To update Neat files, run:
|
40
39
|
|
41
40
|
```bash
|
42
41
|
neat update
|
43
42
|
```
|
44
43
|
|
45
|
-
and to remove
|
44
|
+
and to remove them:
|
46
45
|
|
47
46
|
```bash
|
48
47
|
neat remove
|
49
48
|
```
|
50
49
|
|
51
|
-
Rails
|
50
|
+
Ruby on Rails
|
52
51
|
===
|
53
52
|
|
54
53
|
In your Gemfile:
|
@@ -72,33 +71,44 @@ Within your `application.css.scss` file place the following:
|
|
72
71
|
@import "neat";
|
73
72
|
```
|
74
73
|
|
75
|
-
|
74
|
+
Getting started
|
76
75
|
===
|
77
|
-
The default grid uses 12 columns, a setting that can be easily overridden as detailed [further down](https://github.com/thoughtbot/neat#changing-the-defaults).
|
78
76
|
|
79
|
-
|
80
|
-
Include the `outer-container` mixin in the topmost container (to which the `max-width` setting will be applied):
|
77
|
+
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:
|
81
78
|
|
82
79
|
```scss
|
83
|
-
|
84
|
-
|
85
|
-
|
80
|
+
@import "bourbon/bourbon"; // or "bourbon" when in Rails
|
81
|
+
@import "grid-settings";
|
82
|
+
@import "neat/neat"; // or "neat" when in Rails
|
86
83
|
```
|
87
84
|
|
88
|
-
|
89
|
-
|
90
|
-
### Columns
|
91
|
-
Use the `span-columns` mixin to specify the number of columns an element should span:
|
85
|
+
In your newly created `_grid-settings.scss`, import `neat-helpers` if you are planning to use `new-breakpoint()`, then define your new variables:
|
92
86
|
|
93
87
|
```scss
|
94
|
-
@
|
88
|
+
@import "neat/neat-helpers"; // or "neat-helpers" when in Rails
|
89
|
+
|
90
|
+
// Change the grid settings
|
91
|
+
$column: 90px;
|
92
|
+
$gutter: 30px;
|
93
|
+
$grid-columns: 10;
|
94
|
+
$max-width: em(1088);
|
95
|
+
|
96
|
+
// Define your breakpoints
|
97
|
+
$mobile: new-breakpoint(max-width 480px 4);
|
98
|
+
$tablet: new-breakpoint(max-width 768px 8);
|
95
99
|
```
|
96
100
|
|
97
|
-
|
98
|
-
* `container-columns` (optional) is the number of columns the container spans, defaults to the total number of columns in the grid.
|
99
|
-
* `display` (optional) changes the display type of the grid. Use `block`—the default—for floated layout, `table` for table-cell layout, and `inline-block` for an inline block layout.
|
101
|
+
See the [docs](http://neat.bourbon.io/docs/#variables) for a full list of settings.
|
100
102
|
|
101
|
-
|
103
|
+
Next, include the `outer-container` mixin in the topmost container (to which the `max-width` setting will be applied):
|
104
|
+
|
105
|
+
```scss
|
106
|
+
div.container {
|
107
|
+
@include outer-container;
|
108
|
+
}
|
109
|
+
```
|
110
|
+
|
111
|
+
Then use `span-columns` on any element to specify the number of columns it should span:
|
102
112
|
|
103
113
|
```scss
|
104
114
|
div.element {
|
@@ -120,221 +130,16 @@ div.container {
|
|
120
130
|
}
|
121
131
|
```
|
122
132
|
|
123
|
-
To
|
124
|
-
|
125
|
-
```scss
|
126
|
-
@include span-columns(6 of 8, table)
|
127
|
-
```
|
128
|
-
|
129
|
-
Likewise for inline-block:
|
130
|
-
|
131
|
-
```scss
|
132
|
-
@include span-columns(6 of 8, inline-block)
|
133
|
-
```
|
134
|
-
|
135
|
-
### Rows
|
136
|
-
In order to clear floated or table-cell columns, use the `row` mixin:
|
137
|
-
|
138
|
-
```scss
|
139
|
-
@include row($display);
|
140
|
-
```
|
141
|
-
|
142
|
-
* `display` takes either `block`—the default—or `table`.
|
143
|
-
|
144
|
-
### Shifting columns
|
145
|
-
|
146
|
-
To move an element to the left or right by a number of columns, use the `shift` mixin:
|
147
|
-
|
148
|
-
```scss
|
149
|
-
@include shift(2); // Move 2 columns to the right
|
150
|
-
@include shift(-3); // Move 3 columns to the left
|
151
|
-
```
|
152
|
-
|
153
|
-
Please note that the `shift()` mixin is incompatible with display `table`.
|
154
|
-
|
155
|
-
### Padding columns
|
156
|
-
|
157
|
-
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.
|
158
|
-
|
159
|
-
```scss
|
160
|
-
@include pad; // Adds a padding equivalent to the grid's gutter --> padding: 2.35765%;
|
161
|
-
@include pad(20px); // Adds a padding of 20px --> padding: 20px;
|
162
|
-
@include pad(30px default); // padding: 30px 2.35765%;
|
163
|
-
@include pad(30px 20px 10px default); // padding: 30px 20px 10px 2.35765%;
|
164
|
-
```
|
165
|
-
|
166
|
-
The `pad()` mixin works particularly well with `span-columns(x, table)` by adding the necessary padding without breaking your table-based grid layout.
|
167
|
-
|
168
|
-
### Removing gutter
|
169
|
-
|
170
|
-
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:
|
171
|
-
|
172
|
-
```scss
|
173
|
-
@include omega; // Removes the right gutter (margin) of the element
|
174
|
-
@include omega(table); // Removes the right gutter (padding) of a table-cell element
|
175
|
-
@include omega(4n); // Removes every 4th right gutter (margin)
|
176
|
-
@include omega(4n table); // Removes every 4th right gutter (padding) of a table-cell element
|
177
|
-
```
|
178
|
-
|
179
|
-
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)
|
180
|
-
|
181
|
-
### Filling parent elements
|
182
|
-
|
183
|
-
This makes sure that the child fills 100% of its parent:
|
184
|
-
|
185
|
-
```scss
|
186
|
-
@include fill-parent;
|
187
|
-
```
|
188
|
-
|
189
|
-
### Media Queries
|
190
|
-
|
191
|
-
The `media()` mixin allows you to use media-queries to modify both the grid and the layout. It takes two arguments:
|
192
|
-
|
193
|
-
```scss
|
194
|
-
@include media($query, $total-columns: $grid-columns)
|
195
|
-
```
|
196
|
-
|
197
|
-
* `query` contains the media feature (min-width, max-width, etc.) and the value (481px, 30em, etc.). If you specify the value only, `min-width` will be used by default (ideal if you follow a mobile-first approach). You can also change the default feature in the settings (see section below).
|
198
|
-
* `total-columns` (optional) is the total number of columns to be used inside this media query. Changing the total number of columns will change the width, padding and margin percentages obtained using the `span-column` mixin.
|
199
|
-
|
200
|
-
##### Example 1
|
201
|
-
|
202
|
-
```scss
|
203
|
-
.my-class {
|
204
|
-
@include media(481px) {
|
205
|
-
font-size: 1.2em;
|
206
|
-
}
|
207
|
-
}
|
208
|
-
|
209
|
-
// Compiled CSS
|
210
|
-
|
211
|
-
@media screen and (min-width: 481px) {
|
212
|
-
.my-class {
|
213
|
-
font-size: 1.2em;
|
214
|
-
}
|
215
|
-
}
|
216
|
-
```
|
217
|
-
|
218
|
-
##### Example 2
|
219
|
-
|
220
|
-
```scss
|
221
|
-
.my-class {
|
222
|
-
@include media(max-width 769px) {
|
223
|
-
float: none;
|
224
|
-
}
|
225
|
-
}
|
226
|
-
|
227
|
-
// Compiled CSS
|
228
|
-
|
229
|
-
@media screen and (max-width: 769px) {
|
230
|
-
.my-class {
|
231
|
-
float: none;
|
232
|
-
}
|
233
|
-
}
|
234
|
-
```
|
235
|
-
|
236
|
-
##### Example 3
|
237
|
-
|
238
|
-
```scss
|
239
|
-
.my-class {
|
240
|
-
@include media(max-width 769px) {
|
241
|
-
@include span-columns(6);
|
242
|
-
}
|
243
|
-
}
|
244
|
-
|
245
|
-
// Compiled CSS
|
246
|
-
|
247
|
-
@media screen and (max-width: 769px) {
|
248
|
-
.my-class {
|
249
|
-
display: block;
|
250
|
-
float: left;
|
251
|
-
margin-right: 2.35765%;
|
252
|
-
width: 48.82117%; // That's 6 columns of the total 12
|
253
|
-
}
|
254
|
-
|
255
|
-
.my-class:last-child {
|
256
|
-
margin-right: 0;
|
257
|
-
}
|
258
|
-
}
|
259
|
-
```
|
260
|
-
|
261
|
-
##### Example 4
|
262
|
-
|
263
|
-
```scss
|
264
|
-
.my-class {
|
265
|
-
@include media(max-width 769px, 6) { // Use a 6 column grid (instead of the default 12)
|
266
|
-
@include span-columns(6);
|
267
|
-
}
|
268
|
-
}
|
269
|
-
|
270
|
-
// Compiled CSS
|
271
|
-
|
272
|
-
@media screen and (max-width: 769px) {
|
273
|
-
.my-class {
|
274
|
-
display: block;
|
275
|
-
float: left;
|
276
|
-
margin-right: 4.82916%;
|
277
|
-
width: 100%; // That's 6 columns of the total 6 specified for this media query
|
278
|
-
}
|
279
|
-
.my-class:last-child {
|
280
|
-
margin-right: 0;
|
281
|
-
}
|
282
|
-
}
|
283
|
-
```
|
284
|
-
|
285
|
-
##### Example 5
|
133
|
+
To make your layout responsive, use the `media()` mixin to modify both the grid and the layout:
|
286
134
|
|
287
135
|
```scss
|
288
136
|
.my-class {
|
289
|
-
@include media(
|
290
|
-
font-size: 1.2em;
|
291
|
-
}
|
292
|
-
}
|
293
|
-
|
294
|
-
// Compiled CSS
|
295
|
-
|
296
|
-
@media screen and (min-width: 320px) and (max-width: 480px) {
|
297
|
-
.my-class {
|
298
|
-
font-size: 1.2em;
|
299
|
-
}
|
300
|
-
}
|
301
|
-
```
|
302
|
-
|
303
|
-
You can also use two `@media` features at the same time.
|
304
|
-
|
305
|
-
Here is a summary of possible argument combinations:
|
306
|
-
|
307
|
-
```scss
|
308
|
-
// YAY
|
309
|
-
@include media(480px);
|
310
|
-
@include media(max-width 480px);
|
311
|
-
@include media(min-width 320px max-width 480px);
|
312
|
-
@include media(480px, 4);
|
313
|
-
@include media(max-width 480px, 4);
|
314
|
-
@include media(min-width 320px max-width 480px, 4);
|
315
|
-
@include media(max-width 480px 4); // Shorthand syntax
|
316
|
-
@include media(min-width 320px max-width 480px 4); // Shorthand syntax
|
317
|
-
|
318
|
-
// NAY
|
319
|
-
@include media(480px 4);
|
320
|
-
@include media(max-width 4);
|
321
|
-
@include media(max-width, 4);
|
322
|
-
@include media(320px max-width 480px);
|
323
|
-
```
|
324
|
-
|
325
|
-
For convenience, you can create a new media context (breakpoint/column-count) with the help of the `new-breakpoint` mixin and use it throughout your code:
|
326
|
-
|
327
|
-
```scss
|
328
|
-
$mobile: new-breakpoint(max-width 480px 4); // Use a 4 column grid in mobile devices
|
329
|
-
|
330
|
-
.my-class {
|
331
|
-
@include media($mobile) {
|
137
|
+
@include media($mobile) { // As defined in _grid-settings.scss
|
332
138
|
@include span-columns(2);
|
333
139
|
}
|
334
140
|
}
|
335
141
|
|
336
142
|
// Compiled CSS
|
337
|
-
|
338
143
|
@media screen and (max-width: 480px) {
|
339
144
|
.my-class {
|
340
145
|
display: block;
|
@@ -348,66 +153,12 @@ $mobile: new-breakpoint(max-width 480px 4); // Use a 4 column grid in mobile dev
|
|
348
153
|
}
|
349
154
|
```
|
350
155
|
|
351
|
-
|
352
|
-
|
353
|
-
### Helpers
|
354
|
-
|
355
|
-
- The `em($pxval, $base: 16)` function takes a pixel value and returns its equivalent in *em* units. You can change the base pixel size in the second argument.
|
356
|
-
|
357
|
-
### Visual grid
|
358
|
-
|
359
|
-
By setting `$visual-grid` to `true`, you can display the base grid in the background (default) or as an overlay. You can even change the color and opacity of the gridlines by overriding the default settings as detailed in the section below. Keep in mind that on Webkit, rounding errors in the fluid grid might result in the overlay being few pixels off.
|
156
|
+
By setting `$visual-grid` to `true`, you can display the base grid in the background (default) or as an overlay. You can even change the color and opacity of the grid-lines by overriding the default settings as detailed in the section below. Keep in mind that on Webkit, rounding errors in the fluid grid might result in the overlay being few pixels off.
|
360
157
|
|
361
158
|
The visual grid reflects the changes applied to the grid via the `new-breakpoint()` mixin, as long as the media contexts are defined *before* importing Neat.
|
362
159
|
|
363
|
-
|
364
|
-
|
365
|
-
All the default settings in Neat can be modified, as long as these overrides occur *before* importing Neat (failing to do so will cause the framework to use the default values). The most straighforward way to achieve this is creating a `_grid-settings.scss` file in the root of your stylesheets folder, then importing it before Neat:
|
366
|
-
|
367
|
-
```scss
|
368
|
-
@import "bourbon"; // or "bourbon/bourbon" when not in Rails
|
369
|
-
@import "grid-settings";
|
370
|
-
@import "neat"; // or "neat/neat" when not in Rails
|
371
|
-
```
|
372
|
-
|
373
|
-
In your newly created `_grid-settings.scss`:
|
374
|
-
|
375
|
-
```scss
|
376
|
-
@import "neat-helpers"; // or "neat/neat-helpers" when not in Rails
|
377
|
-
|
378
|
-
// Change the grid settings
|
379
|
-
$column: 90px;
|
380
|
-
$gutter: 30px;
|
381
|
-
$grid-columns: 10;
|
382
|
-
$max-width: em(1088);
|
383
|
-
|
384
|
-
// Define your breakpoints
|
385
|
-
$mobile: new-breakpoint(max-width 480px 4);
|
386
|
-
$tablet: new-breakpoint(max-width 768px 8);
|
387
|
-
```
|
388
|
-
|
389
|
-
Here is the list of the available settings:
|
390
|
-
|
391
|
-
#### Grid settings
|
392
|
-
|
393
|
-
- `$column`: The width of a single column in `px` or `em`.
|
394
|
-
- `$gutter`: Space between each two columns in `px` or `em`.
|
395
|
-
- `$grid-columns`: Total number of columns in the base grid. Defaults to 12.
|
396
|
-
- `$max-width`: The maximum width of the outer container in `px` or `em`.
|
397
|
-
|
398
|
-
#### Visual grid settings
|
399
|
-
|
400
|
-
- `$visual-grid`: Show the base grid when set to `true`. Defaults to `false`.
|
401
|
-
- `$visual-grid-color`: Visual grid color. Defaults to `#EEEEEE`.
|
402
|
-
- `$visual-grid-index`: If set to `front`, the grid is overlaid on the content.
|
403
|
-
- `$visual-grid-opacity`: Visual grid opacity.
|
404
|
-
|
405
|
-
#### Other settings
|
406
|
-
|
407
|
-
- `$border-box-sizing`: Makes all elements have a `border-box` layout. Defaults to `true`.
|
408
|
-
- `$default-feature`: Default `@media` feature for the `breakpoint()` mixin. Defaults to `min-width`.
|
409
|
-
|
410
|
-
### Browser support
|
160
|
+
Browser support
|
161
|
+
===
|
411
162
|
- Firefox 3.5+
|
412
163
|
- Safari 4.0+
|
413
164
|
- Chrome 4.0+
|
@@ -415,6 +166,12 @@ Here is the list of the available settings:
|
|
415
166
|
- IE 9+ (Visual grid is IE10 only)
|
416
167
|
- IE 8 with [selectivizr](http://selectivizr.com) (no `media()` support)
|
417
168
|
|
169
|
+
Documentation
|
170
|
+
===
|
171
|
+
|
172
|
+
- [Online documentation](http://neat.bourbon.io/docs/)
|
173
|
+
- [Docset feed](http://neat.bourbon.io/docset/Neat.xml) for Dash 1.8+ (Preferences **>** Downloads **>** + *Add Docset Feed*)
|
174
|
+
|
418
175
|
Roadmap
|
419
176
|
===
|
420
177
|
|
data/Rakefile
CHANGED
@@ -12,11 +12,11 @@ task :test do
|
|
12
12
|
`bourbon install --path test`
|
13
13
|
puts "Generating CSS..."
|
14
14
|
`sass --watch test:css/ --style expanded`
|
15
|
-
end
|
15
|
+
end
|
16
16
|
|
17
17
|
task :clean do
|
18
18
|
puts "Deleting Bourbon directory..."
|
19
19
|
`rm -rf test/bourbon`
|
20
20
|
puts "Deleting generated CSS..."
|
21
21
|
`rm -rf css/`
|
22
|
-
end
|
22
|
+
end
|
@@ -2,4 +2,4 @@ $visual-grid: false !default; // Display the base grid
|
|
2
2
|
$visual-grid-color: #EEE !default;
|
3
3
|
$visual-grid-index: back !default; // Show grid behind content (back) or overlay it over the content (front)
|
4
4
|
$visual-grid-opacity: 0.4 !default;
|
5
|
-
$visual-grid-breakpoints:
|
5
|
+
$visual-grid-breakpoints: () !default;
|
data/lib/neat.rb
CHANGED
data/lib/neat/version.rb
CHANGED
data/spec/neat/media_spec.rb
CHANGED
@@ -8,25 +8,25 @@ describe "@include media()" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
context "with argument '481px'" do
|
11
|
-
it "outputs (min-width: 481px)" do
|
11
|
+
it "outputs @media screen and (min-width: 481px)" do
|
12
12
|
expect('.media-default').to be_contained_in('screen and (min-width: 481px)')
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
context "with argument 'max-width 480px'" do
|
17
|
-
it "outputs (max-width: 480px)" do
|
17
|
+
it "outputs @media screen and (max-width: 480px)" do
|
18
18
|
expect('.media-max-width').to be_contained_in('screen and (max-width: 480px)')
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
22
|
context "with argument 'min-width 320px max-width 480px'" do
|
23
|
-
it "outputs (min-width: 320px) and (max-width: 480px)" do
|
23
|
+
it "outputs @media screen and (min-width: 320px) and (max-width: 480px)" do
|
24
24
|
expect('.media-min-max-width').to be_contained_in('screen and (min-width: 320px) and (max-width: 480px)')
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
context "with argument '481px, 6'" do
|
29
|
-
it "outputs (min-width: 481px)" do
|
29
|
+
it "outputs @media screen and (min-width: 481px)" do
|
30
30
|
expect('.change-media-context').to be_contained_in('screen and (min-width: 481px)')
|
31
31
|
end
|
32
32
|
|
@@ -35,13 +35,13 @@ describe "@include media()" do
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
context "with argument 'max-width 480px 6'" do
|
39
|
-
it "outputs (max-width: 480px)" do
|
38
|
+
context "with shorthand argument 'max-width 480px 6'" do
|
39
|
+
it "outputs @media screen and (max-width: 480px)" do
|
40
40
|
expect('.change-media-context-shorthand').to be_contained_in('screen and (max-width: 480px)')
|
41
41
|
end
|
42
42
|
|
43
43
|
it "uses a 6-column grid" do
|
44
|
-
expect('.change-media-context').to have_rule('width: 100%')
|
44
|
+
expect('.change-media-context-shorthand').to have_rule('width: 100%')
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "new-breakpoint()" do
|
4
|
+
let (:identifier) {"new-breakpoint"}
|
5
|
+
|
6
|
+
before(:all) do
|
7
|
+
ParserSupport.parse_file(identifier)
|
8
|
+
end
|
9
|
+
|
10
|
+
context "with argument 'max-width 768px 12'" do
|
11
|
+
it "outputs (max-width 768px)" do
|
12
|
+
expect('.responsive-element').to be_contained_in('screen and (max-width: 768px)')
|
13
|
+
end
|
14
|
+
|
15
|
+
it "adds 'max-width 768px 12' to visual grid breakpoints" do
|
16
|
+
expect('$visual-grid-breakpoints').to have_value('max-width 768px 12')
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
RSpec::Matchers.define :have_value do |expected|
|
2
|
+
match do |actual|
|
3
|
+
selector_id = actual.sub('$','#')
|
4
|
+
value_attribute = ParserSupport.parser.find_by_selector(selector_id)[0]
|
5
|
+
|
6
|
+
unless value_attribute.nil?
|
7
|
+
actual_value = value_attribute.split(':')[1].strip.sub(';', '')
|
8
|
+
actual_value == expected
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
failure_message_for_should do |actual|
|
13
|
+
%{expected variable #{actual} to have value "#{expected}"}
|
14
|
+
end
|
15
|
+
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.2.
|
4
|
+
version: 1.2.1
|
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: 2013-
|
14
|
+
date: 2013-04-04 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: sass
|
18
|
-
requirement: &
|
18
|
+
requirement: &70191797038060 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: '3.2'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *70191797038060
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bourbon
|
29
|
-
requirement: &
|
29
|
+
requirement: &70191797037300 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ! '>='
|
@@ -34,10 +34,10 @@ dependencies:
|
|
34
34
|
version: '2.1'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *70191797037300
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: aruba
|
40
|
-
requirement: &
|
40
|
+
requirement: &70191797031800 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
@@ -45,10 +45,10 @@ dependencies:
|
|
45
45
|
version: '0.4'
|
46
46
|
type: :development
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *70191797031800
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: rake
|
51
|
-
requirement: &
|
51
|
+
requirement: &70191797030940 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
54
|
- - ! '>='
|
@@ -56,10 +56,10 @@ dependencies:
|
|
56
56
|
version: '0'
|
57
57
|
type: :development
|
58
58
|
prerelease: false
|
59
|
-
version_requirements: *
|
59
|
+
version_requirements: *70191797030940
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: css_parser
|
62
|
-
requirement: &
|
62
|
+
requirement: &70191797030080 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
65
65
|
- - ! '>='
|
@@ -67,10 +67,10 @@ dependencies:
|
|
67
67
|
version: '0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
|
-
version_requirements: *
|
70
|
+
version_requirements: *70191797030080
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: rspec
|
73
|
-
requirement: &
|
73
|
+
requirement: &70191797028820 !ruby/object:Gem::Requirement
|
74
74
|
none: false
|
75
75
|
requirements:
|
76
76
|
- - ! '>='
|
@@ -78,10 +78,10 @@ dependencies:
|
|
78
78
|
version: '0'
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
|
-
version_requirements: *
|
81
|
+
version_requirements: *70191797028820
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
83
|
name: rdoc
|
84
|
-
requirement: &
|
84
|
+
requirement: &70191797026780 !ruby/object:Gem::Requirement
|
85
85
|
none: false
|
86
86
|
requirements:
|
87
87
|
- - ! '>='
|
@@ -89,10 +89,10 @@ dependencies:
|
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
|
-
version_requirements: *
|
92
|
+
version_requirements: *70191797026780
|
93
93
|
- !ruby/object:Gem::Dependency
|
94
94
|
name: bundler
|
95
|
-
requirement: &
|
95
|
+
requirement: &70191797006460 !ruby/object:Gem::Requirement
|
96
96
|
none: false
|
97
97
|
requirements:
|
98
98
|
- - ! '>='
|
@@ -100,7 +100,7 @@ dependencies:
|
|
100
100
|
version: '0'
|
101
101
|
type: :development
|
102
102
|
prerelease: false
|
103
|
-
version_requirements: *
|
103
|
+
version_requirements: *70191797006460
|
104
104
|
description: ! 'Neat is an open source grid framework built on top of Bourbon with
|
105
105
|
the aim of being easy enough to use out of the box and flexible enough to customize
|
106
106
|
down the road.
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- spec/neat/columns_spec.rb
|
151
151
|
- spec/neat/container_spec.rb
|
152
152
|
- spec/neat/media_spec.rb
|
153
|
+
- spec/neat/new_breakpoint_spec.rb
|
153
154
|
- spec/neat/omega_spec.rb
|
154
155
|
- spec/neat/pad_spec.rb
|
155
156
|
- spec/neat/row_spec.rb
|
@@ -158,10 +159,12 @@ files:
|
|
158
159
|
- spec/support/bourbon_support.rb
|
159
160
|
- spec/support/matchers/be_contained_in.rb
|
160
161
|
- spec/support/matchers/have_rule.rb
|
162
|
+
- spec/support/matchers/have_value.rb
|
161
163
|
- spec/support/parser_support.rb
|
162
164
|
- spec/support/sass_support.rb
|
163
165
|
- test/_setup.scss
|
164
166
|
- test/media.scss
|
167
|
+
- test/new-breakpoint.scss
|
165
168
|
- test/omega.scss
|
166
169
|
- test/outer-container.scss
|
167
170
|
- test/pad.scss
|
@@ -182,7 +185,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
182
185
|
version: '0'
|
183
186
|
segments:
|
184
187
|
- 0
|
185
|
-
hash:
|
188
|
+
hash: -1770698003665574111
|
186
189
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
190
|
none: false
|
188
191
|
requirements:
|
@@ -191,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
191
194
|
version: '0'
|
192
195
|
segments:
|
193
196
|
- 0
|
194
|
-
hash:
|
197
|
+
hash: -1770698003665574111
|
195
198
|
requirements: []
|
196
199
|
rubyforge_project: neat
|
197
200
|
rubygems_version: 1.8.15
|
@@ -202,6 +205,7 @@ test_files:
|
|
202
205
|
- spec/neat/columns_spec.rb
|
203
206
|
- spec/neat/container_spec.rb
|
204
207
|
- spec/neat/media_spec.rb
|
208
|
+
- spec/neat/new_breakpoint_spec.rb
|
205
209
|
- spec/neat/omega_spec.rb
|
206
210
|
- spec/neat/pad_spec.rb
|
207
211
|
- spec/neat/row_spec.rb
|
@@ -210,10 +214,12 @@ test_files:
|
|
210
214
|
- spec/support/bourbon_support.rb
|
211
215
|
- spec/support/matchers/be_contained_in.rb
|
212
216
|
- spec/support/matchers/have_rule.rb
|
217
|
+
- spec/support/matchers/have_value.rb
|
213
218
|
- spec/support/parser_support.rb
|
214
219
|
- spec/support/sass_support.rb
|
215
220
|
- test/_setup.scss
|
216
221
|
- test/media.scss
|
222
|
+
- test/new-breakpoint.scss
|
217
223
|
- test/omega.scss
|
218
224
|
- test/outer-container.scss
|
219
225
|
- test/pad.scss
|