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.
- data/CHANGELOG.md +1 -24
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/VERSION.yml +1 -1
- data/lib/archetype.rb +0 -4
- data/lib/archetype/functions/hash.rb +12 -28
- data/lib/archetype/functions/helpers.rb +13 -56
- data/lib/archetype/functions/styleguide_memoizer.rb +1 -9
- data/lib/archetype/sass_extensions.rb +0 -1
- data/lib/archetype/sass_extensions/functions/lists.rb +40 -34
- data/lib/archetype/sass_extensions/functions/locale.rb +16 -32
- data/lib/archetype/sass_extensions/functions/styleguide.rb +37 -115
- data/lib/archetype/sass_extensions/functions/ui.rb +2 -3
- data/lib/archetype/sass_extensions/functions/version.rb +6 -11
- data/lib/archetype/version.rb +12 -19
- data/stylesheets/archetype/_base.scss +0 -3
- data/stylesheets/archetype/_config.scss +5 -22
- data/stylesheets/archetype/_hacks.scss +21 -62
- data/stylesheets/archetype/_ui.scss +11 -56
- data/stylesheets/archetype/base/_h5bp.scss +12 -12
- data/stylesheets/archetype/base/_normalize.scss +139 -178
- data/stylesheets/archetype/styleguide/_helpers.scss +4 -1
- data/stylesheets/archetype/styleguide/components/_alerts.scss +1 -1
- data/stylesheets/archetype/styleguide/components/_buttons.scss +6 -7
- data/stylesheets/archetype/styleguide/components/_closes.scss +2 -2
- data/stylesheets/archetype/util/_styles.scss +7 -45
- data/stylesheets/archetype/util/_targeting.scss +0 -2
- data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders-s7889ccc8c1.png +0 -0
- data/test/fixtures/stylesheets/archetype/config.rb +0 -2
- data/test/fixtures/stylesheets/archetype/expected/hacks/ie_pseudo.css +3 -3
- data/test/fixtures/stylesheets/archetype/expected/styleguide/buttons.css +18 -110
- data/test/fixtures/stylesheets/archetype/expected/styleguide/selective_state.css +0 -3
- data/test/fixtures/stylesheets/archetype/expected/ui/glyph_icon.css +2 -116
- data/test/fixtures/stylesheets/archetype/expected/utilities/targeting/target-browser.css +0 -5
- data/test/fixtures/stylesheets/archetype/source/styleguide/buttons.scss +1 -5
- data/test/fixtures/stylesheets/archetype/source/styleguide/fallback_styles.scss +1 -1
- data/test/fixtures/stylesheets/archetype/source/styleguide/nested_styleguides.scss +1 -1
- data/test/fixtures/stylesheets/archetype/source/styleguide/selective_state.scss +1 -1
- data/test/fixtures/stylesheets/archetype/source/ui/glyph_icon.scss +0 -30
- data/test/fixtures/stylesheets/archetype/source/utilities/targeting/target-browser.scss +1 -8
- data/test/helpers/test_case.rb +2 -2
- data/test/integrations/archetype_test.rb +1 -3
- data/test/units/sass_extensions_test.rb +25 -18
- metadata +23 -80
- checksums.yaml +0 -7
- data/bin/archetype +0 -3
- data/lib/archetype/actions/help.rb +0 -16
- data/lib/archetype/actions/theme.rb +0 -73
- data/lib/archetype/executor.rb +0 -27
- data/lib/archetype/sass_extensions/monkey_patches.rb +0 -3
- data/lib/archetype/sass_extensions/monkey_patches/handle_include_loop.rb +0 -41
- data/templates/_theme/_components.scss +0 -3
- data/templates/_theme/_config.scss +0 -1
- data/templates/_theme/_core.scss +0 -13
- data/templates/_theme/_helpers.scss +0 -1
- data/templates/_theme/_primitives.scss +0 -3
- data/templates/_theme/components/README +0 -1
- data/templates/_theme/primitives/README +0 -1
- data/test/fixtures/stylesheets/archetype/expected/base.css +0 -349
- data/test/fixtures/stylesheets/archetype/expected/hacks/transparent_focusable.css +0 -4
- data/test/fixtures/stylesheets/archetype/expected/locale.css +0 -23
- data/test/fixtures/stylesheets/archetype/expected/styleguide/alerts.css +0 -675
- data/test/fixtures/stylesheets/archetype/expected/styleguide/drop.css +0 -63
- data/test/fixtures/stylesheets/archetype/expected/styleguide/extend.css +0 -7
- data/test/fixtures/stylesheets/archetype/expected/styleguide/invalid_structures.css +0 -21
- data/test/fixtures/stylesheets/archetype/expected/styleguide/multi_value.css +0 -13
- data/test/fixtures/stylesheets/archetype/expected/utilities/associative.css +0 -9
- data/test/fixtures/stylesheets/archetype/expected/utilities/custom_output_styler.css +0 -8
- data/test/fixtures/stylesheets/archetype/source/base.scss +0 -3
- data/test/fixtures/stylesheets/archetype/source/hacks/transparent_focusable.scss +0 -5
- data/test/fixtures/stylesheets/archetype/source/locale.scss +0 -43
- data/test/fixtures/stylesheets/archetype/source/styleguide/alerts.scss +0 -21
- data/test/fixtures/stylesheets/archetype/source/styleguide/drop.scss +0 -101
- data/test/fixtures/stylesheets/archetype/source/styleguide/extend.scss +0 -23
- data/test/fixtures/stylesheets/archetype/source/styleguide/invalid_structures.scss +0 -85
- data/test/fixtures/stylesheets/archetype/source/styleguide/multi_value.scss +0 -18
- data/test/fixtures/stylesheets/archetype/source/utilities/associative.scss +0 -24
- data/test/fixtures/stylesheets/archetype/source/utilities/custom_output_styler.scss +0 -21
@@ -15,13 +15,10 @@ module Archetype::SassExtensions::Styleguide
|
|
15
15
|
DEFAULT = 'default'
|
16
16
|
REGEX = 'regex'
|
17
17
|
SPECIAL = %w(states selectors)
|
18
|
-
DROPALL = %w(all true)
|
19
18
|
# these are unique CSS keys that can be exploited to provide fallback functionality by providing a second value
|
20
19
|
# e.g color: red; color: rgba(255,0,0, 0.8);
|
21
|
-
FALLBACKS = %w(background background-image background-color border border-bottom border-bottom-color border-color border-left border-left-color border-right border-right-color border-top border-top-color clip color layer-background-color outline outline-color white-space
|
22
|
-
|
23
|
-
MULTIMIXINS = %w(target-browser)
|
24
|
-
ADDITIVES = FALLBACKS + [DROP, INHERIT, STYLEGUIDE] + MULTIMIXINS
|
20
|
+
FALLBACKS = %w(background background-image background-color border border-bottom border-bottom-color border-color border-left border-left-color border-right border-right-color border-top border-top-color clip color layer-background-color outline outline-color white-space)
|
21
|
+
ADDITIVES = FALLBACKS + [DROP, INHERIT, STYLEGUIDE]
|
25
22
|
@@archetype_styleguide_mutex = Mutex.new
|
26
23
|
# :startdoc:
|
27
24
|
|
@@ -79,7 +76,7 @@ module Archetype::SassExtensions::Styleguide
|
|
79
76
|
extensions = theme[:extensions]
|
80
77
|
return Sass::Script::Bool.new(false) if component_exists(id, theme, extension, force)
|
81
78
|
extensions.push(extension)
|
82
|
-
components[id] = (components[id] ||=
|
79
|
+
components[id] = (components[id] ||= {}).rmerge(helpers.list_to_hash(data, 1, SPECIAL, ADDITIVES))
|
83
80
|
return Sass::Script::Bool.new(true)
|
84
81
|
end
|
85
82
|
end
|
@@ -101,7 +98,7 @@ module Archetype::SassExtensions::Styleguide
|
|
101
98
|
#
|
102
99
|
def styleguide_component_exists(id, theme = nil, extension = nil, force = false)
|
103
100
|
@@archetype_styleguide_mutex.synchronize do
|
104
|
-
extension = helpers.to_str(extension)
|
101
|
+
extension = helpers.to_str(extension) if not extension.nil?
|
105
102
|
return Sass::Script::Bool.new( component_exists(id, theme, extension, force) )
|
106
103
|
end
|
107
104
|
end
|
@@ -226,34 +223,29 @@ private
|
|
226
223
|
#
|
227
224
|
def extract_styles(id, modifiers, strict = false, theme = nil, context = nil)
|
228
225
|
theme = get_theme(theme)
|
229
|
-
context ||= theme[:components][id] ||
|
226
|
+
context ||= theme[:components][id] || {}
|
230
227
|
modifiers = helpers.to_str(modifiers)
|
231
|
-
return
|
228
|
+
return {} if context.nil? or context.empty?
|
232
229
|
# push on the defaults first
|
233
|
-
out = (strict ? resolve_dependents(id, context[modifiers], theme[:name], context) : context[DEFAULT]) ||
|
230
|
+
out = (strict ? resolve_dependents(id, context[modifiers], theme[:name], context) : context[DEFAULT]) || {}
|
234
231
|
out = out.clone
|
235
232
|
# if it's not strict, find anything that matched
|
236
233
|
if not strict
|
237
234
|
modifiers = modifiers.split
|
238
|
-
context.each do |
|
239
|
-
definition = [key, definition]
|
235
|
+
context.each do |definition|
|
240
236
|
modifier = definition[0]
|
241
237
|
if modifier != DEFAULT
|
242
238
|
match = true
|
243
239
|
modifier = modifier.split
|
244
240
|
if modifier[0] == REGEX
|
245
241
|
# if it's a regex pattern, test if it matches
|
246
|
-
match = modifiers.join(' ') =~ /#{
|
242
|
+
match = modifiers.join(' ') =~ /#{modifiers[1].gsub(/\A"|"\Z/, '')}/i
|
247
243
|
else
|
248
244
|
# otherwise, if the modifier isn't in our list of modifiers, it's not valid and just move on
|
249
245
|
modifier.each { |i| match = false if not modifiers.include?(i) }
|
250
246
|
end
|
251
247
|
# if it matched, process it
|
252
|
-
if match
|
253
|
-
tmp = resolve_dependents(id, definition[1], theme[:name], nil, out)
|
254
|
-
out, tmp = post_resolve_drops(out, tmp)
|
255
|
-
out = out.rmerge(tmp)
|
256
|
-
end
|
248
|
+
out = out.rmerge(resolve_dependents(id, definition[1], theme[:name], nil, out.keys)) if match
|
257
249
|
end
|
258
250
|
end
|
259
251
|
end
|
@@ -261,19 +253,15 @@ private
|
|
261
253
|
# this lets us define special states and elements
|
262
254
|
SPECIAL.each do |special_key|
|
263
255
|
if out.is_a? Hash
|
264
|
-
special = out[special_key]
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
tmp = Archetype::Hash.new
|
269
|
-
special.each { |key, value| tmp[key] = extract_styles(key, key, true, theme[:name], special) }
|
270
|
-
out[special_key] = tmp if not tmp.empty?
|
271
|
-
end
|
256
|
+
special = out[special_key]
|
257
|
+
tmp = {}
|
258
|
+
(special || {}).each { |key, value| tmp[key] = extract_styles(key, key, true, theme[:name], special) }
|
259
|
+
out[special_key] = tmp if not tmp.empty?
|
272
260
|
end
|
273
261
|
end
|
274
262
|
# check for nested styleguides
|
275
263
|
styleguide = out[STYLEGUIDE]
|
276
|
-
if
|
264
|
+
if styleguide and not styleguide.empty?
|
277
265
|
styles = get_styles(styleguide, theme[:name])
|
278
266
|
out.delete(STYLEGUIDE)
|
279
267
|
out = styles.rmerge(out)
|
@@ -281,87 +269,6 @@ private
|
|
281
269
|
return out
|
282
270
|
end
|
283
271
|
|
284
|
-
#
|
285
|
-
# given two objects, resolve the chain of dropped styles
|
286
|
-
# this runs after having already resolved the dropped styles and merged
|
287
|
-
#
|
288
|
-
# *Parameters*:
|
289
|
-
# - <tt>obj</tt> {Hash} the source object
|
290
|
-
# - <tt>merger</tt> {Hash} the object to be merged in
|
291
|
-
# *Returns*:
|
292
|
-
# - {Array.<Hash>} the resulting `obj` and `merger` objects
|
293
|
-
#
|
294
|
-
def post_resolve_drops(obj, merger)
|
295
|
-
return [obj, merger] if obj.nil? or merger.nil?
|
296
|
-
drop = merger[DROP]
|
297
|
-
keys = obj.keys
|
298
|
-
if not drop.nil?
|
299
|
-
drop.to_a.each do |key|
|
300
|
-
key = helpers.to_str(key)
|
301
|
-
obj.delete(key) if not SPECIAL.include?(key)
|
302
|
-
end
|
303
|
-
merger.delete(DROP)
|
304
|
-
else
|
305
|
-
end
|
306
|
-
SPECIAL.each do |special|
|
307
|
-
if obj[special].is_a?(Hash) and merger[special].is_a?(Hash)
|
308
|
-
obj[special], merger[special] = post_resolve_drops(obj[special], merger[special])
|
309
|
-
end
|
310
|
-
end
|
311
|
-
return [obj, merger]
|
312
|
-
end
|
313
|
-
|
314
|
-
#
|
315
|
-
# given two objects, resolve the chain of dropped styles
|
316
|
-
#
|
317
|
-
# *Parameters*:
|
318
|
-
# - <tt>value</tt> {Hash} the source object
|
319
|
-
# - <tt>obj</tt> {Hash} the object to be merged in
|
320
|
-
# - <tt>is_special</tt> {Boolean} whether this is from a SPECIAL branch of a Hash
|
321
|
-
# *Returns*:
|
322
|
-
# - {Array.<Hash>} the resulting value
|
323
|
-
#
|
324
|
-
def resolve_drops(value, obj, is_special = false)
|
325
|
-
return value if not (value.is_a?(Hash) and obj.is_a?(Hash))
|
326
|
-
keys = obj.keys
|
327
|
-
drop = value[DROP]
|
328
|
-
if not drop.nil?
|
329
|
-
tmp = Archetype::Hash.new
|
330
|
-
if DROPALL.include?(helpers.to_str(drop))
|
331
|
-
if not keys.nil?
|
332
|
-
keys.each do |key|
|
333
|
-
if SPECIAL.include?(key)
|
334
|
-
if not (obj[key].nil? or obj[key].empty?)
|
335
|
-
tmp[key] = Archetype::Hash.new
|
336
|
-
tmp[key][DROP] = obj[key].keys
|
337
|
-
end
|
338
|
-
else
|
339
|
-
tmp[key] = 'nil'
|
340
|
-
end
|
341
|
-
end
|
342
|
-
end
|
343
|
-
else
|
344
|
-
drop.to_a.each do |key|
|
345
|
-
key = helpers.to_str(key)
|
346
|
-
if SPECIAL.include?(key)
|
347
|
-
if not (obj[key].nil? or obj[key].empty?)
|
348
|
-
tmp[key] = Archetype::Hash.new
|
349
|
-
tmp[key][DROP] = obj[key].keys
|
350
|
-
end
|
351
|
-
else
|
352
|
-
tmp[key] = 'nil'
|
353
|
-
end
|
354
|
-
end
|
355
|
-
end
|
356
|
-
value.delete(DROP) if not is_special
|
357
|
-
value = tmp.rmerge(value)
|
358
|
-
end
|
359
|
-
value.each do |key|
|
360
|
-
value[key] = resolve_drops(value[key], obj[key], key, SPECIAL.include?(key)) if not value[key].nil?
|
361
|
-
end
|
362
|
-
return value
|
363
|
-
end
|
364
|
-
|
365
272
|
#
|
366
273
|
# resolve any dependent references from the component
|
367
274
|
#
|
@@ -374,19 +281,33 @@ private
|
|
374
281
|
# *Returns*:
|
375
282
|
# - {Hash} a hash of the resolved styles
|
376
283
|
#
|
377
|
-
def resolve_dependents(id, value, theme = nil, context = nil,
|
284
|
+
def resolve_dependents(id, value, theme = nil, context = nil, keys = nil)
|
378
285
|
# we have to create a clone here as the passed in value is volatile and we're performing destructive changes
|
379
286
|
value = value.clone
|
380
287
|
# check that we're dealing with a hash
|
381
288
|
if value.is_a?(Hash)
|
382
289
|
# check for dropped styles
|
383
|
-
|
384
|
-
|
290
|
+
drop = value[DROP]
|
291
|
+
if not drop.nil?
|
292
|
+
tmp = {}
|
293
|
+
if %w(all true).include?(helpers.to_str(drop)) and not keys.nil? and not keys.empty?
|
294
|
+
keys.each do |key|
|
295
|
+
tmp[key] = 'nil'
|
296
|
+
end
|
297
|
+
else
|
298
|
+
drop = drop.to_a
|
299
|
+
drop.each do |key|
|
300
|
+
tmp[helpers.to_str(key)] = 'nil'
|
301
|
+
end
|
302
|
+
end
|
303
|
+
value.delete(DROP)
|
304
|
+
value = tmp.rmerge(value)
|
305
|
+
end
|
385
306
|
# check for inheritance
|
386
307
|
inherit = value[INHERIT]
|
387
|
-
if
|
308
|
+
if inherit and not inherit.empty?
|
388
309
|
# create a temporary object and extract the nested styles
|
389
|
-
tmp =
|
310
|
+
tmp = {}
|
390
311
|
inherit.each { |related| tmp = tmp.rmerge(extract_styles(id, related, true, theme, context)) }
|
391
312
|
# remove the inheritance key and update the styles
|
392
313
|
value.delete(INHERIT)
|
@@ -427,8 +348,9 @@ private
|
|
427
348
|
#
|
428
349
|
def get_styles(description, theme = nil, state = 'false')
|
429
350
|
state = helpers.to_str(state)
|
430
|
-
|
431
|
-
|
351
|
+
description = description.to_a
|
352
|
+
styles = {}
|
353
|
+
description.each do |sentence|
|
432
354
|
# get the grammar from the sentence
|
433
355
|
id, modifiers, token = grammar(sentence, theme, state)
|
434
356
|
if id
|
@@ -18,11 +18,10 @@ module Archetype::SassExtensions::UI
|
|
18
18
|
# - {String} the unique string
|
19
19
|
#
|
20
20
|
def unique(prefix = '')
|
21
|
-
prefix = helpers.to_str(prefix
|
21
|
+
prefix = helpers.to_str(prefix).gsub(/\A"|"\Z/, '')
|
22
22
|
prefix = '.' if prefix == 'class'
|
23
23
|
prefix = '#' if prefix == 'id'
|
24
|
-
|
25
|
-
return Sass::Script::String.new("#{prefix}archetype-uid-#{suffix}")
|
24
|
+
return Sass::Script::String.new("#{prefix}archetype-uid-#{uid}")
|
26
25
|
end
|
27
26
|
|
28
27
|
#
|
@@ -8,7 +8,7 @@ require 'sass/version'
|
|
8
8
|
#
|
9
9
|
module Archetype::SassExtensions::Version
|
10
10
|
# :stopdoc:
|
11
|
-
COMPARATOR_PATTERN = /(
|
11
|
+
COMPARATOR_PATTERN = /([neglt]+|[><=!]+)/
|
12
12
|
VERSION_PATTERN = /\d+(\.\d+)*(\.[x|\*])?/
|
13
13
|
# :startdoc:
|
14
14
|
|
@@ -21,15 +21,10 @@ module Archetype::SassExtensions::Version
|
|
21
21
|
# - {String|Boolean} if no test or test is just a lookup of a framework, it returns the version of that framework, otherwise it returns the result of the test
|
22
22
|
#
|
23
23
|
def archetype_version(test = nil)
|
24
|
-
test = test.nil? ? 'archetype' : helpers.to_str(test
|
25
|
-
lib =
|
26
|
-
if test.include?('compass')
|
27
|
-
|
28
|
-
elsif test.include?('sass')
|
29
|
-
lib = Sass::VERSION
|
30
|
-
else
|
31
|
-
lib = Archetype::VERSION
|
32
|
-
end
|
24
|
+
test = test.nil? ? 'archetype' : helpers.to_str(test).gsub(/\A"|"\Z/, '').downcase
|
25
|
+
lib = Archetype::VERSION
|
26
|
+
lib = Compass::VERSION if test.include?('compass')
|
27
|
+
lib = Sass::VERSION if test.include?('sass')
|
33
28
|
# strip off any non-official versioning (e.g. pre/alpha/rc)
|
34
29
|
lib = lib.match(VERSION_PATTERN)[0]
|
35
30
|
result = compare_version(lib, test.match(VERSION_PATTERN), test.match(COMPARATOR_PATTERN))
|
@@ -60,7 +55,7 @@ private
|
|
60
55
|
# check for wild cards
|
61
56
|
wild = version.index('x')
|
62
57
|
# check the comparison
|
63
|
-
comparator = (
|
58
|
+
comparator = (comparator || [])[0] || 'eq'
|
64
59
|
eq = comparator =~ /(e|=)/
|
65
60
|
lt = comparator =~ /(l|<)/
|
66
61
|
gt = comparator =~ /(g|>)/
|
data/lib/archetype/version.rb
CHANGED
@@ -10,7 +10,7 @@ module Archetype
|
|
10
10
|
# Method borrowed from Compass. All credit goes to Chris Eppstein and other contributors
|
11
11
|
# https://github.com/chriseppstein/compass/blob/stable/lib/compass/version.rb
|
12
12
|
# \(This method swiped from Haml and then modified, some credit goes to Nathan Weizenbaum\)
|
13
|
-
#
|
13
|
+
#
|
14
14
|
# *Returns*:
|
15
15
|
# - {String} the version of Archetype
|
16
16
|
#
|
@@ -29,25 +29,18 @@ module Archetype
|
|
29
29
|
|
30
30
|
def read_version
|
31
31
|
require 'yaml'
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
@version[:rev] = r
|
43
|
-
end
|
44
|
-
return @version
|
45
|
-
rescue
|
46
|
-
# this is a hack, but I'm not fully understanding how to fix this correctly
|
47
|
-
# see issue #4
|
48
|
-
# if it failed, try again, for now
|
49
|
-
return read_version
|
32
|
+
@version = YAML::load(File.read(scope('VERSION.yml')))
|
33
|
+
@version[:teeny] = @version[:patch]
|
34
|
+
@version[:string] = "#{@version[:major]}.#{@version[:minor]}"
|
35
|
+
@version[:string] << ".#{@version[:patch]}" if @version[:patch]
|
36
|
+
@version[:string] << ".#{@version[:build]}" if @version[:build]
|
37
|
+
@version[:string] << ".#{@version[:state]}" if @version[:state]
|
38
|
+
@version[:string] << ".#{@version[:iteration]}" if @version[:iteration]
|
39
|
+
if !ENV['OFFICIAL'] && r = revision
|
40
|
+
@version[:string] << ".#{r[0..6]}"
|
41
|
+
@version[:rev] = r
|
50
42
|
end
|
43
|
+
@version
|
51
44
|
end
|
52
45
|
|
53
46
|
def revision
|
@@ -38,9 +38,6 @@ $RESET_INIT: false !default;
|
|
38
38
|
// the font-face mixin will likely change in a future version, keep an eye on this
|
39
39
|
// https://github.com/chriseppstein/compass/issues/867
|
40
40
|
@include font-face($CONFIG_GLYPHS_NAME, $CONFIG_GLYPHS_FILES, $CONFIG_GLYPHS_EOT, $CONFIG_GLYPHS_WEIGHT, $CONFIG_GLYPHS_STYLE);
|
41
|
-
// output a second @font-face set with a versioned family name
|
42
|
-
// this will help avoid collisions when multi-app CSS is loaded on a single page
|
43
|
-
@include font-face('#{$CONFIG_GLYPHS_NAME}-#{$CONFIG_GLYPHS_VERSION}', $CONFIG_GLYPHS_FILES, $CONFIG_GLYPHS_EOT, $CONFIG_GLYPHS_WEIGHT, $CONFIG_GLYPHS_STYLE);
|
44
41
|
}
|
45
42
|
|
46
43
|
// auto invoke base reset
|
@@ -40,14 +40,13 @@ $CONTENT_PLACEHOLDER: '\0020' !default;
|
|
40
40
|
$CONFIG_DISABLED_CSS: () !default; // a list of CSS3 features to always disable when using output-style()
|
41
41
|
$CONFIG_GENERATED_TAG_PREFIX: x-archetype !default; // the prefix for the tag name to create when using ie-pseudo method
|
42
42
|
$CONFIG_GENERATED_TAG_CSS: false !default; // styles to apply to the generated tag when using ie-pseudo method (use this as a way to reset styles on these tags)
|
43
|
-
$CONFIG_GENERATED_TAG_INLINE: true !default; // if `true` insert the styles inline on the generated tag, otherwise insert the styles in a unique css rule
|
44
43
|
|
45
44
|
// z-layers
|
46
45
|
$CONFIG_Z_INDEX_BASE: 0 !default; // the default starting layer for z-index calculations
|
47
46
|
$CONFIG_Z_LAYERS_OFFSET: 100 !default; // the offset between z-layers
|
48
47
|
$CONFIG_Z_LAYERS: (default dialog navigation) !default; // the orders for the z-layers
|
49
48
|
|
50
|
-
// compass
|
49
|
+
// compass
|
51
50
|
$COMPASS_RTL_SUPPORT: false !default; // does your Compass version support RTL? set to true if Compass mixins support RTL
|
52
51
|
|
53
52
|
// sprites
|
@@ -59,7 +58,6 @@ $CONFIG_KEYFRAME_LOADERS: archetype-loader !default;
|
|
59
58
|
|
60
59
|
// glyphs
|
61
60
|
$CONFIG_GLYPHS_NAME: FontAwesome !default; // name for the font-face
|
62
|
-
$CONFIG_GLYPHS_VERSION: '0.0.1' !default; // the glyph library version number
|
63
61
|
$CONFIG_GLYPHS_SVG_ID: $CONFIG_GLYPHS_NAME !default;
|
64
62
|
$CONFIG_GLYPHS_BASE_PATH: 'vendor/archetype/fontawesome-webfont' !default; // generic path to all glpyh fonts (sans extensions)
|
65
63
|
$CONFIG_GLYPHS_EOT: '#{$CONFIG_GLYPHS_BASE_PATH}.eot' !default;
|
@@ -306,12 +304,12 @@ $CONFIG_BROWSER_WARN_ON_HACK: false !default;
|
|
306
304
|
$CONFIG_BROWSER_VENDORS_HACK: (
|
307
305
|
(webkit-all, safari webkit chrome),
|
308
306
|
(gecko-all, firefox gecko mozilla),
|
309
|
-
(opera-all, opera)
|
307
|
+
(opera-all, opera)
|
310
308
|
) !default;
|
311
309
|
|
312
310
|
// os targeting
|
313
311
|
$CONFIG_OS_VENDORS_CLASS: (
|
314
|
-
(os-win, windows win winxp win7
|
312
|
+
(os-win, windows win winxp win7),
|
315
313
|
(os-mac, apple mac osx),
|
316
314
|
(os-linux, linux),
|
317
315
|
(os-other, other misc unknown)
|
@@ -323,30 +321,21 @@ $CORE_SAFE_FONTS: (
|
|
323
321
|
(sans-serif, (
|
324
322
|
(default, (
|
325
323
|
(default (sans-serif)),
|
326
|
-
(ko_KR ('Malgun Gothic', default))
|
327
|
-
(zh_TW (SimSun, default)),
|
328
|
-
(zh_CN (SimSun, default))
|
324
|
+
(ko_KR ('Malgun Gothic', default))
|
329
325
|
)),
|
330
326
|
(win, (
|
331
327
|
(default (Arial, sans-serif)),
|
332
328
|
(ja_JP (メイリオ, Meiryo, 'MS Pゴシック', 'MS PGothic', default)),
|
333
|
-
(zh_TW (default, '微軟正黑體', 'Microsoft JhengHei', PMingLiu, '宋体', SimSun)),
|
334
|
-
(zh_CN (default, '华文细黑', 'STHeiti Light', '微软雅黑体', 'Microsoft Yahei', '新宋体', NSimSun, '宋体', SimSun)),
|
335
329
|
(ko_KR nil)
|
336
330
|
)),
|
337
331
|
(mac, (
|
338
332
|
(default (Helvetica, Arial, sans-serif)),
|
339
|
-
(zh_TW (default, '黑體-繁', 'Heiti TC', '儷黑Pro', 'LiHei Pro', PMingLiu, '宋体', SimSun)),
|
340
|
-
(zh_CN (default, '黑体-简', 'Heiti SC', '华文细黑', 'STHeiti Light', '华文黑体', STHeiti)),
|
341
333
|
(ja_JP ('Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ Pro W3', 'MS Pゴシック', 'MS PGothic', default)),
|
342
334
|
(ko_KR nil)
|
343
335
|
)),
|
344
336
|
(linux, (
|
345
337
|
(default (Helvetica, FreeSans, 'Liberation Sans', Helmet, Arial, sans-serif)),
|
346
|
-
(
|
347
|
-
(zh_CN (default, '新宋体', NSimSun, '宋体', SimSun)),
|
348
|
-
(ja_JP nil),
|
349
|
-
(ko_KR nil)
|
338
|
+
(CJK nil)
|
350
339
|
))
|
351
340
|
)),
|
352
341
|
(serif, (
|
@@ -366,9 +355,3 @@ $CORE_SAFE_FONTS: (
|
|
366
355
|
); // note that this declaration isn't a `default`, but rather is enforced everytime. this can be modified (via extending $CONFIG_SAFE_FONTS)
|
367
356
|
$CONFIG_SAFE_FONTS: () !default;
|
368
357
|
$CONFIG_SAFE_FONTS: associative-merge($CORE_SAFE_FONTS, $CONFIG_SAFE_FONTS);
|
369
|
-
|
370
|
-
$archetype-glyph-selector: false !default;
|
371
|
-
$archetype-pseudo-selector: false !default;
|
372
|
-
|
373
|
-
$CORE_GLYPH_SELECTOR_VAR: '$archetype-glyph-selector';
|
374
|
-
$CORE_GLYPH_SELECTOR_VAR: '$archetype-pseudo-selector';
|
@@ -34,83 +34,42 @@
|
|
34
34
|
}
|
35
35
|
|
36
36
|
// proxy for ie-pseudo
|
37
|
-
// @mixin
|
38
|
-
// @param
|
39
|
-
// @param
|
40
|
-
// @param
|
41
|
-
// @content
|
37
|
+
// @mixin ie-pseudo-before
|
38
|
+
// @param $styles {String} the styles to apply to the pseudo-element
|
39
|
+
// @param $content {String} the content to insert into the element (similar to css `content` attribute)
|
40
|
+
// @param $name {String} the name of the element
|
42
41
|
@mixin ie-pseudo-before($styles: false, $content: false, $name: '') {
|
43
|
-
@
|
44
|
-
@include ie-pseudo($styles, $content, before, $name) {
|
45
|
-
@content;
|
46
|
-
}
|
47
|
-
}
|
48
|
-
@else {
|
49
|
-
@include ie-pseudo($styles, $content, before, $name);
|
50
|
-
}
|
42
|
+
@include ie-pseudo($styles, $content, before, $name);
|
51
43
|
}
|
52
44
|
|
53
45
|
// proxy for ie-pseudo
|
54
|
-
// @mixin
|
55
|
-
// @param
|
56
|
-
// @param
|
57
|
-
// @param
|
58
|
-
// @content
|
46
|
+
// @mixin ie-pseudo-after
|
47
|
+
// @param $styles {String} the styles to apply to the pseudo-element
|
48
|
+
// @param $content {String} the content to insert into the element (similar to css `content` attribute)
|
49
|
+
// @param $name {String} the name of the element
|
59
50
|
@mixin ie-pseudo-after($styles: false, $content: false, $name: '') {
|
60
|
-
@
|
61
|
-
@include ie-pseudo($styles, $content, after, $name) {
|
62
|
-
@content;
|
63
|
-
}
|
64
|
-
}
|
65
|
-
@else {
|
66
|
-
@include ie-pseudo($styles, $content, after, $name);
|
67
|
-
}
|
51
|
+
@include ie-pseudo($styles, $content, after, $name);
|
68
52
|
}
|
69
53
|
|
70
|
-
// this creates a one-
|
54
|
+
// this creates a one-type executing expression that inserts an element relative to `this` element.
|
71
55
|
// this allows some level of support for :before/:after in IE6/7
|
72
56
|
// inspired by http://nicolasgallagher.com/better-float-containment-in-ie/
|
73
|
-
// @mixin
|
74
|
-
// @param
|
75
|
-
// @param
|
76
|
-
// @param
|
77
|
-
// @param
|
78
|
-
|
79
|
-
// @content
|
80
|
-
@mixin ie-pseudo($styles: false, $content: false, $placement: before, $name: '', $uid: false) {
|
81
|
-
$archetype-pseudo-selector: false;
|
57
|
+
// @mixin ie-pseudo
|
58
|
+
// @param $styles {String} the styles to apply to the pseudo-element
|
59
|
+
// @param $content {String} the content to insert into the element (similar to css `content` attribute)
|
60
|
+
// @param $placement {String} [before|after] simulate :before or :after behavior
|
61
|
+
// @param $name {String} the name of the element
|
62
|
+
@mixin ie-pseudo($styles: false, $content: false, $placement: before, $name: '') {
|
82
63
|
@if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
|
83
|
-
$uid: if($uid, $uid, unique('ie-pseudo-'));
|
84
|
-
$archetype-pseudo-selector: '& ##{$uid}';
|
85
64
|
$method: if($placement == before, insertBefore, appendChild);
|
86
65
|
$content: if($content and $content != nil, 'this.el.innerHTML="#{-ie-pseudo-content($content)}",', '');
|
87
66
|
@if $CONFIG_GENERATED_TAG_CSS {
|
88
67
|
$styles: if($styles and $styles != nil, #{$CONFIG_GENERATED_TAG_CSS}#{$styles}, $CONFIG_GENERATED_TAG_CSS);
|
89
68
|
}
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
// if we're NOT using inline styles...
|
94
|
-
@if not $CONFIG_GENERATED_TAG_INLINE {
|
95
|
-
// output it on the generated selector
|
96
|
-
#{$archetype-pseudo-selector} {
|
97
|
-
@include to-styles(-style-string-to-list(unquote($styles)));
|
98
|
-
@if archetype-version('Sass >= 3.2') {
|
99
|
-
@content;
|
100
|
-
}
|
101
|
-
}
|
69
|
+
$styles: if($styles and $styles != nil, 'this.el.style.cssText="#{$styles}",', '');
|
70
|
+
@if $name != '' {
|
71
|
+
$name: '-#{$name}';
|
102
72
|
}
|
103
|
-
|
104
|
-
}
|
105
|
-
|
106
|
-
// a hack that allows elements with transparent backgrounds to be focusable in IE
|
107
|
-
// @mixin transparent-focusable
|
108
|
-
// @param $url {String} an optional URL to point to an image (not required)
|
109
|
-
// @param $data {String} an optional data URI for a transparent image (not required)
|
110
|
-
@mixin transparent-focusable($url: url(https://), $data: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7') {
|
111
|
-
$bg: (transparent);
|
112
|
-
background: append($bg, $data);
|
113
|
-
@if $url {
|
114
|
-
@include target-browser(ie lte 7, background, append($bg, $url));
|
73
|
+
*zoom: expression(this.runtimeStyle.zoom="1", this.el=document.createElement("#{$CONFIG_GENERATED_TAG_PREFIX}#{$name}"),#{$content}#{$styles}this.#{$method}(this.el));
|
115
74
|
}
|
116
75
|
}
|