neat 1.9.1 → 2.0.0.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -4
- data/.hound.yml +5 -0
- data/.npmignore +0 -4
- data/.scss-lint.yml +3 -1
- data/CHANGELOG.md +45 -23
- data/CONTRIBUTING.md +12 -0
- data/Gemfile +1 -2
- data/Gulpfile.js +5 -6
- data/LICENSE.md +1 -1
- data/README.md +26 -163
- data/RELEASING.md +27 -0
- data/Rakefile +3 -13
- data/bower.json +8 -9
- data/circle.yml +13 -0
- data/contrib/base/_grids.scss +4 -0
- data/contrib/base/_variables.scss +8 -0
- data/contrib/index.html +68 -223
- data/contrib/patterns/_box.scss +11 -0
- data/contrib/patterns/_global.scss +5 -0
- data/contrib/patterns/_grid-media.scss +52 -0
- data/contrib/patterns/_grid-nested.scss +7 -0
- data/contrib/patterns/_grid-push.scss +7 -0
- data/contrib/patterns/_grid-shift.scss +7 -0
- data/contrib/patterns/_grid.scss +31 -0
- data/contrib/styles.scss +12 -293
- data/core/_neat.scss +20 -0
- data/core/neat/functions/_neat-column-default.scss +23 -0
- data/core/neat/functions/_neat-column-ratio.scss +24 -0
- data/core/neat/functions/_neat-column-width.scss +25 -0
- data/core/neat/functions/_neat-parse-columns.scss +22 -0
- data/core/neat/functions/_neat-parse-media.scss +20 -0
- data/core/neat/functions/_retrieve-neat-settings.scss +18 -0
- data/core/neat/mixins/_grid-column.scss +29 -0
- data/{app/assets/stylesheets/mixins/_clearfix.scss → core/neat/mixins/_grid-container.scss} +5 -5
- data/core/neat/mixins/_grid-media.scss +50 -0
- data/core/neat/mixins/_grid-push.scss +32 -0
- data/core/neat/mixins/_grid-shift.scss +31 -0
- data/core/neat/settings/_settings.scss +41 -0
- data/index.js +1 -1
- data/lib/neat.rb +5 -18
- data/lib/neat/generator.rb +1 -1
- data/lib/neat/version.rb +1 -1
- data/neat.gemspec +27 -33
- data/package.json +5 -4
- data/spec/.keep +0 -0
- data/spec/fixtures/_setup.scss +1 -0
- data/spec/fixtures/functions/neat-column-default.scss +22 -0
- data/spec/fixtures/functions/neat-column-width.scss +30 -0
- data/spec/fixtures/functions/neat-parse-media.scss +9 -0
- data/spec/fixtures/functions/retrieve-neat-settings.scss +22 -0
- data/spec/fixtures/mixins/grid-column.scss +57 -0
- data/spec/fixtures/mixins/grid-container.scss +5 -0
- data/spec/fixtures/mixins/grid-push.scss +38 -0
- data/spec/fixtures/mixins/grid-shift.scss +38 -0
- data/spec/neat/functions/neat_column_default_spec.rb +35 -0
- data/spec/neat/functions/neat_column_width_spec.rb +47 -0
- data/spec/neat/functions/neat_parse_media_spec.rb +23 -0
- data/spec/neat/functions/retrieve_neat_settings_spec.rb +35 -0
- data/spec/neat/mixins/grid_column_spec.rb +101 -0
- data/spec/neat/mixins/grid_container_spec.rb +17 -0
- data/spec/neat/mixins/grid_push_spec.rb +59 -0
- data/spec/neat/mixins/grid_shift_spec.rb +59 -0
- data/spec/support/matchers/have_ruleset.rb +20 -0
- data/spec/support/matchers/have_value.rb +9 -7
- data/spec/support/parser_support.rb +8 -1
- data/spec/support/sass_support.rb +1 -1
- metadata +76 -153
- data/.rspec +0 -1
- data/.ruby-version +0 -1
- data/.travis.yml +0 -10
- data/app/assets/stylesheets/_neat-helpers.scss +0 -11
- data/app/assets/stylesheets/_neat.scss +0 -24
- data/app/assets/stylesheets/functions/_new-breakpoint.scss +0 -49
- data/app/assets/stylesheets/functions/_private.scss +0 -154
- data/app/assets/stylesheets/grid/_box-sizing.scss +0 -15
- data/app/assets/stylesheets/grid/_direction-context.scss +0 -33
- data/app/assets/stylesheets/grid/_display-context.scss +0 -28
- data/app/assets/stylesheets/grid/_fill-parent.scss +0 -22
- data/app/assets/stylesheets/grid/_media.scss +0 -92
- data/app/assets/stylesheets/grid/_omega.scss +0 -112
- data/app/assets/stylesheets/grid/_outer-container.scss +0 -34
- data/app/assets/stylesheets/grid/_pad.scss +0 -25
- data/app/assets/stylesheets/grid/_private.scss +0 -35
- data/app/assets/stylesheets/grid/_reset-display.scss +0 -14
- data/app/assets/stylesheets/grid/_row.scss +0 -45
- data/app/assets/stylesheets/grid/_shift.scss +0 -50
- data/app/assets/stylesheets/grid/_span-columns.scss +0 -94
- data/app/assets/stylesheets/grid/_to-deprecate.scss +0 -81
- data/app/assets/stylesheets/grid/_visual-grid.scss +0 -42
- data/app/assets/stylesheets/settings/_disable-warnings.scss +0 -13
- data/app/assets/stylesheets/settings/_grid.scss +0 -51
- data/app/assets/stylesheets/settings/_visual-grid.scss +0 -27
- data/lib/neat/engine.rb +0 -5
- data/lib/tasks/install.rake +0 -19
- data/sache.json +0 -5
- data/spec/neat/columns_spec.rb +0 -73
- data/spec/neat/container_spec.rb +0 -21
- data/spec/neat/default_spec.rb +0 -15
- data/spec/neat/direction_spec.rb +0 -19
- data/spec/neat/display_spec.rb +0 -19
- data/spec/neat/media_spec.rb +0 -55
- data/spec/neat/new_breakpoint_spec.rb +0 -17
- data/spec/neat/omega_spec.rb +0 -66
- data/spec/neat/pad_spec.rb +0 -32
- data/spec/neat/row_spec.rb +0 -39
- data/spec/neat/shift_spec.rb +0 -41
- data/test/_setup.scss +0 -2
- data/test/default.scss +0 -1
- data/test/direction-context.scss +0 -13
- data/test/display-context.scss +0 -15
- data/test/media.scss +0 -39
- data/test/new-breakpoint.scss +0 -13
- data/test/omega.scss +0 -29
- data/test/outer-container.scss +0 -11
- data/test/pad.scss +0 -17
- data/test/row.scss +0 -26
- data/test/shift.scss +0 -36
- data/test/span-columns.scss +0 -21
@@ -0,0 +1,31 @@
|
|
1
|
+
.grid {
|
2
|
+
@include grid-container;
|
3
|
+
}
|
4
|
+
|
5
|
+
.grid__column {
|
6
|
+
@include grid-column(1);
|
7
|
+
}
|
8
|
+
|
9
|
+
.grid__column--thirds {
|
10
|
+
@include grid-column(4);
|
11
|
+
}
|
12
|
+
|
13
|
+
.grid__column--4 {
|
14
|
+
@include grid-column(4);
|
15
|
+
}
|
16
|
+
|
17
|
+
.grid__column--8 {
|
18
|
+
@include grid-column(8);
|
19
|
+
}
|
20
|
+
|
21
|
+
.grid__column--full {
|
22
|
+
@include grid-column(12);
|
23
|
+
}
|
24
|
+
|
25
|
+
.grid__column--3-of-5 {
|
26
|
+
@include grid-column(3 of 5);
|
27
|
+
}
|
28
|
+
|
29
|
+
.grid__column--2-of-5 {
|
30
|
+
@include grid-column(2 of 5);
|
31
|
+
}
|
data/contrib/styles.scss
CHANGED
@@ -1,293 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
@import "../app/assets/stylesheets/neat";
|
14
|
-
|
15
|
-
$medium-screen-up: new-breakpoint(min-width $medium-screen 4);
|
16
|
-
$large-screen-up: new-breakpoint(min-width $large-screen 8);
|
17
|
-
|
18
|
-
// Base
|
19
|
-
$base-line-height: 1.625;
|
20
|
-
$base-spacing: $base-line-height * 1em;
|
21
|
-
|
22
|
-
// Visual Grid
|
23
|
-
|
24
|
-
$visual-grid-color: #e6f6ff;
|
25
|
-
$visual-grid-opacity: 0.4;
|
26
|
-
|
27
|
-
// Colors
|
28
|
-
$white: #fafafa;
|
29
|
-
$lightblue: #d5eefb;
|
30
|
-
$blue: #aadbf5;
|
31
|
-
$darkblue: #41a8df;
|
32
|
-
$darkerblue: #072f44;
|
33
|
-
|
34
|
-
// Base
|
35
|
-
// ============================================
|
36
|
-
|
37
|
-
body {
|
38
|
-
color: $darkerblue;
|
39
|
-
font-family: sans-serif;
|
40
|
-
line-height: $base-line-height;
|
41
|
-
margin: 0 0 (1.5rem * 2);
|
42
|
-
text-align: center;
|
43
|
-
}
|
44
|
-
|
45
|
-
h3 {
|
46
|
-
margin: 1em;
|
47
|
-
}
|
48
|
-
|
49
|
-
a,
|
50
|
-
a:visited {
|
51
|
-
color: inherit;
|
52
|
-
}
|
53
|
-
|
54
|
-
pre {
|
55
|
-
line-height: 1.6em;
|
56
|
-
}
|
57
|
-
|
58
|
-
code {
|
59
|
-
display: block;
|
60
|
-
}
|
61
|
-
|
62
|
-
// Header
|
63
|
-
// ============================================
|
64
|
-
|
65
|
-
.container {
|
66
|
-
margin: 0 auto;
|
67
|
-
max-width: 500px;
|
68
|
-
padding: 0 $gutter;
|
69
|
-
position: relative;
|
70
|
-
}
|
71
|
-
|
72
|
-
.welcome-message {
|
73
|
-
@include clearfix();
|
74
|
-
background-color: $blue;
|
75
|
-
margin-bottom: 1.5rem;
|
76
|
-
padding: $base-spacing 0;
|
77
|
-
text-align: center;
|
78
|
-
}
|
79
|
-
|
80
|
-
.welcome-message-title {
|
81
|
-
font-weight: 200;
|
82
|
-
line-height: 1;
|
83
|
-
}
|
84
|
-
|
85
|
-
// ============================================
|
86
|
-
|
87
|
-
.code {
|
88
|
-
@include outer-container();
|
89
|
-
background-color: $lightblue;
|
90
|
-
padding: 0.5em;
|
91
|
-
text-align: center;
|
92
|
-
}
|
93
|
-
|
94
|
-
.page-section {
|
95
|
-
@include outer-container;
|
96
|
-
background-color: $lightblue;
|
97
|
-
line-height: $base-line-height * 1.5;
|
98
|
-
margin-bottom: 3em;
|
99
|
-
text-align: center;
|
100
|
-
}
|
101
|
-
|
102
|
-
.page-section-inner {
|
103
|
-
background-color: $blue;
|
104
|
-
font-size: 0.8em;
|
105
|
-
height: $base-line-height * 4rem;
|
106
|
-
line-height: $base-line-height;
|
107
|
-
margin-bottom: 2em;
|
108
|
-
padding: 1em;
|
109
|
-
text-align: left;
|
110
|
-
}
|
111
|
-
|
112
|
-
// Zero
|
113
|
-
// ============================================
|
114
|
-
|
115
|
-
.zero-alpha,
|
116
|
-
.zero-beta {
|
117
|
-
@include span-columns(6);
|
118
|
-
height: $base-line-height * 4rem;
|
119
|
-
line-height: $base-line-height;
|
120
|
-
padding: 1em;
|
121
|
-
text-align: left;
|
122
|
-
}
|
123
|
-
|
124
|
-
// First
|
125
|
-
// ============================================
|
126
|
-
|
127
|
-
.first-alpha {
|
128
|
-
@include span-columns(1);
|
129
|
-
}
|
130
|
-
|
131
|
-
.first-beta {
|
132
|
-
@include span-columns(11);
|
133
|
-
}
|
134
|
-
|
135
|
-
.first-gamma {
|
136
|
-
@include span-columns(2);
|
137
|
-
}
|
138
|
-
|
139
|
-
.first-delta {
|
140
|
-
@include span-columns(10);
|
141
|
-
}
|
142
|
-
|
143
|
-
.first-epsilon {
|
144
|
-
@include span-columns(3);
|
145
|
-
}
|
146
|
-
|
147
|
-
.first-zeta {
|
148
|
-
@include span-columns(9);
|
149
|
-
}
|
150
|
-
|
151
|
-
.first-eta {
|
152
|
-
@include span-columns(4);
|
153
|
-
}
|
154
|
-
|
155
|
-
.first-theta {
|
156
|
-
@include span-columns(8);
|
157
|
-
}
|
158
|
-
|
159
|
-
.first-iota {
|
160
|
-
@include span-columns(5);
|
161
|
-
}
|
162
|
-
|
163
|
-
.first-kappa {
|
164
|
-
@include span-columns(7);
|
165
|
-
}
|
166
|
-
|
167
|
-
.first-lambda {
|
168
|
-
@include span-columns(6);
|
169
|
-
}
|
170
|
-
|
171
|
-
.first-mu {
|
172
|
-
@include span-columns(6);
|
173
|
-
}
|
174
|
-
|
175
|
-
.first-beta,
|
176
|
-
.first-delta,
|
177
|
-
.first-zeta,
|
178
|
-
.first-theta,
|
179
|
-
.first-kappa,
|
180
|
-
.first-mu {
|
181
|
-
@include omega;
|
182
|
-
}
|
183
|
-
|
184
|
-
// Second
|
185
|
-
// ============================================
|
186
|
-
|
187
|
-
.second-alpha {
|
188
|
-
@include span-columns(4);
|
189
|
-
}
|
190
|
-
|
191
|
-
.second-beta {
|
192
|
-
@include span-columns(8);
|
193
|
-
line-height: $base-line-height * 2;
|
194
|
-
padding: 0;
|
195
|
-
text-align: center;
|
196
|
-
}
|
197
|
-
|
198
|
-
.second-beta-alpha,
|
199
|
-
.second-beta-beta {
|
200
|
-
@include span-columns(4 of 8);
|
201
|
-
background-color: $lightblue;
|
202
|
-
height: 84%;
|
203
|
-
padding: 1em;
|
204
|
-
}
|
205
|
-
|
206
|
-
// Third
|
207
|
-
// ===================================
|
208
|
-
|
209
|
-
.third-dummy {
|
210
|
-
border-bottom: 0;
|
211
|
-
height: 5.5em;
|
212
|
-
text-align: center;
|
213
|
-
}
|
214
|
-
|
215
|
-
.third-alpha {
|
216
|
-
@include fill-parent();
|
217
|
-
@include row(table);
|
218
|
-
margin-bottom: 0;
|
219
|
-
padding: 0;
|
220
|
-
}
|
221
|
-
|
222
|
-
.third-alpha-alpha {
|
223
|
-
@include span-columns(4);
|
224
|
-
border-right: 1px solid rgba($white, 0.5);
|
225
|
-
}
|
226
|
-
|
227
|
-
.third-alpha-beta {
|
228
|
-
@include reset-display;
|
229
|
-
@include span-columns(8);
|
230
|
-
height: 20em;
|
231
|
-
}
|
232
|
-
|
233
|
-
// Fourth
|
234
|
-
// ===================================
|
235
|
-
|
236
|
-
.fourth {
|
237
|
-
|
238
|
-
.fourth-alpha {
|
239
|
-
@include span-columns(6);
|
240
|
-
@include shift(3);
|
241
|
-
height: 20em;
|
242
|
-
text-align: center;
|
243
|
-
}
|
244
|
-
}
|
245
|
-
|
246
|
-
// Fifth
|
247
|
-
// ===================================
|
248
|
-
|
249
|
-
.fifth-box {
|
250
|
-
@include omega(4n);
|
251
|
-
@include span-columns(3);
|
252
|
-
font-size: 0.78em;
|
253
|
-
height: 8em;
|
254
|
-
margin-top: 2em;
|
255
|
-
}
|
256
|
-
|
257
|
-
// Fifth
|
258
|
-
// ===================================
|
259
|
-
|
260
|
-
.sixth {
|
261
|
-
@include media($medium-screen) {
|
262
|
-
font-size: 0.9em;
|
263
|
-
line-height: 1.5em;
|
264
|
-
}
|
265
|
-
|
266
|
-
pre {
|
267
|
-
padding: 10px 0;
|
268
|
-
}
|
269
|
-
}
|
270
|
-
|
271
|
-
.sixth-alpha,
|
272
|
-
.sixth-beta {
|
273
|
-
line-height: 2em;
|
274
|
-
min-height: 20em;
|
275
|
-
padding: 1em;
|
276
|
-
text-align: left;
|
277
|
-
}
|
278
|
-
|
279
|
-
.sixth-alpha {
|
280
|
-
@include span-columns(4);
|
281
|
-
|
282
|
-
@include media($medium-screen) {
|
283
|
-
@include span-columns(3);
|
284
|
-
}
|
285
|
-
}
|
286
|
-
|
287
|
-
.sixth-beta {
|
288
|
-
@include span-columns(8);
|
289
|
-
|
290
|
-
@include media($medium-screen) {
|
291
|
-
@include span-columns(3);
|
292
|
-
}
|
293
|
-
}
|
1
|
+
@import "../core/neat";
|
2
|
+
|
3
|
+
@import "base/grids";
|
4
|
+
@import "base/variables";
|
5
|
+
|
6
|
+
@import "patterns/box";
|
7
|
+
@import "patterns/global";
|
8
|
+
@import "patterns/grid";
|
9
|
+
@import "patterns/grid-nested";
|
10
|
+
@import "patterns/grid-push";
|
11
|
+
@import "patterns/grid-shift";
|
12
|
+
@import "patterns/grid-media";
|
data/core/_neat.scss
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
// Neat 2.0.0-alpha.1
|
3
|
+
// http://neat.bourbon.io
|
4
|
+
// Copyright 2012 thoughtbot, inc.
|
5
|
+
// MIT License
|
6
|
+
|
7
|
+
@import "neat/settings/settings";
|
8
|
+
|
9
|
+
@import "neat/functions/retrieve-neat-settings";
|
10
|
+
@import "neat/functions/neat-column-default";
|
11
|
+
@import "neat/functions/neat-column-width";
|
12
|
+
@import "neat/functions/neat-column-ratio";
|
13
|
+
@import "neat/functions/neat-parse-columns";
|
14
|
+
@import "neat/functions/neat-parse-media";
|
15
|
+
|
16
|
+
@import "neat/mixins/grid-column";
|
17
|
+
@import "neat/mixins/grid-container";
|
18
|
+
@import "neat/mixins/grid-media";
|
19
|
+
@import "neat/mixins/grid-push";
|
20
|
+
@import "neat/mixins/grid-shift";
|
@@ -0,0 +1,23 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
/// Determine if a column count has been given.
|
3
|
+
/// If no columns have been given return the grid's total column count.
|
4
|
+
///
|
5
|
+
/// @argument {map} $grid
|
6
|
+
///
|
7
|
+
/// @argument {number (unitless) | null} $columns
|
8
|
+
///
|
9
|
+
/// @return {number}
|
10
|
+
///
|
11
|
+
/// @example scss
|
12
|
+
/// _neat-column-default($neat-grid, 4)
|
13
|
+
///
|
14
|
+
/// @access private
|
15
|
+
|
16
|
+
@function _neat-column-default($grid, $columns) {
|
17
|
+
@if $columns == null {
|
18
|
+
$_grid-columns: _retrieve-neat-setting($grid, columns);
|
19
|
+
@return $_grid-columns;
|
20
|
+
} @else {
|
21
|
+
@return $columns;
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
/// Determine the ratio of `$columns` to the total column count.
|
3
|
+
/// If `$columns` is more than one value, they are handed to
|
4
|
+
/// `_neat-parse-columns()` which will detirmine the total columns and use this
|
5
|
+
/// value instead of `total-columns`.
|
6
|
+
///
|
7
|
+
/// @argument {map} $grid
|
8
|
+
///
|
9
|
+
/// @argument {number | list} $columns
|
10
|
+
///
|
11
|
+
/// @return {number}
|
12
|
+
///
|
13
|
+
/// @example scss
|
14
|
+
/// _neat-column-ratio($grid, 3)
|
15
|
+
///
|
16
|
+
/// @access private
|
17
|
+
|
18
|
+
@function _neat-column-ratio($grid, $columns) {
|
19
|
+
@if length($columns) > 1 {
|
20
|
+
@return nth($columns, 1) / _neat-parse-columns($columns);
|
21
|
+
} @else if $columns {
|
22
|
+
@return $columns / _retrieve-neat-setting($grid, columns);
|
23
|
+
}
|
24
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
/// Return a calulated column width that can then be passed in to a `calc()`.
|
3
|
+
///
|
4
|
+
/// @argument {map} $grid
|
5
|
+
///
|
6
|
+
/// @argument {number} $columns
|
7
|
+
///
|
8
|
+
/// @return {string}
|
9
|
+
///
|
10
|
+
/// @example scss
|
11
|
+
/// _neat-column-width($neat-grid, 4)
|
12
|
+
///
|
13
|
+
/// @access private
|
14
|
+
|
15
|
+
@function _neat-column-width($grid, $columns) {
|
16
|
+
$_column-ratio: _neat-column-ratio($grid, $columns);
|
17
|
+
$_gutter: _retrieve-neat-setting($grid, gutter);
|
18
|
+
|
19
|
+
@if $_gutter == 0 {
|
20
|
+
@return unquote("#{percentage($_column-ratio)}");
|
21
|
+
} @else {
|
22
|
+
$_gutter-affordance: $_gutter + ($_gutter * $_column-ratio);
|
23
|
+
@return unquote("#{percentage($_column-ratio)} - #{$_gutter-affordance}");
|
24
|
+
}
|
25
|
+
}
|