archetype 0.0.1.pre.3.90263a7 → 0.0.1.pre.3.811928f

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/CHANGELOG.md +1 -24
  2. data/LICENSE +1 -1
  3. data/README.md +1 -1
  4. data/VERSION.yml +1 -1
  5. data/lib/archetype.rb +0 -4
  6. data/lib/archetype/functions/hash.rb +12 -28
  7. data/lib/archetype/functions/helpers.rb +13 -56
  8. data/lib/archetype/functions/styleguide_memoizer.rb +1 -9
  9. data/lib/archetype/sass_extensions.rb +0 -1
  10. data/lib/archetype/sass_extensions/functions/lists.rb +40 -34
  11. data/lib/archetype/sass_extensions/functions/locale.rb +16 -32
  12. data/lib/archetype/sass_extensions/functions/styleguide.rb +37 -115
  13. data/lib/archetype/sass_extensions/functions/ui.rb +2 -3
  14. data/lib/archetype/sass_extensions/functions/version.rb +6 -11
  15. data/lib/archetype/version.rb +12 -19
  16. data/stylesheets/archetype/_base.scss +0 -3
  17. data/stylesheets/archetype/_config.scss +5 -22
  18. data/stylesheets/archetype/_hacks.scss +21 -62
  19. data/stylesheets/archetype/_ui.scss +11 -56
  20. data/stylesheets/archetype/base/_h5bp.scss +12 -12
  21. data/stylesheets/archetype/base/_normalize.scss +139 -178
  22. data/stylesheets/archetype/styleguide/_helpers.scss +4 -1
  23. data/stylesheets/archetype/styleguide/components/_alerts.scss +1 -1
  24. data/stylesheets/archetype/styleguide/components/_buttons.scss +6 -7
  25. data/stylesheets/archetype/styleguide/components/_closes.scss +2 -2
  26. data/stylesheets/archetype/util/_styles.scss +7 -45
  27. data/stylesheets/archetype/util/_targeting.scss +0 -2
  28. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders-s7889ccc8c1.png +0 -0
  29. data/test/fixtures/stylesheets/archetype/config.rb +0 -2
  30. data/test/fixtures/stylesheets/archetype/expected/hacks/ie_pseudo.css +3 -3
  31. data/test/fixtures/stylesheets/archetype/expected/styleguide/buttons.css +18 -110
  32. data/test/fixtures/stylesheets/archetype/expected/styleguide/selective_state.css +0 -3
  33. data/test/fixtures/stylesheets/archetype/expected/ui/glyph_icon.css +2 -116
  34. data/test/fixtures/stylesheets/archetype/expected/utilities/targeting/target-browser.css +0 -5
  35. data/test/fixtures/stylesheets/archetype/source/styleguide/buttons.scss +1 -5
  36. data/test/fixtures/stylesheets/archetype/source/styleguide/fallback_styles.scss +1 -1
  37. data/test/fixtures/stylesheets/archetype/source/styleguide/nested_styleguides.scss +1 -1
  38. data/test/fixtures/stylesheets/archetype/source/styleguide/selective_state.scss +1 -1
  39. data/test/fixtures/stylesheets/archetype/source/ui/glyph_icon.scss +0 -30
  40. data/test/fixtures/stylesheets/archetype/source/utilities/targeting/target-browser.scss +1 -8
  41. data/test/helpers/test_case.rb +2 -2
  42. data/test/integrations/archetype_test.rb +1 -3
  43. data/test/units/sass_extensions_test.rb +25 -18
  44. metadata +23 -80
  45. checksums.yaml +0 -7
  46. data/bin/archetype +0 -3
  47. data/lib/archetype/actions/help.rb +0 -16
  48. data/lib/archetype/actions/theme.rb +0 -73
  49. data/lib/archetype/executor.rb +0 -27
  50. data/lib/archetype/sass_extensions/monkey_patches.rb +0 -3
  51. data/lib/archetype/sass_extensions/monkey_patches/handle_include_loop.rb +0 -41
  52. data/templates/_theme/_components.scss +0 -3
  53. data/templates/_theme/_config.scss +0 -1
  54. data/templates/_theme/_core.scss +0 -13
  55. data/templates/_theme/_helpers.scss +0 -1
  56. data/templates/_theme/_primitives.scss +0 -3
  57. data/templates/_theme/components/README +0 -1
  58. data/templates/_theme/primitives/README +0 -1
  59. data/test/fixtures/stylesheets/archetype/expected/base.css +0 -349
  60. data/test/fixtures/stylesheets/archetype/expected/hacks/transparent_focusable.css +0 -4
  61. data/test/fixtures/stylesheets/archetype/expected/locale.css +0 -23
  62. data/test/fixtures/stylesheets/archetype/expected/styleguide/alerts.css +0 -675
  63. data/test/fixtures/stylesheets/archetype/expected/styleguide/drop.css +0 -63
  64. data/test/fixtures/stylesheets/archetype/expected/styleguide/extend.css +0 -7
  65. data/test/fixtures/stylesheets/archetype/expected/styleguide/invalid_structures.css +0 -21
  66. data/test/fixtures/stylesheets/archetype/expected/styleguide/multi_value.css +0 -13
  67. data/test/fixtures/stylesheets/archetype/expected/utilities/associative.css +0 -9
  68. data/test/fixtures/stylesheets/archetype/expected/utilities/custom_output_styler.css +0 -8
  69. data/test/fixtures/stylesheets/archetype/source/base.scss +0 -3
  70. data/test/fixtures/stylesheets/archetype/source/hacks/transparent_focusable.scss +0 -5
  71. data/test/fixtures/stylesheets/archetype/source/locale.scss +0 -43
  72. data/test/fixtures/stylesheets/archetype/source/styleguide/alerts.scss +0 -21
  73. data/test/fixtures/stylesheets/archetype/source/styleguide/drop.scss +0 -101
  74. data/test/fixtures/stylesheets/archetype/source/styleguide/extend.scss +0 -23
  75. data/test/fixtures/stylesheets/archetype/source/styleguide/invalid_structures.scss +0 -85
  76. data/test/fixtures/stylesheets/archetype/source/styleguide/multi_value.scss +0 -18
  77. data/test/fixtures/stylesheets/archetype/source/utilities/associative.scss +0 -24
  78. data/test/fixtures/stylesheets/archetype/source/utilities/custom_output_styler.scss +0 -21
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 79510cfaba6afef89a552a3ac086173c80c73822
4
- data.tar.gz: 2214d9ff17d64a4fab9829e870ac8849e952cec4
5
- SHA512:
6
- metadata.gz: 90fd7abc4d5707b492d987a3e0870b911f27d08e1baec5a16bee065f101927ce44a443727cb0b3640a2a0fa509cac2c9f4ce29a34709645f6637f12214bee1f3
7
- data.tar.gz: 95fa9484e95e38ad062889e68bb11aa2d7d21a4edbb2c1e9db8be53b729ba1d795d9a1ca67e8586526493486770d51a976a593937218166c4e38637e00a271b6
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require File.join(File.dirname(__FILE__), '..', 'lib/archetype/executor')
@@ -1,16 +0,0 @@
1
- description = "Get help on an Archetype action"
2
- if @description.nil?
3
- # do stuff...
4
- @help = true
5
-
6
- if not ARGV[1].nil? and ARGV[1] != 'help'
7
- action = File.join(@actions_path, ARGV[1])
8
- begin
9
- load "#{action}.rb"
10
- rescue
11
- puts "unknown action: #{ARGV[1]}"
12
- end
13
- end
14
- else
15
- @description = description
16
- end
@@ -1,73 +0,0 @@
1
- require 'fileutils'
2
- description = "Generate a new Archetype theme"
3
-
4
- if @description.nil?
5
- options = {
6
- :extends => 'archetype'
7
- }
8
- OptionParser.new do |opts|
9
- opts.banner = description
10
- opts.define_head "Usage: archetype theme [path] [options]"
11
- opts.separator ""
12
- opts.separator "Example usage:"
13
- opts.separator " archetype theme /path/to/scss/ --name=myCustomTheme"
14
- opts.separator " archetype theme --name=themes/myExtendedTheme --extends=themes/myBaseTheme"
15
-
16
- opts.on('-n', '--name THEME', 'theme name') do |v|
17
- options[:theme] = v
18
- end
19
-
20
- opts.on('-x', '--extends THEME', 'theme name to extend') do |v|
21
- options[:extends] = v
22
- end
23
-
24
- opts.on('-h', '--help', 'shows this help message') do
25
- puts opts
26
- exit
27
- end
28
-
29
- if not @help.nil?
30
- puts opts
31
- exit
32
- end
33
- end.parse!
34
-
35
- if not options[:theme].nil?
36
- base = ARGV[1] || '.'
37
- tmp = '/tmp/theme_' + rand(36**8).to_s(36)
38
- theme_template = File.join(File.dirname(__FILE__), '../../../templates/_theme/')
39
- theme_path = File.join(base, options[:theme])
40
- extends = "#{options[:extends]}"
41
- if options[:extends] != 'archetype'
42
- extends = "#{extends}/core"
43
- end
44
- theme_name = File.basename(options[:theme])
45
- # copy template files to tmp dir
46
- FileUtils.mkdir_p(tmp)
47
- FileUtils.cp_r(Dir["#{theme_template}/**"], tmp)
48
-
49
- puts "Creating theme '#{theme_name}' in #{File.expand_path(theme_path)}..."
50
- puts "extending from #{options[:extends]}" if options[:extends] != 'archetype'
51
-
52
- # update all placeholders in template files
53
- Dir.glob("#{tmp}/**/*.scss") do |filename|
54
- out = File.read(filename).gsub(/__THEME_NAME__/, theme_name).gsub(/__THEME_EXTENDS__/, extends)
55
- File.open(filename, "w") { |file| file.puts out }
56
- end
57
-
58
- # now move all the theme files to their destination
59
- FileUtils.mkdir_p(theme_path)
60
- FileUtils.cp_r(Dir["#{tmp}/**"], theme_path)
61
-
62
- # create convenience file _<theme>.scss ...
63
- File.open(File.join(File.dirname(theme_path), "_#{theme_name}.scss"), "w") { |file| file.puts "// #{theme_name} theme\n@import \"#{theme_name}/core\";\n" }
64
-
65
- # remove tmp dir
66
- FileUtils.rm_rf(tmp)
67
- puts "Congratulations! Your new theme has been created!"
68
- puts "Use @import \"#{options[:theme]}\" in your scss files."
69
- exit
70
- end
71
- else
72
- @description = description
73
- end
@@ -1,27 +0,0 @@
1
- require 'optparse'
2
-
3
- @actions_path = File.join(File.dirname(__FILE__), 'actions')
4
-
5
- if not ARGV[0].nil? and not ARGV[0].empty?
6
- action_name = ARGV[0]
7
- action = File.join(@actions_path, action_name)
8
- begin
9
- require action
10
- rescue
11
- puts "unknown action: #{action_name}"
12
- end
13
- end
14
-
15
- # if we got here, there was either no action, or the action was invalid
16
- OptionParser.new do |opts|
17
- opts.banner = "Archetype command line actions\n\n"
18
- opts.define_head "Usage: archetype <action> [options]"
19
- opts.separator ""
20
- opts.separator "Available Actions:"
21
- Dir.glob("#{@actions_path}/*.rb") do |action|
22
- @description = true
23
- load action
24
- opts.separator " * #{File.basename(action, '.rb')}\t- #{@description}"
25
- end
26
- puts opts
27
- end.parse!
@@ -1,3 +0,0 @@
1
- %w(handle_include_loop).each do |patch|
2
- require "archetype/sass_extensions/monkey_patches/#{patch}"
3
- end
@@ -1,41 +0,0 @@
1
- # :stopdoc:
2
- # monkey patch Sass to exclude special mixins from it's include loop logic
3
- module Sass
4
- module Tree
5
- module Visitors
6
- class Perform
7
- def handle_include_loop!(node)
8
- # a list of exempt mixins
9
- exempt = %w(to-styles output-style -outputStyle)
10
- exempts = []
11
-
12
- msg = "An @include loop has been found:"
13
- content_count = 0
14
- mixins = @stack.reverse.map {|s| s[:name]}.compact.select do |s|
15
- if s == '@content'
16
- content_count += 1
17
- false
18
- elsif content_count > 0
19
- content_count -= 1
20
- false
21
- # if the mixin is exempt, keep track of it
22
- elsif exempt.include?(s.gsub(/_/,'-'))
23
- exempts.push(s)
24
- false
25
- else
26
- true
27
- end
28
- end
29
-
30
- return if mixins.empty? or (mixins.size <= exempts.size)
31
- raise Sass::SyntaxError.new("#{msg} #{node.name} includes itself") if mixins.size == 1
32
-
33
- msg << "\n" << Sass::Util.enum_cons(mixins.reverse + [node.name], 2).map do |m1, m2|
34
- " #{m1} includes #{m2}"
35
- end.join("\n")
36
- raise Sass::SyntaxError.new(msg)
37
- end
38
- end
39
- end
40
- end
41
- end
@@ -1,3 +0,0 @@
1
- // import your components here!
2
- // e.g.
3
- // @import "components/my_component";
@@ -1 +0,0 @@
1
- $CONFIG_THEME: "__THEME_NAME__" !default;
@@ -1,13 +0,0 @@
1
- // setup theme configs and styles
2
- @import "config";
3
- @import "primitives";
4
-
5
- // extend the __THEME_EXTENDS__ theme
6
- @import "__THEME_EXTENDS__";
7
- //@import "../__THEME_EXTENDS__/core";
8
-
9
- // import helper functions
10
- @import "helpers";
11
-
12
- // finally initialize our custom components
13
- @import "components";
@@ -1 +0,0 @@
1
- // helper methods go here
@@ -1,3 +0,0 @@
1
- // import your primitives here!
2
- // e.g.
3
- // @import "primitives/my_primitive";
@@ -1 +0,0 @@
1
- // place your component partials in this directory
@@ -1 +0,0 @@
1
- // place your primitive partials in this directory
@@ -1,349 +0,0 @@
1
- @-webkit-keyframes archetype-loader {
2
- from {
3
- -webkit-transform: rotate(0deg);
4
- }
5
-
6
- to {
7
- -webkit-transform: rotate(360deg);
8
- }
9
- }
10
-
11
- @-moz-keyframes archetype-loader {
12
- from {
13
- -moz-transform: rotate(0deg);
14
- }
15
-
16
- to {
17
- -moz-transform: rotate(360deg);
18
- }
19
- }
20
-
21
- @-ms-keyframes archetype-loader {
22
- from {
23
- -ms-transform: rotate(0deg);
24
- }
25
-
26
- to {
27
- -ms-transform: rotate(360deg);
28
- }
29
- }
30
-
31
- @-o-keyframes archetype-loader {
32
- from {
33
- -o-transform: rotate(0deg);
34
- }
35
-
36
- to {
37
- -o-transform: rotate(360deg);
38
- }
39
- }
40
-
41
- @keyframes archetype-loader {
42
- from {
43
- transform: rotate(0deg);
44
- }
45
-
46
- to {
47
- transform: rotate(360deg);
48
- }
49
- }
50
-
51
- @-webkit-keyframes archetype-loader-position-medium-1 {
52
- from, to {
53
- background-position: 0 -230px;
54
- width: 58px;
55
- height: 58px;
56
- margin-left: -29px;
57
- margin-top: -29px;
58
- }
59
- }
60
-
61
- @-moz-keyframes archetype-loader-position-medium-1 {
62
- from, to {
63
- background-position: 0 -230px;
64
- width: 58px;
65
- height: 58px;
66
- margin-left: -29px;
67
- margin-top: -29px;
68
- }
69
- }
70
-
71
- @-ms-keyframes archetype-loader-position-medium-1 {
72
- from, to {
73
- background-position: 0 -230px;
74
- width: 58px;
75
- height: 58px;
76
- margin-left: -29px;
77
- margin-top: -29px;
78
- }
79
- }
80
-
81
- @-o-keyframes archetype-loader-position-medium-1 {
82
- from, to {
83
- background-position: 0 -230px;
84
- width: 58px;
85
- height: 58px;
86
- margin-left: -29px;
87
- margin-top: -29px;
88
- }
89
- }
90
-
91
- @keyframes archetype-loader-position-medium-1 {
92
- from, to {
93
- background-position: 0 -230px;
94
- width: 58px;
95
- height: 58px;
96
- margin-left: -29px;
97
- margin-top: -29px;
98
- }
99
- }
100
-
101
- @-webkit-keyframes archetype-loader-position-medium-2 {
102
- from, to {
103
- background-position: 0 -288px;
104
- width: 58px;
105
- height: 58px;
106
- margin-left: -29px;
107
- margin-top: -29px;
108
- }
109
- }
110
-
111
- @-moz-keyframes archetype-loader-position-medium-2 {
112
- from, to {
113
- background-position: 0 -288px;
114
- width: 58px;
115
- height: 58px;
116
- margin-left: -29px;
117
- margin-top: -29px;
118
- }
119
- }
120
-
121
- @-ms-keyframes archetype-loader-position-medium-2 {
122
- from, to {
123
- background-position: 0 -288px;
124
- width: 58px;
125
- height: 58px;
126
- margin-left: -29px;
127
- margin-top: -29px;
128
- }
129
- }
130
-
131
- @-o-keyframes archetype-loader-position-medium-2 {
132
- from, to {
133
- background-position: 0 -288px;
134
- width: 58px;
135
- height: 58px;
136
- margin-left: -29px;
137
- margin-top: -29px;
138
- }
139
- }
140
-
141
- @keyframes archetype-loader-position-medium-2 {
142
- from, to {
143
- background-position: 0 -288px;
144
- width: 58px;
145
- height: 58px;
146
- margin-left: -29px;
147
- margin-top: -29px;
148
- }
149
- }
150
-
151
- @-webkit-keyframes archetype-loader-position-small-1 {
152
- from, to {
153
- background-position: 0 -692px;
154
- width: 16px;
155
- height: 16px;
156
- margin-left: -8px;
157
- margin-top: -8px;
158
- }
159
- }
160
-
161
- @-moz-keyframes archetype-loader-position-small-1 {
162
- from, to {
163
- background-position: 0 -692px;
164
- width: 16px;
165
- height: 16px;
166
- margin-left: -8px;
167
- margin-top: -8px;
168
- }
169
- }
170
-
171
- @-ms-keyframes archetype-loader-position-small-1 {
172
- from, to {
173
- background-position: 0 -692px;
174
- width: 16px;
175
- height: 16px;
176
- margin-left: -8px;
177
- margin-top: -8px;
178
- }
179
- }
180
-
181
- @-o-keyframes archetype-loader-position-small-1 {
182
- from, to {
183
- background-position: 0 -692px;
184
- width: 16px;
185
- height: 16px;
186
- margin-left: -8px;
187
- margin-top: -8px;
188
- }
189
- }
190
-
191
- @keyframes archetype-loader-position-small-1 {
192
- from, to {
193
- background-position: 0 -692px;
194
- width: 16px;
195
- height: 16px;
196
- margin-left: -8px;
197
- margin-top: -8px;
198
- }
199
- }
200
-
201
- @-webkit-keyframes archetype-loader-position-small-2 {
202
- from, to {
203
- background-position: 0 -708px;
204
- width: 16px;
205
- height: 16px;
206
- margin-left: -8px;
207
- margin-top: -8px;
208
- }
209
- }
210
-
211
- @-moz-keyframes archetype-loader-position-small-2 {
212
- from, to {
213
- background-position: 0 -708px;
214
- width: 16px;
215
- height: 16px;
216
- margin-left: -8px;
217
- margin-top: -8px;
218
- }
219
- }
220
-
221
- @-ms-keyframes archetype-loader-position-small-2 {
222
- from, to {
223
- background-position: 0 -708px;
224
- width: 16px;
225
- height: 16px;
226
- margin-left: -8px;
227
- margin-top: -8px;
228
- }
229
- }
230
-
231
- @-o-keyframes archetype-loader-position-small-2 {
232
- from, to {
233
- background-position: 0 -708px;
234
- width: 16px;
235
- height: 16px;
236
- margin-left: -8px;
237
- margin-top: -8px;
238
- }
239
- }
240
-
241
- @keyframes archetype-loader-position-small-2 {
242
- from, to {
243
- background-position: 0 -708px;
244
- width: 16px;
245
- height: 16px;
246
- margin-left: -8px;
247
- margin-top: -8px;
248
- }
249
- }
250
-
251
- @-webkit-keyframes archetype-loader-position-large-1 {
252
- from, to {
253
- background-position: 0 -462px;
254
- width: 115px;
255
- height: 115px;
256
- margin-left: -57.5px;
257
- margin-top: -57.5px;
258
- }
259
- }
260
-
261
- @-moz-keyframes archetype-loader-position-large-1 {
262
- from, to {
263
- background-position: 0 -462px;
264
- width: 115px;
265
- height: 115px;
266
- margin-left: -57.5px;
267
- margin-top: -57.5px;
268
- }
269
- }
270
-
271
- @-ms-keyframes archetype-loader-position-large-1 {
272
- from, to {
273
- background-position: 0 -462px;
274
- width: 115px;
275
- height: 115px;
276
- margin-left: -57.5px;
277
- margin-top: -57.5px;
278
- }
279
- }
280
-
281
- @-o-keyframes archetype-loader-position-large-1 {
282
- from, to {
283
- background-position: 0 -462px;
284
- width: 115px;
285
- height: 115px;
286
- margin-left: -57.5px;
287
- margin-top: -57.5px;
288
- }
289
- }
290
-
291
- @keyframes archetype-loader-position-large-1 {
292
- from, to {
293
- background-position: 0 -462px;
294
- width: 115px;
295
- height: 115px;
296
- margin-left: -57.5px;
297
- margin-top: -57.5px;
298
- }
299
- }
300
-
301
- @-webkit-keyframes archetype-loader-position-large-2 {
302
- from, to {
303
- background-position: 0 -577px;
304
- width: 115px;
305
- height: 115px;
306
- margin-left: -57.5px;
307
- margin-top: -57.5px;
308
- }
309
- }
310
-
311
- @-moz-keyframes archetype-loader-position-large-2 {
312
- from, to {
313
- background-position: 0 -577px;
314
- width: 115px;
315
- height: 115px;
316
- margin-left: -57.5px;
317
- margin-top: -57.5px;
318
- }
319
- }
320
-
321
- @-ms-keyframes archetype-loader-position-large-2 {
322
- from, to {
323
- background-position: 0 -577px;
324
- width: 115px;
325
- height: 115px;
326
- margin-left: -57.5px;
327
- margin-top: -57.5px;
328
- }
329
- }
330
-
331
- @-o-keyframes archetype-loader-position-large-2 {
332
- from, to {
333
- background-position: 0 -577px;
334
- width: 115px;
335
- height: 115px;
336
- margin-left: -57.5px;
337
- margin-top: -57.5px;
338
- }
339
- }
340
-
341
- @keyframes archetype-loader-position-large-2 {
342
- from, to {
343
- background-position: 0 -577px;
344
- width: 115px;
345
- height: 115px;
346
- margin-left: -57.5px;
347
- margin-top: -57.5px;
348
- }
349
- }