archetype 0.0.1.pre.3.00dfd9a → 0.0.1.pre.3.6ed259b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/VERSION.yml +1 -1
- data/bin/archetype +3 -0
- data/lib/archetype.rb +4 -0
- data/lib/archetype/actions/help.rb +16 -0
- data/lib/archetype/actions/theme.rb +73 -0
- data/lib/archetype/executor.rb +27 -0
- data/lib/archetype/sass_extensions/functions/lists.rb +26 -32
- data/lib/archetype/sass_extensions/functions/styleguide.rb +1 -1
- data/lib/archetype/sass_extensions/functions/ui.rb +2 -1
- data/lib/archetype/sass_extensions/functions/version.rb +2 -2
- data/lib/archetype/version.rb +2 -2
- data/stylesheets/archetype/_config.scss +10 -6
- data/stylesheets/archetype/_hacks.scss +40 -16
- data/stylesheets/archetype/_ui.scss +10 -4
- data/stylesheets/archetype/styleguide/components/_buttons.scss +1 -0
- data/stylesheets/archetype/util/_styles.scss +14 -3
- data/templates/_theme/_components.scss +3 -0
- data/templates/_theme/_config.scss +1 -0
- data/templates/_theme/_core.scss +13 -0
- data/templates/_theme/_helpers.scss +1 -0
- data/templates/_theme/_primitives.scss +3 -0
- data/templates/_theme/components/README +1 -0
- data/templates/_theme/primitives/README +1 -0
- data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders-s7889ccc8c1.png +0 -0
- data/test/fixtures/stylesheets/archetype/config.rb +2 -0
- data/test/fixtures/stylesheets/archetype/expected/hacks/ie_pseudo.css +3 -3
- data/test/fixtures/stylesheets/archetype/expected/hacks/transparent_focusable.css +4 -0
- data/test/fixtures/stylesheets/archetype/expected/styleguide/buttons.css +28 -0
- data/test/fixtures/stylesheets/archetype/expected/styleguide/extend.css +7 -0
- data/test/fixtures/stylesheets/archetype/expected/styleguide/selective_state.css +3 -0
- data/test/fixtures/stylesheets/archetype/expected/ui/glyph_icon.css +52 -5
- data/test/fixtures/stylesheets/archetype/expected/utilities/custom_output_styler.css +8 -0
- data/test/fixtures/stylesheets/archetype/expected/utilities/targeting/target-browser.css +5 -0
- data/test/fixtures/stylesheets/archetype/source/hacks/transparent_focusable.scss +5 -0
- data/test/fixtures/stylesheets/archetype/source/styleguide/extend.scss +23 -0
- data/test/fixtures/stylesheets/archetype/source/ui/glyph_icon.scss +12 -0
- data/test/fixtures/stylesheets/archetype/source/utilities/custom_output_styler.scss +21 -0
- data/test/fixtures/stylesheets/archetype/source/utilities/targeting/target-browser.scss +8 -1
- data/test/helpers/test_case.rb +2 -2
- data/test/units/sass_extensions_test.rb +18 -25
- metadata +29 -3
@@ -0,0 +1,23 @@
|
|
1
|
+
@import "archetype";
|
2
|
+
|
3
|
+
.some-extend-class {
|
4
|
+
color: red;
|
5
|
+
}
|
6
|
+
|
7
|
+
%some-extend-placeholder {
|
8
|
+
background: green;
|
9
|
+
}
|
10
|
+
|
11
|
+
@if not styleguide-component-exists(extend-styleguide-test, $CONFIG_THEME) {
|
12
|
+
$a-blackhole: styleguide-add-component(extend-styleguide-test, (), (
|
13
|
+
(default, (
|
14
|
+
extend '.some-extend-class',
|
15
|
+
extend '%some-extend-placeholder'
|
16
|
+
)),
|
17
|
+
nil
|
18
|
+
), $CONFIG_THEME);
|
19
|
+
}
|
20
|
+
|
21
|
+
.extend-styleguide-test {
|
22
|
+
@include styleguide(extend-styleguide-test);
|
23
|
+
}
|
@@ -11,3 +11,15 @@
|
|
11
11
|
.size {
|
12
12
|
@include glyph-icon(caret-down, $size: 20px);
|
13
13
|
}
|
14
|
+
|
15
|
+
$CONFIG_GENERATED_TAG_INLINE: false;
|
16
|
+
.not-inline {
|
17
|
+
@include glyph-icon(caret-down);
|
18
|
+
}
|
19
|
+
|
20
|
+
.ie-uid {
|
21
|
+
@include glyph-icon(caret-down, $ie-uid: my-custom-id);
|
22
|
+
#{$archetype-glyph-selector} {
|
23
|
+
color: pink;
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
// define the test function
|
2
|
+
@function has-custom-output-styler($property, $value, $method: pre) {
|
3
|
+
@if $property == color {
|
4
|
+
@return true;
|
5
|
+
}
|
6
|
+
// only if it's a post processing all values
|
7
|
+
@else if $property == line-height and $method == post {
|
8
|
+
@return true;
|
9
|
+
}
|
10
|
+
@return false;
|
11
|
+
}
|
12
|
+
// define the custom styler
|
13
|
+
@mixin custom-output-styler($property, $value, $method: pre) {
|
14
|
+
#{$property}: $value; /* #{$method} override */
|
15
|
+
}
|
16
|
+
|
17
|
+
@import "archetype";
|
18
|
+
|
19
|
+
.test {
|
20
|
+
@include styleguide(copy);
|
21
|
+
}
|
@@ -43,7 +43,7 @@
|
|
43
43
|
|
44
44
|
.target-ie-lte-9 {
|
45
45
|
@include target-browser(ie lte 9, border-color, #111);
|
46
|
-
@include target-browser(ie lte 9, background, #2c2c2b);
|
46
|
+
@include target-browser(ie lte 9, background, #2c2c2b);
|
47
47
|
}
|
48
48
|
|
49
49
|
.target-ie-7-8-9 {
|
@@ -68,3 +68,10 @@
|
|
68
68
|
.target-opera {
|
69
69
|
@include target-browser(opera, width, 82%);
|
70
70
|
}
|
71
|
+
|
72
|
+
.target-with-content-block {
|
73
|
+
@include target-browser(ie lte 8) {
|
74
|
+
/* testing content block */
|
75
|
+
color: red;
|
76
|
+
};
|
77
|
+
}
|
data/test/helpers/test_case.rb
CHANGED
@@ -24,7 +24,7 @@ module Compass
|
|
24
24
|
assert false, diff_as_string(before.inspect, after.inspect)
|
25
25
|
end
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
module ClassMethods
|
29
29
|
|
30
30
|
def let(method, &block)
|
@@ -51,7 +51,7 @@ module Compass
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
private
|
54
|
+
private
|
55
55
|
|
56
56
|
def underscore(string)
|
57
57
|
string.gsub(' ', '_')
|
@@ -4,6 +4,7 @@ require 'archetype'
|
|
4
4
|
class SassExtensionsTest < Test::Unit::TestCase
|
5
5
|
setup do
|
6
6
|
Compass.reset_configuration!
|
7
|
+
Compass.configuration.testing = true
|
7
8
|
end
|
8
9
|
|
9
10
|
## VERSION
|
@@ -16,20 +17,20 @@ class SassExtensionsTest < Test::Unit::TestCase
|
|
16
17
|
assert_equal "true", evaluate("archetype-version('Compass >= 0.12')")
|
17
18
|
assert_equal "false", evaluate("archetype-version('Sass >= 99.0.0')")
|
18
19
|
assert_equal "true", evaluate("archetype-version('Sass gt 3.0')")
|
19
|
-
assert_equal "
|
20
|
+
assert_equal "true", evaluate("archetype-version(Archetype ne 99)")
|
20
21
|
end
|
21
22
|
|
22
23
|
|
23
24
|
## ENVIRONMENT
|
24
25
|
# test that archetype-env() is working correctly
|
25
26
|
def test_env
|
26
|
-
|
27
|
+
reset
|
27
28
|
assert_equal "development", evaluate("archetype-env()")
|
28
29
|
Compass.configuration.environment = :production
|
29
30
|
assert_equal "production", evaluate("archetype-env()")
|
30
31
|
Compass.configuration.environment = :staging
|
31
32
|
assert_equal "staging", evaluate("archetype-env()")
|
32
|
-
|
33
|
+
reset
|
33
34
|
end
|
34
35
|
|
35
36
|
|
@@ -49,19 +50,6 @@ class SassExtensionsTest < Test::Unit::TestCase
|
|
49
50
|
# TODO
|
50
51
|
end
|
51
52
|
|
52
|
-
# list-sort
|
53
|
-
#def test_list_sort
|
54
|
-
# assert_equal "1 2 3 4", evaluate("list-sort(2 4 3 1)")
|
55
|
-
# assert_equal "4 3 2 1", evaluate("list-sort(2 4 3 1, true)")
|
56
|
-
# assert_equal "a b c d", evaluate("list-sort(d a b c)")
|
57
|
-
#end
|
58
|
-
|
59
|
-
# list-reverse
|
60
|
-
#def test_list_reverse
|
61
|
-
# assert_equal "4 3 2 1", evaluate("list-reverse(1 2 3 4)")
|
62
|
-
# assert_equal "d c b a", evaluate("list-reverse(a b c d)")
|
63
|
-
#end
|
64
|
-
|
65
53
|
# list-add
|
66
54
|
def test_list_add
|
67
55
|
assert_equal "2 3 4", evaluate("list-add(1 2 3, 1)")
|
@@ -127,16 +115,16 @@ class SassExtensionsTest < Test::Unit::TestCase
|
|
127
115
|
## LOCALE
|
128
116
|
# locale
|
129
117
|
def test_locale
|
130
|
-
|
118
|
+
reset
|
131
119
|
assert_equal "en_US", evaluate("locale()")
|
132
120
|
Compass.configuration.locale = "ja_JP"
|
133
121
|
assert_equal "ja_JP", evaluate("locale()")
|
134
|
-
|
122
|
+
reset
|
135
123
|
end
|
136
124
|
|
137
125
|
# lang
|
138
126
|
def test_lang
|
139
|
-
|
127
|
+
reset
|
140
128
|
assert_equal "true", evaluate("lang(en_US)")
|
141
129
|
assert_equal "true", evaluate("lang(fr_FR en_US)")
|
142
130
|
assert_equal "false", evaluate("lang(fr_FR)")
|
@@ -145,7 +133,7 @@ class SassExtensionsTest < Test::Unit::TestCase
|
|
145
133
|
assert_equal "true", evaluate("lang(ja_JP)")
|
146
134
|
assert_equal "true", evaluate("lang(CJK)")
|
147
135
|
assert_equal "true", evaluate("lang(CJK en_US)")
|
148
|
-
|
136
|
+
reset
|
149
137
|
end
|
150
138
|
|
151
139
|
|
@@ -183,11 +171,11 @@ class SassExtensionsTest < Test::Unit::TestCase
|
|
183
171
|
## UI
|
184
172
|
# test generating unique tokens
|
185
173
|
def test_unique
|
186
|
-
assert_equal ".archetype-uid-
|
187
|
-
assert_equal ".archetype-uid-
|
188
|
-
assert_equal "\#archetype-uid-
|
189
|
-
assert_equal "my-prefix-archetype-uid-
|
190
|
-
assert_equal ".testing-archetype-uid-
|
174
|
+
assert_equal ".archetype-uid-RANDOM_UID", evaluate("unique(class)")
|
175
|
+
assert_equal ".archetype-uid-RANDOM_UID", evaluate("unique(class)")
|
176
|
+
assert_equal "\#archetype-uid-RANDOM_UID", evaluate("unique(id)")
|
177
|
+
assert_equal "my-prefix-archetype-uid-RANDOM_UID", evaluate("unique(my-prefix-)")
|
178
|
+
assert_equal ".testing-archetype-uid-RANDOM_UID", evaluate("unique('.testing-')")
|
191
179
|
end
|
192
180
|
|
193
181
|
# test pseudo content escaping and formatting for innerHTML
|
@@ -204,4 +192,9 @@ protected
|
|
204
192
|
def evaluate(value)
|
205
193
|
Sass::Script::Parser.parse(value, 0, 0).perform(Sass::Environment.new).to_s
|
206
194
|
end
|
195
|
+
|
196
|
+
def reset
|
197
|
+
Compass.reset_configuration!
|
198
|
+
Compass.configuration.testing = true
|
199
|
+
end
|
207
200
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: archetype
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.pre.3.
|
4
|
+
version: 0.0.1.pre.3.6ed259b
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eugene ONeill
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: compass
|
@@ -56,7 +56,8 @@ dependencies:
|
|
56
56
|
description: UI Pattern and component library for quickly iterating on and maintaining
|
57
57
|
scalable web interfaces
|
58
58
|
email: oneill.eugene@gmail.com
|
59
|
-
executables:
|
59
|
+
executables:
|
60
|
+
- archetype
|
60
61
|
extensions: []
|
61
62
|
extra_rdoc_files: []
|
62
63
|
files:
|
@@ -64,6 +65,10 @@ files:
|
|
64
65
|
- README.md
|
65
66
|
- CHANGELOG.md
|
66
67
|
- VERSION.yml
|
68
|
+
- bin/archetype
|
69
|
+
- lib/archetype/actions/help.rb
|
70
|
+
- lib/archetype/actions/theme.rb
|
71
|
+
- lib/archetype/executor.rb
|
67
72
|
- lib/archetype/functions/hash.rb
|
68
73
|
- lib/archetype/functions/helpers.rb
|
69
74
|
- lib/archetype/functions/styleguide_memoizer.rb
|
@@ -140,6 +145,13 @@ files:
|
|
140
145
|
- stylesheets/archetype/util/_styles.scss
|
141
146
|
- stylesheets/archetype/util/_targeting.scss
|
142
147
|
- stylesheets/archetype/util/_units.scss
|
148
|
+
- templates/_theme/_components.scss
|
149
|
+
- templates/_theme/_config.scss
|
150
|
+
- templates/_theme/_core.scss
|
151
|
+
- templates/_theme/_helpers.scss
|
152
|
+
- templates/_theme/_primitives.scss
|
153
|
+
- templates/_theme/components/README
|
154
|
+
- templates/_theme/primitives/README
|
143
155
|
- templates/example/index.html
|
144
156
|
- templates/example/manifest.rb
|
145
157
|
- templates/example/screen.scss
|
@@ -193,13 +205,16 @@ files:
|
|
193
205
|
- test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/small/small_dark.png
|
194
206
|
- test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/small/small_dark_static.png
|
195
207
|
- test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/small/small_static.png
|
208
|
+
- test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders-s7889ccc8c1.png
|
196
209
|
- test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/sprites/hovercard_tip.png
|
197
210
|
- test/fixtures/stylesheets/archetype/config.rb
|
198
211
|
- test/fixtures/stylesheets/archetype/expected/b.css
|
199
212
|
- test/fixtures/stylesheets/archetype/expected/base.css
|
200
213
|
- test/fixtures/stylesheets/archetype/expected/hacks/ie_pseudo.css
|
214
|
+
- test/fixtures/stylesheets/archetype/expected/hacks/transparent_focusable.css
|
201
215
|
- test/fixtures/stylesheets/archetype/expected/locale.css
|
202
216
|
- test/fixtures/stylesheets/archetype/expected/styleguide/buttons.css
|
217
|
+
- test/fixtures/stylesheets/archetype/expected/styleguide/extend.css
|
203
218
|
- test/fixtures/stylesheets/archetype/expected/styleguide/fallback_styles.css
|
204
219
|
- test/fixtures/stylesheets/archetype/expected/styleguide/nested_styleguides.css
|
205
220
|
- test/fixtures/stylesheets/archetype/expected/styleguide/selective_state.css
|
@@ -208,6 +223,7 @@ files:
|
|
208
223
|
- test/fixtures/stylesheets/archetype/expected/ui/stroke.css
|
209
224
|
- test/fixtures/stylesheets/archetype/expected/ui/triangle.css
|
210
225
|
- test/fixtures/stylesheets/archetype/expected/utilities/associative.css
|
226
|
+
- test/fixtures/stylesheets/archetype/expected/utilities/custom_output_styler.css
|
211
227
|
- test/fixtures/stylesheets/archetype/expected/utilities/if-set.css
|
212
228
|
- test/fixtures/stylesheets/archetype/expected/utilities/spacing/horizontal-spacing.css
|
213
229
|
- test/fixtures/stylesheets/archetype/expected/utilities/spacing/vertical-spacing.css
|
@@ -219,8 +235,10 @@ files:
|
|
219
235
|
- test/fixtures/stylesheets/archetype/source/b.scss
|
220
236
|
- test/fixtures/stylesheets/archetype/source/base.scss
|
221
237
|
- test/fixtures/stylesheets/archetype/source/hacks/ie_pseudo.scss
|
238
|
+
- test/fixtures/stylesheets/archetype/source/hacks/transparent_focusable.scss
|
222
239
|
- test/fixtures/stylesheets/archetype/source/locale.scss
|
223
240
|
- test/fixtures/stylesheets/archetype/source/styleguide/buttons.scss
|
241
|
+
- test/fixtures/stylesheets/archetype/source/styleguide/extend.scss
|
224
242
|
- test/fixtures/stylesheets/archetype/source/styleguide/fallback_styles.scss
|
225
243
|
- test/fixtures/stylesheets/archetype/source/styleguide/nested_styleguides.scss
|
226
244
|
- test/fixtures/stylesheets/archetype/source/styleguide/selective_state.scss
|
@@ -229,6 +247,7 @@ files:
|
|
229
247
|
- test/fixtures/stylesheets/archetype/source/ui/stroke.scss
|
230
248
|
- test/fixtures/stylesheets/archetype/source/ui/triangle.scss
|
231
249
|
- test/fixtures/stylesheets/archetype/source/utilities/associative.scss
|
250
|
+
- test/fixtures/stylesheets/archetype/source/utilities/custom_output_styler.scss
|
232
251
|
- test/fixtures/stylesheets/archetype/source/utilities/if-set.scss
|
233
252
|
- test/fixtures/stylesheets/archetype/source/utilities/spacing/horizontal-spacing.scss
|
234
253
|
- test/fixtures/stylesheets/archetype/source/utilities/spacing/vertical-spacing.scss
|
@@ -284,13 +303,16 @@ test_files:
|
|
284
303
|
- test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/small/small_dark.png
|
285
304
|
- test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/small/small_dark_static.png
|
286
305
|
- test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/small/small_static.png
|
306
|
+
- test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders-s7889ccc8c1.png
|
287
307
|
- test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/sprites/hovercard_tip.png
|
288
308
|
- test/fixtures/stylesheets/archetype/config.rb
|
289
309
|
- test/fixtures/stylesheets/archetype/expected/b.css
|
290
310
|
- test/fixtures/stylesheets/archetype/expected/base.css
|
291
311
|
- test/fixtures/stylesheets/archetype/expected/hacks/ie_pseudo.css
|
312
|
+
- test/fixtures/stylesheets/archetype/expected/hacks/transparent_focusable.css
|
292
313
|
- test/fixtures/stylesheets/archetype/expected/locale.css
|
293
314
|
- test/fixtures/stylesheets/archetype/expected/styleguide/buttons.css
|
315
|
+
- test/fixtures/stylesheets/archetype/expected/styleguide/extend.css
|
294
316
|
- test/fixtures/stylesheets/archetype/expected/styleguide/fallback_styles.css
|
295
317
|
- test/fixtures/stylesheets/archetype/expected/styleguide/nested_styleguides.css
|
296
318
|
- test/fixtures/stylesheets/archetype/expected/styleguide/selective_state.css
|
@@ -299,6 +321,7 @@ test_files:
|
|
299
321
|
- test/fixtures/stylesheets/archetype/expected/ui/stroke.css
|
300
322
|
- test/fixtures/stylesheets/archetype/expected/ui/triangle.css
|
301
323
|
- test/fixtures/stylesheets/archetype/expected/utilities/associative.css
|
324
|
+
- test/fixtures/stylesheets/archetype/expected/utilities/custom_output_styler.css
|
302
325
|
- test/fixtures/stylesheets/archetype/expected/utilities/if-set.css
|
303
326
|
- test/fixtures/stylesheets/archetype/expected/utilities/spacing/horizontal-spacing.css
|
304
327
|
- test/fixtures/stylesheets/archetype/expected/utilities/spacing/vertical-spacing.css
|
@@ -310,8 +333,10 @@ test_files:
|
|
310
333
|
- test/fixtures/stylesheets/archetype/source/b.scss
|
311
334
|
- test/fixtures/stylesheets/archetype/source/base.scss
|
312
335
|
- test/fixtures/stylesheets/archetype/source/hacks/ie_pseudo.scss
|
336
|
+
- test/fixtures/stylesheets/archetype/source/hacks/transparent_focusable.scss
|
313
337
|
- test/fixtures/stylesheets/archetype/source/locale.scss
|
314
338
|
- test/fixtures/stylesheets/archetype/source/styleguide/buttons.scss
|
339
|
+
- test/fixtures/stylesheets/archetype/source/styleguide/extend.scss
|
315
340
|
- test/fixtures/stylesheets/archetype/source/styleguide/fallback_styles.scss
|
316
341
|
- test/fixtures/stylesheets/archetype/source/styleguide/nested_styleguides.scss
|
317
342
|
- test/fixtures/stylesheets/archetype/source/styleguide/selective_state.scss
|
@@ -320,6 +345,7 @@ test_files:
|
|
320
345
|
- test/fixtures/stylesheets/archetype/source/ui/stroke.scss
|
321
346
|
- test/fixtures/stylesheets/archetype/source/ui/triangle.scss
|
322
347
|
- test/fixtures/stylesheets/archetype/source/utilities/associative.scss
|
348
|
+
- test/fixtures/stylesheets/archetype/source/utilities/custom_output_styler.scss
|
323
349
|
- test/fixtures/stylesheets/archetype/source/utilities/if-set.scss
|
324
350
|
- test/fixtures/stylesheets/archetype/source/utilities/spacing/horizontal-spacing.scss
|
325
351
|
- test/fixtures/stylesheets/archetype/source/utilities/spacing/vertical-spacing.scss
|