neat 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +2 -0
- data/CONTRIBUTING.md +4 -2
- data/NEWS.md +17 -12
- data/README.md +7 -9
- data/Rakefile +20 -0
- data/app/assets/stylesheets/_neat.scss +8 -0
- data/app/assets/stylesheets/grid/_fill-parent.scss +7 -0
- data/app/assets/stylesheets/grid/_global-variables.scss +4 -0
- data/app/assets/stylesheets/grid/_grid.scss +0 -205
- data/app/assets/stylesheets/grid/_media.scss +51 -0
- data/app/assets/stylesheets/grid/_outer-container.scss +8 -0
- data/app/assets/stylesheets/grid/_pad.scss +8 -0
- data/app/assets/stylesheets/grid/_row.scss +16 -0
- data/app/assets/stylesheets/grid/_shift.scss +6 -0
- data/app/assets/stylesheets/grid/_span-columns.scss +58 -0
- data/app/assets/stylesheets/grid/_to-deprecate.scss +52 -0
- data/lib/neat/version.rb +1 -1
- data/lib/tasks/install.rake +0 -2
- data/neat.gemspec +4 -0
- data/spec/neat/columns_spec.rb +61 -0
- data/spec/neat/container_spec.rb +17 -0
- data/spec/neat/media_spec.rb +47 -0
- data/spec/neat/omega_spec.rb +57 -0
- data/spec/neat/pad_spec.rb +34 -0
- data/spec/neat/row_spec.rb +41 -0
- data/spec/neat/shift_spec.rb +37 -0
- data/spec/spec_helper.rb +25 -0
- data/spec/support/bourbon_support.rb +9 -0
- data/spec/support/matchers/be_contained_in.rb +10 -0
- data/spec/support/matchers/have_rule.rb +33 -0
- data/spec/support/parser_support.rb +9 -0
- data/spec/support/sass_support.rb +10 -0
- data/test/_setup.scss +4 -0
- data/test/media.scss +31 -0
- data/test/omega.scss +35 -0
- data/test/outer-container.scss +7 -0
- data/test/pad.scss +17 -0
- data/test/row.scss +26 -0
- data/test/shift.scss +27 -0
- data/test/span-columns.scss +17 -0
- metadata +108 -13
@@ -0,0 +1,10 @@
|
|
1
|
+
RSpec::Matchers.define :be_contained_in do |expected|
|
2
|
+
match do |actual|
|
3
|
+
@query = ParserSupport.parser.find_by_selector(actual, expected)
|
4
|
+
@query.any?
|
5
|
+
end
|
6
|
+
|
7
|
+
failure_message_for_should do |actual|
|
8
|
+
%{expected selector #{actual} to be contained in #{expected}}
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
RSpec::Matchers.define :have_rule do |expected|
|
2
|
+
match do |actual|
|
3
|
+
@rules = rules_from_selector(actual)
|
4
|
+
@rules.include? expected
|
5
|
+
end
|
6
|
+
|
7
|
+
failure_message_for_should do |actual|
|
8
|
+
if @rules.empty?
|
9
|
+
%{no CSS rules for selector #{actual} were found}
|
10
|
+
else
|
11
|
+
%{expected selector #{actual} to have CSS rule "#{expected}"}
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def rules_from_selector(selector)
|
16
|
+
rulesets = ParserSupport.parser.find_by_selector(selector)
|
17
|
+
if rulesets.empty?
|
18
|
+
[]
|
19
|
+
else
|
20
|
+
rules(rulesets)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def rules(rulesets)
|
25
|
+
rules = []
|
26
|
+
rulesets.map do |ruleset|
|
27
|
+
ruleset.split(';').each do |rule|
|
28
|
+
rules << rule.strip
|
29
|
+
end
|
30
|
+
end
|
31
|
+
rules
|
32
|
+
end
|
33
|
+
end
|
data/test/_setup.scss
ADDED
data/test/media.scss
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
@import 'setup';
|
2
|
+
|
3
|
+
.media-default {
|
4
|
+
@include media(481px) {
|
5
|
+
color: #000;
|
6
|
+
}
|
7
|
+
}
|
8
|
+
|
9
|
+
.media-max-width {
|
10
|
+
@include media(max-width 480px) {
|
11
|
+
position: relative;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
.media-min-max-width {
|
16
|
+
@include media(min-width 320px max-width 480px) {
|
17
|
+
position: relative;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
.change-media-context {
|
22
|
+
@include media(481px, 6) {
|
23
|
+
@include span-columns(6);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
.change-media-context-shorthand {
|
28
|
+
@include media(max-width 480px 6) {
|
29
|
+
@include span-columns(6);
|
30
|
+
}
|
31
|
+
}
|
data/test/omega.scss
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
@import 'setup';
|
2
|
+
|
3
|
+
.omega-default {
|
4
|
+
@include omega;
|
5
|
+
color: #000;
|
6
|
+
}
|
7
|
+
|
8
|
+
.omega-table {
|
9
|
+
@include omega(table);
|
10
|
+
}
|
11
|
+
|
12
|
+
.omega-block-left {
|
13
|
+
@include omega(block, left);
|
14
|
+
color: #000;
|
15
|
+
}
|
16
|
+
|
17
|
+
.omega-table-left{
|
18
|
+
@include omega(table, left);
|
19
|
+
}
|
20
|
+
|
21
|
+
.omega-nth-default {
|
22
|
+
@include omega(4n)
|
23
|
+
}
|
24
|
+
|
25
|
+
.omega-nth-table {
|
26
|
+
@include omega(4n table);
|
27
|
+
}
|
28
|
+
|
29
|
+
.omega-nth-default-left {
|
30
|
+
@include omega(4n block, left);
|
31
|
+
}
|
32
|
+
|
33
|
+
.omega-nth-table-left {
|
34
|
+
@include omega(4n table, left);
|
35
|
+
}
|
data/test/pad.scss
ADDED
data/test/row.scss
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
@import 'setup';
|
2
|
+
|
3
|
+
.row-default {
|
4
|
+
@include row;
|
5
|
+
}
|
6
|
+
|
7
|
+
.row-table {
|
8
|
+
@include row(table);
|
9
|
+
}
|
10
|
+
|
11
|
+
.row-invalid-display {
|
12
|
+
@include row(invalid-argument);
|
13
|
+
}
|
14
|
+
|
15
|
+
.row-table-reset {
|
16
|
+
@include row(table);
|
17
|
+
|
18
|
+
.block-child {
|
19
|
+
@include span-columns(4, block);
|
20
|
+
@include reset-display;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
.no-row {
|
25
|
+
@include span-columns(4);
|
26
|
+
}
|
data/test/shift.scss
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
@import 'setup';
|
2
|
+
|
3
|
+
.shift-default {
|
4
|
+
@include shift;
|
5
|
+
}
|
6
|
+
|
7
|
+
.shift-positive {
|
8
|
+
@include shift(2);
|
9
|
+
}
|
10
|
+
|
11
|
+
.shift-negative {
|
12
|
+
@include shift(-3);
|
13
|
+
}
|
14
|
+
|
15
|
+
// Nesting
|
16
|
+
.shifted-parent {
|
17
|
+
@include span-columns(6);
|
18
|
+
|
19
|
+
.shifted-child {
|
20
|
+
@include span-columns(2 of 6);
|
21
|
+
@include shift(2);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
.post-nested-shift {
|
26
|
+
@include shift(2);
|
27
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
@import 'setup';
|
2
|
+
|
3
|
+
.span-columns-default {
|
4
|
+
@include span-columns(6);
|
5
|
+
|
6
|
+
.span-columns-nested {
|
7
|
+
@include span-columns(2 of 6);
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
.span-columns-table {
|
12
|
+
@include span-columns(6, table);
|
13
|
+
}
|
14
|
+
|
15
|
+
.span-columns-inline-block {
|
16
|
+
@include span-columns(6, inline-block);
|
17
|
+
}
|
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.
|
4
|
+
version: 1.2.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: 2013-
|
14
|
+
date: 2013-02-19 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: sass
|
18
|
-
requirement: &
|
18
|
+
requirement: &70172351236160 !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: *70172351236160
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bourbon
|
29
|
-
requirement: &
|
29
|
+
requirement: &70172351233920 !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: *70172351233920
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: aruba
|
40
|
-
requirement: &
|
40
|
+
requirement: &70172351232100 !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: *70172351232100
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: rake
|
51
|
-
requirement: &
|
51
|
+
requirement: &70172351231020 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
54
|
- - ! '>='
|
@@ -56,7 +56,51 @@ dependencies:
|
|
56
56
|
version: '0'
|
57
57
|
type: :development
|
58
58
|
prerelease: false
|
59
|
-
version_requirements: *
|
59
|
+
version_requirements: *70172351231020
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: css_parser
|
62
|
+
requirement: &70172351229140 !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ! '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: *70172351229140
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: rspec
|
73
|
+
requirement: &70172351227520 !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: *70172351227520
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: rdoc
|
84
|
+
requirement: &70172351189640 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: *70172351189640
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: bundler
|
95
|
+
requirement: &70172351188860 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ! '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
type: :development
|
102
|
+
prerelease: false
|
103
|
+
version_requirements: *70172351188860
|
60
104
|
description: ! 'Neat is an open source grid framework built on top of Bourbon with
|
61
105
|
the aim of being easy enough to use out of the box and flexible enough to customize
|
62
106
|
down the road.
|
@@ -70,6 +114,7 @@ extensions: []
|
|
70
114
|
extra_rdoc_files: []
|
71
115
|
files:
|
72
116
|
- .gitignore
|
117
|
+
- .rspec
|
73
118
|
- CONTRIBUTING.md
|
74
119
|
- Gemfile
|
75
120
|
- LICENSE
|
@@ -81,9 +126,17 @@ files:
|
|
81
126
|
- app/assets/stylesheets/functions/_new-breakpoint.scss
|
82
127
|
- app/assets/stylesheets/functions/_private.scss
|
83
128
|
- app/assets/stylesheets/functions/_px-to-em.scss
|
129
|
+
- app/assets/stylesheets/grid/_fill-parent.scss
|
84
130
|
- app/assets/stylesheets/grid/_global-variables.scss
|
85
131
|
- app/assets/stylesheets/grid/_grid.scss
|
132
|
+
- app/assets/stylesheets/grid/_media.scss
|
86
133
|
- app/assets/stylesheets/grid/_omega.scss
|
134
|
+
- app/assets/stylesheets/grid/_outer-container.scss
|
135
|
+
- app/assets/stylesheets/grid/_pad.scss
|
136
|
+
- app/assets/stylesheets/grid/_row.scss
|
137
|
+
- app/assets/stylesheets/grid/_shift.scss
|
138
|
+
- app/assets/stylesheets/grid/_span-columns.scss
|
139
|
+
- app/assets/stylesheets/grid/_to-deprecate.scss
|
87
140
|
- app/assets/stylesheets/grid/_visual-grid.scss
|
88
141
|
- app/assets/stylesheets/settings/_grid.scss
|
89
142
|
- app/assets/stylesheets/settings/_visual-grid.scss
|
@@ -94,6 +147,27 @@ files:
|
|
94
147
|
- lib/neat/version.rb
|
95
148
|
- lib/tasks/install.rake
|
96
149
|
- neat.gemspec
|
150
|
+
- spec/neat/columns_spec.rb
|
151
|
+
- spec/neat/container_spec.rb
|
152
|
+
- spec/neat/media_spec.rb
|
153
|
+
- spec/neat/omega_spec.rb
|
154
|
+
- spec/neat/pad_spec.rb
|
155
|
+
- spec/neat/row_spec.rb
|
156
|
+
- spec/neat/shift_spec.rb
|
157
|
+
- spec/spec_helper.rb
|
158
|
+
- spec/support/bourbon_support.rb
|
159
|
+
- spec/support/matchers/be_contained_in.rb
|
160
|
+
- spec/support/matchers/have_rule.rb
|
161
|
+
- spec/support/parser_support.rb
|
162
|
+
- spec/support/sass_support.rb
|
163
|
+
- test/_setup.scss
|
164
|
+
- test/media.scss
|
165
|
+
- test/omega.scss
|
166
|
+
- test/outer-container.scss
|
167
|
+
- test/pad.scss
|
168
|
+
- test/row.scss
|
169
|
+
- test/shift.scss
|
170
|
+
- test/span-columns.scss
|
97
171
|
homepage: https://github.com/thoughtbot/neat
|
98
172
|
licenses: []
|
99
173
|
post_install_message:
|
@@ -108,7 +182,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
182
|
version: '0'
|
109
183
|
segments:
|
110
184
|
- 0
|
111
|
-
hash:
|
185
|
+
hash: 3740631716143461963
|
112
186
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
187
|
none: false
|
114
188
|
requirements:
|
@@ -117,11 +191,32 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
191
|
version: '0'
|
118
192
|
segments:
|
119
193
|
- 0
|
120
|
-
hash:
|
194
|
+
hash: 3740631716143461963
|
121
195
|
requirements: []
|
122
196
|
rubyforge_project: neat
|
123
197
|
rubygems_version: 1.8.15
|
124
198
|
signing_key:
|
125
199
|
specification_version: 3
|
126
200
|
summary: A fluid grid framework on top of Bourbon
|
127
|
-
test_files:
|
201
|
+
test_files:
|
202
|
+
- spec/neat/columns_spec.rb
|
203
|
+
- spec/neat/container_spec.rb
|
204
|
+
- spec/neat/media_spec.rb
|
205
|
+
- spec/neat/omega_spec.rb
|
206
|
+
- spec/neat/pad_spec.rb
|
207
|
+
- spec/neat/row_spec.rb
|
208
|
+
- spec/neat/shift_spec.rb
|
209
|
+
- spec/spec_helper.rb
|
210
|
+
- spec/support/bourbon_support.rb
|
211
|
+
- spec/support/matchers/be_contained_in.rb
|
212
|
+
- spec/support/matchers/have_rule.rb
|
213
|
+
- spec/support/parser_support.rb
|
214
|
+
- spec/support/sass_support.rb
|
215
|
+
- test/_setup.scss
|
216
|
+
- test/media.scss
|
217
|
+
- test/omega.scss
|
218
|
+
- test/outer-container.scss
|
219
|
+
- test/pad.scss
|
220
|
+
- test/row.scss
|
221
|
+
- test/shift.scss
|
222
|
+
- test/span-columns.scss
|