archetype 0.0.1.pre.13 → 1.0.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (253) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +97 -24
  3. data/README.md +11 -5
  4. data/VERSION +1 -0
  5. data/lib/archetype.rb +30 -18
  6. data/lib/archetype/actions/migrate.rb +152 -0
  7. data/lib/archetype/actions/theme.rb +6 -7
  8. data/lib/archetype/executor.rb +21 -7
  9. data/lib/archetype/extensions.rb +57 -0
  10. data/lib/archetype/functions.rb +2 -3
  11. data/lib/archetype/functions/css.rb +70 -0
  12. data/lib/archetype/functions/css/constants.rb +247 -0
  13. data/lib/archetype/functions/css/helpers.rb +265 -0
  14. data/lib/archetype/functions/css/routers.rb +28 -0
  15. data/lib/archetype/functions/css/routers/animation.rb +55 -0
  16. data/lib/archetype/functions/css/routers/background.rb +38 -0
  17. data/lib/archetype/functions/css/routers/border.rb +151 -0
  18. data/lib/archetype/functions/css/routers/list.rb +63 -0
  19. data/lib/archetype/functions/css/routers/margin_padding.rb +40 -0
  20. data/lib/archetype/functions/css/routers/outline.rb +56 -0
  21. data/lib/archetype/functions/css/routers/overflow.rb +11 -0
  22. data/lib/archetype/functions/css/routers/target.rb +38 -0
  23. data/lib/archetype/functions/css/routers/transition.rb +48 -0
  24. data/lib/archetype/functions/css/shorthands.rb +43 -0
  25. data/lib/archetype/functions/css/shorthands/animation.rb +18 -0
  26. data/lib/archetype/functions/css/shorthands/background.rb +68 -0
  27. data/lib/archetype/functions/css/shorthands/border.rb +102 -0
  28. data/lib/archetype/functions/hash.rb +3 -149
  29. data/lib/archetype/functions/hash/extend.rb +74 -0
  30. data/lib/archetype/functions/hash/shim.rb +48 -0
  31. data/lib/archetype/functions/helpers.rb +231 -22
  32. data/lib/archetype/functions/styleguide_memoizer.rb +18 -1
  33. data/lib/archetype/sass_extensions.rb +1 -3
  34. data/lib/archetype/sass_extensions/functions.rb +15 -1
  35. data/lib/archetype/sass_extensions/functions/environment.rb +152 -1
  36. data/lib/archetype/sass_extensions/functions/lists.rb +95 -45
  37. data/lib/archetype/sass_extensions/functions/locale.rb +107 -28
  38. data/lib/archetype/sass_extensions/functions/numbers.rb +118 -4
  39. data/lib/archetype/sass_extensions/functions/strings.rb +53 -0
  40. data/lib/archetype/sass_extensions/functions/styleguide.rb +43 -375
  41. data/lib/archetype/sass_extensions/functions/styleguide/components.rb +25 -0
  42. data/lib/archetype/sass_extensions/functions/styleguide/constants.rb +27 -0
  43. data/lib/archetype/sass_extensions/functions/styleguide/grammar.rb +80 -0
  44. data/lib/archetype/sass_extensions/functions/styleguide/helpers.rb +36 -0
  45. data/lib/archetype/sass_extensions/functions/styleguide/resolve.rb +159 -0
  46. data/lib/archetype/sass_extensions/functions/styleguide/styles.rb +146 -0
  47. data/lib/archetype/sass_extensions/functions/styleguide/themes.rb +40 -0
  48. data/lib/archetype/sass_extensions/functions/ui.rb +7 -57
  49. data/lib/archetype/sass_extensions/functions/ui/glyphs.rb +118 -0
  50. data/lib/archetype/sass_extensions/functions/ui/scopes.rb +96 -0
  51. data/lib/archetype/sass_extensions/functions/util.rb +14 -0
  52. data/lib/archetype/sass_extensions/functions/util/debug.rb +22 -0
  53. data/lib/archetype/sass_extensions/functions/util/hacks.rb +44 -0
  54. data/lib/archetype/sass_extensions/functions/util/images.rb +132 -0
  55. data/lib/archetype/sass_extensions/functions/util/misc.rb +220 -0
  56. data/lib/archetype/sass_extensions/functions/util/spacing.rb +83 -0
  57. data/lib/archetype/sass_extensions/functions/version.rb +12 -17
  58. data/lib/archetype/version.rb +1 -1
  59. data/stylesheets/archetype/_config.scss +1 -389
  60. data/stylesheets/archetype/_core.scss +15 -0
  61. data/stylesheets/archetype/_hacks.scss +4 -120
  62. data/stylesheets/archetype/_init.scss +4 -22
  63. data/stylesheets/archetype/_required.scss +3 -0
  64. data/stylesheets/archetype/_reset.scss +3 -0
  65. data/stylesheets/archetype/_styleguide.scss +2 -6
  66. data/stylesheets/archetype/_ui.scss +2 -358
  67. data/stylesheets/archetype/_util.scss +3 -10
  68. data/stylesheets/archetype/config/_core.scss +14 -0
  69. data/stylesheets/archetype/config/_environment.scss +19 -0
  70. data/stylesheets/archetype/config/_formatting.scss +63 -0
  71. data/stylesheets/archetype/config/_glyphs.scss +252 -0
  72. data/stylesheets/archetype/config/_resets.scss +7 -0
  73. data/stylesheets/archetype/config/_resolution.scss +3 -0
  74. data/stylesheets/archetype/config/_spacing.scss +5 -0
  75. data/stylesheets/archetype/config/_targeting.scss +18 -0
  76. data/stylesheets/archetype/config/_theme.scss +3 -0
  77. data/stylesheets/archetype/config/_typography.scss +56 -0
  78. data/stylesheets/archetype/config/_units.scss +2 -0
  79. data/stylesheets/archetype/config/_vars.scss +10 -0
  80. data/stylesheets/archetype/hacks/_core.scss +4 -0
  81. data/stylesheets/archetype/hacks/_hacks.scss +160 -0
  82. data/stylesheets/archetype/hacks/_init.scss +2 -0
  83. data/stylesheets/archetype/styleguide/_core.scss +4 -0
  84. data/stylesheets/archetype/styleguide/_init.scss +1 -0
  85. data/stylesheets/archetype/styleguide/_styleguide.scss +41 -18
  86. data/stylesheets/archetype/ui/_accessibility.scss +41 -0
  87. data/stylesheets/archetype/ui/_breakpoints.scss +19 -0
  88. data/stylesheets/archetype/ui/_core.scss +10 -0
  89. data/stylesheets/archetype/ui/_elements.scss +98 -0
  90. data/stylesheets/archetype/ui/_glyphs.scss +244 -0
  91. data/stylesheets/archetype/ui/_init.scss +5 -0
  92. data/stylesheets/archetype/ui/_layout.scss +37 -0
  93. data/stylesheets/archetype/ui/_locale.scss +12 -0
  94. data/stylesheets/archetype/ui/_scopes.scss +42 -0
  95. data/stylesheets/archetype/util/_core.scss +8 -0
  96. data/stylesheets/archetype/util/_debug.scss +9 -21
  97. data/stylesheets/archetype/util/_init.scss +1 -0
  98. data/stylesheets/archetype/util/_misc.scss +21 -86
  99. data/stylesheets/archetype/util/_spacing.scss +9 -40
  100. data/stylesheets/archetype/util/_styles.scss +189 -178
  101. data/stylesheets/archetype/util/_targeting.scss +51 -68
  102. data/templates/example/manifest.rb +2 -2
  103. data/templates/example/screen.scss +0 -1
  104. data/templates/project/manifest.rb +3 -8
  105. metadata +93 -263
  106. data/bin/archetype +0 -3
  107. data/lib/archetype/sass_extensions/monkey_patches.rb +0 -3
  108. data/lib/archetype/sass_extensions/monkey_patches/handle_include_loop.rb +0 -13
  109. data/stylesheets/archetype/_base.scss +0 -54
  110. data/stylesheets/archetype/_grid.scss +0 -3
  111. data/stylesheets/archetype/base/_h5bp.scss +0 -307
  112. data/stylesheets/archetype/base/_hybrid.scss +0 -25
  113. data/stylesheets/archetype/base/_normalize.scss +0 -634
  114. data/stylesheets/archetype/base/_reset.scss +0 -72
  115. data/stylesheets/archetype/grid/_config.scss +0 -14
  116. data/stylesheets/archetype/grid/_grid.scss +0 -391
  117. data/stylesheets/archetype/styleguide/_components.scss +0 -25
  118. data/stylesheets/archetype/styleguide/_helpers.scss +0 -215
  119. data/stylesheets/archetype/styleguide/_primitives.scss +0 -10
  120. data/stylesheets/archetype/styleguide/components/_alerts.scss +0 -59
  121. data/stylesheets/archetype/styleguide/components/_annotations.scss +0 -27
  122. data/stylesheets/archetype/styleguide/components/_bristol.scss +0 -15
  123. data/stylesheets/archetype/styleguide/components/_button_groups.scss +0 -47
  124. data/stylesheets/archetype/styleguide/components/_button_toolbars.scss +0 -17
  125. data/stylesheets/archetype/styleguide/components/_buttons.scss +0 -339
  126. data/stylesheets/archetype/styleguide/components/_canvas.scss +0 -15
  127. data/stylesheets/archetype/styleguide/components/_carets.scss +0 -336
  128. data/stylesheets/archetype/styleguide/components/_closes.scss +0 -63
  129. data/stylesheets/archetype/styleguide/components/_container.scss +0 -27
  130. data/stylesheets/archetype/styleguide/components/_copy.scss +0 -85
  131. data/stylesheets/archetype/styleguide/components/_flyouts.scss +0 -52
  132. data/stylesheets/archetype/styleguide/components/_headings.scss +0 -33
  133. data/stylesheets/archetype/styleguide/components/_headlines.scss +0 -64
  134. data/stylesheets/archetype/styleguide/components/_hovercards.scss +0 -27
  135. data/stylesheets/archetype/styleguide/components/_icons.scss +0 -17
  136. data/stylesheets/archetype/styleguide/components/_identities.scss +0 -34
  137. data/stylesheets/archetype/styleguide/components/_links.scss +0 -68
  138. data/stylesheets/archetype/styleguide/components/_loaders.scss +0 -154
  139. data/stylesheets/archetype/styleguide/components/_menu_items.scss +0 -31
  140. data/stylesheets/archetype/styleguide/components/_module.scss +0 -15
  141. data/stylesheets/archetype/styleguide/components/_pullquotes.scss +0 -29
  142. data/stylesheets/archetype/styleguide/components/_punchcut.scss +0 -18
  143. data/stylesheets/archetype/styleguide/components/_tooltips.scss +0 -28
  144. data/stylesheets/archetype/styleguide/primitives/_animations.scss +0 -17
  145. data/stylesheets/archetype/styleguide/primitives/_dimensions.scss +0 -50
  146. data/stylesheets/archetype/styleguide/primitives/_glyphs.scss +0 -11
  147. data/stylesheets/archetype/styleguide/primitives/_misc.scss +0 -8
  148. data/stylesheets/archetype/styleguide/primitives/_palettes.scss +0 -94
  149. data/stylesheets/archetype/styleguide/primitives/_shadows.scss +0 -23
  150. data/stylesheets/archetype/styleguide/primitives/_sprites.scss +0 -46
  151. data/stylesheets/archetype/styleguide/primitives/_textures.scss +0 -10
  152. data/stylesheets/archetype/styleguide/primitives/_typography.scss +0 -56
  153. data/stylesheets/archetype/util/_lists.scss +0 -57
  154. data/stylesheets/archetype/util/_rtl.scss +0 -279
  155. data/stylesheets/archetype/util/_units.scss +0 -18
  156. data/templates/project/screen.scss +0 -1
  157. data/templates/project/vendor/archetype/animations/loaders/large/large.png +0 -0
  158. data/templates/project/vendor/archetype/animations/loaders/large/large_dark.png +0 -0
  159. data/templates/project/vendor/archetype/animations/loaders/large/large_dark_static.png +0 -0
  160. data/templates/project/vendor/archetype/animations/loaders/large/large_static.png +0 -0
  161. data/templates/project/vendor/archetype/animations/loaders/medium/medium.png +0 -0
  162. data/templates/project/vendor/archetype/animations/loaders/medium/medium_dark.png +0 -0
  163. data/templates/project/vendor/archetype/animations/loaders/medium/medium_dark_static.png +0 -0
  164. data/templates/project/vendor/archetype/animations/loaders/medium/medium_static.png +0 -0
  165. data/templates/project/vendor/archetype/animations/loaders/small/small.png +0 -0
  166. data/templates/project/vendor/archetype/animations/loaders/small/small_dark.png +0 -0
  167. data/templates/project/vendor/archetype/animations/loaders/small/small_dark_static.png +0 -0
  168. data/templates/project/vendor/archetype/animations/loaders/small/small_static.png +0 -0
  169. data/templates/project/vendor/archetype/fontawesome-webfont.eot +0 -0
  170. data/templates/project/vendor/archetype/fontawesome-webfont.svg +0 -255
  171. data/templates/project/vendor/archetype/fontawesome-webfont.ttf +0 -0
  172. data/templates/project/vendor/archetype/fontawesome-webfont.woff +0 -0
  173. data/test/fixtures/stylesheets/archetype/assets/fonts/fontawesome-webfont.eot +0 -0
  174. data/test/fixtures/stylesheets/archetype/assets/fonts/fontawesome-webfont.svg +0 -255
  175. data/test/fixtures/stylesheets/archetype/assets/fonts/fontawesome-webfont.ttf +0 -0
  176. data/test/fixtures/stylesheets/archetype/assets/fonts/fontawesome-webfont.woff +0 -0
  177. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders-s7889ccc8c1.png +0 -0
  178. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/large/large.png +0 -0
  179. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/large/large_dark.png +0 -0
  180. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/large/large_dark_static.png +0 -0
  181. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/large/large_static.png +0 -0
  182. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/medium/medium.png +0 -0
  183. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/medium/medium_dark.png +0 -0
  184. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/medium/medium_dark_static.png +0 -0
  185. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/medium/medium_static.png +0 -0
  186. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/small/small.png +0 -0
  187. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/small/small_dark.png +0 -0
  188. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/small/small_dark_static.png +0 -0
  189. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/small/small_static.png +0 -0
  190. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/sprites/hovercard_tip.png +0 -0
  191. data/test/fixtures/stylesheets/archetype/config.rb +0 -21
  192. data/test/fixtures/stylesheets/archetype/source/b.scss +0 -9
  193. data/test/fixtures/stylesheets/archetype/source/base.scss +0 -3
  194. data/test/fixtures/stylesheets/archetype/source/hacks/ie_pseudo.scss +0 -13
  195. data/test/fixtures/stylesheets/archetype/source/hacks/transparent_focusable.scss +0 -5
  196. data/test/fixtures/stylesheets/archetype/source/locale.scss +0 -43
  197. data/test/fixtures/stylesheets/archetype/source/styleguide/alerts.scss +0 -21
  198. data/test/fixtures/stylesheets/archetype/source/styleguide/buttons.scss +0 -18
  199. data/test/fixtures/stylesheets/archetype/source/styleguide/drop.scss +0 -101
  200. data/test/fixtures/stylesheets/archetype/source/styleguide/extend.scss +0 -24
  201. data/test/fixtures/stylesheets/archetype/source/styleguide/fallback_styles.scss +0 -23
  202. data/test/fixtures/stylesheets/archetype/source/styleguide/invalid_structures.scss +0 -85
  203. data/test/fixtures/stylesheets/archetype/source/styleguide/multi_value.scss +0 -18
  204. data/test/fixtures/stylesheets/archetype/source/styleguide/nested_styleguides.scss +0 -40
  205. data/test/fixtures/stylesheets/archetype/source/styleguide/selective_state.scss +0 -22
  206. data/test/fixtures/stylesheets/archetype/source/ui/glyph_icon.scss +0 -35
  207. data/test/fixtures/stylesheets/archetype/source/ui/hide_element.scss +0 -5
  208. data/test/fixtures/stylesheets/archetype/source/ui/stroke.scss +0 -13
  209. data/test/fixtures/stylesheets/archetype/source/ui/triangle.scss +0 -13
  210. data/test/fixtures/stylesheets/archetype/source/utilities/associative.scss +0 -24
  211. data/test/fixtures/stylesheets/archetype/source/utilities/custom_output_styler.scss +0 -22
  212. data/test/fixtures/stylesheets/archetype/source/utilities/if-set.scss +0 -16
  213. data/test/fixtures/stylesheets/archetype/source/utilities/spacing/horizontal-spacing.scss +0 -27
  214. data/test/fixtures/stylesheets/archetype/source/utilities/spacing/vertical-spacing.scss +0 -27
  215. data/test/fixtures/stylesheets/archetype/source/utilities/styles/filter.scss +0 -9
  216. data/test/fixtures/stylesheets/archetype/source/utilities/styles/font-family.scss +0 -9
  217. data/test/fixtures/stylesheets/archetype/source/utilities/styles/z-index.scss +0 -18
  218. data/test/fixtures/stylesheets/archetype/source/utilities/targeting/target-browser.scss +0 -77
  219. data/test/fixtures/stylesheets/archetype/source/utilities/targeting/target-os.scss +0 -42
  220. data/test/fixtures/stylesheets/archetype/tmp/b.css +0 -14
  221. data/test/fixtures/stylesheets/archetype/tmp/base.css +0 -349
  222. data/test/fixtures/stylesheets/archetype/tmp/hacks/ie_pseudo.css +0 -11
  223. data/test/fixtures/stylesheets/archetype/tmp/hacks/transparent_focusable.css +0 -4
  224. data/test/fixtures/stylesheets/archetype/tmp/locale.css +0 -23
  225. data/test/fixtures/stylesheets/archetype/tmp/styleguide/alerts.css +0 -711
  226. data/test/fixtures/stylesheets/archetype/tmp/styleguide/buttons.css +0 -2119
  227. data/test/fixtures/stylesheets/archetype/tmp/styleguide/drop.css +0 -63
  228. data/test/fixtures/stylesheets/archetype/tmp/styleguide/extend.css +0 -11
  229. data/test/fixtures/stylesheets/archetype/tmp/styleguide/fallback_styles.css +0 -10
  230. data/test/fixtures/stylesheets/archetype/tmp/styleguide/invalid_structures.css +0 -21
  231. data/test/fixtures/stylesheets/archetype/tmp/styleguide/multi_value.css +0 -13
  232. data/test/fixtures/stylesheets/archetype/tmp/styleguide/nested_styleguides.css +0 -28
  233. data/test/fixtures/stylesheets/archetype/tmp/styleguide/selective_state.css +0 -177
  234. data/test/fixtures/stylesheets/archetype/tmp/ui/glyph_icon.css +0 -127
  235. data/test/fixtures/stylesheets/archetype/tmp/ui/hide_element.css +0 -8
  236. data/test/fixtures/stylesheets/archetype/tmp/ui/stroke.css +0 -17
  237. data/test/fixtures/stylesheets/archetype/tmp/ui/triangle.css +0 -35
  238. data/test/fixtures/stylesheets/archetype/tmp/utilities/associative.css +0 -9
  239. data/test/fixtures/stylesheets/archetype/tmp/utilities/custom_output_styler.css +0 -8
  240. data/test/fixtures/stylesheets/archetype/tmp/utilities/if-set.css +0 -9
  241. data/test/fixtures/stylesheets/archetype/tmp/utilities/spacing/horizontal-spacing.css +0 -29
  242. data/test/fixtures/stylesheets/archetype/tmp/utilities/spacing/vertical-spacing.css +0 -29
  243. data/test/fixtures/stylesheets/archetype/tmp/utilities/styles/filter.css +0 -11
  244. data/test/fixtures/stylesheets/archetype/tmp/utilities/styles/font-family.css +0 -16
  245. data/test/fixtures/stylesheets/archetype/tmp/utilities/styles/z-index.css +0 -15
  246. data/test/fixtures/stylesheets/archetype/tmp/utilities/targeting/target-browser.css +0 -105
  247. data/test/fixtures/stylesheets/archetype/tmp/utilities/targeting/target-os.css +0 -55
  248. data/test/helpers/diff.rb +0 -49
  249. data/test/helpers/io.rb +0 -36
  250. data/test/helpers/test_case.rb +0 -62
  251. data/test/integrations/archetype_test.rb +0 -126
  252. data/test/test_helper.rb +0 -26
  253. data/test/units/sass_extensions_test.rb +0 -200
@@ -0,0 +1,220 @@
1
+ require 'thread'
2
+
3
+ module Archetype::SassExtensions::Util::Misc
4
+
5
+ #
6
+ # simple test for `null` or `nil` (deprecated) value. this is here for back-compat support with old `nil` syntax
7
+ #
8
+ # *Parameters*:
9
+ # - <tt>$value</tt> {*} the value to test
10
+ # *Returns*:
11
+ # - {Boolean} whether or not the value is null
12
+ #
13
+ def is_null(value)
14
+ return bool(helpers.is_null(value))
15
+ end
16
+
17
+ #
18
+ # converts individual arguments into an archetype meta object that can be stored on a key in a map
19
+ #
20
+ # *Parameters*:
21
+ # - <tt>args...</tt> {*} the values to put into the meta object
22
+ # *Returns*:
23
+ # - {Map} the meta object
24
+ #
25
+ def multiple_values(*args)
26
+ return helpers.array_to_meta(args)
27
+ end
28
+
29
+ #
30
+ # decorates a map so that the actual value can be resolved at runtime with the current locale
31
+ #
32
+ # *Parameters*:
33
+ # - <tt>$map</tt> {*} the map to decorate
34
+ # *Returns*:
35
+ # - {Map} the decorated meta object
36
+ #
37
+ def runtime_locale_value(map)
38
+ return helpers.meta_decorate(map, :runtime_locales)
39
+ end
40
+
41
+ #
42
+ # given a map with meta data, extract the message and substitute any key-value pairs (@see str-substitute)
43
+ #
44
+ # *Parameters*:
45
+ # - <tt>$map</tt> {Map} the map to observe
46
+ # - <tt>$subsitutes</tt> {Map} the map of substitutes
47
+ # *Returns*:
48
+ # - {String} the meta message
49
+ #
50
+ def meta_message(map, subsitutes = nil)
51
+ message = null
52
+ meta = map_get_meta(map)
53
+ message = str_substitute(map_get(meta, identifier(helpers::META[:message])), subsitutes) if not meta.value.nil?
54
+ return message
55
+ end
56
+
57
+ #
58
+ # check to see if a map key has multiple values
59
+ #
60
+ # *Parameters*:
61
+ # - <tt>$map</tt> {Map} the map to observe
62
+ # *Returns*:
63
+ # - {Boolean} whether or not the map key represents multiple values
64
+ #
65
+ def has_multiple_values(map)
66
+ meta = map_get_meta(map)
67
+ return map_has_key(meta, identifier(helpers::META[:has_multiples])) if not meta.value.nil?
68
+ return bool(false)
69
+ end
70
+
71
+ #
72
+ # check to see if a value is decorated with runtime locale values
73
+ #
74
+ # *Parameters*:
75
+ # - <tt>$value</tt> {*} the value to observe
76
+ # *Returns*:
77
+ # - {Boolean} whether or not the map is decorated with runtime locale values
78
+ #
79
+ def has_runtime_locale_value(value)
80
+ meta = map_get_meta(value)
81
+ return map_has_key(meta, identifier(helpers::META[:decorators][:runtime_locales])) if not meta.value.nil?
82
+ return bool(false)
83
+ end
84
+
85
+ #
86
+ # retrieve the archetype meta data from a map
87
+ #
88
+ # *Parameters*:
89
+ # - <tt>$map</tt> {Map} the map to observe
90
+ # *Returns*:
91
+ # - {Map} the data contained within the meta key
92
+ #
93
+ def map_get_meta(map)
94
+ if map.is_a?(Sass::Script::Value::Map) and map_has_key(map, identifier(helpers::META[:meta])).value
95
+ return map_get(map, identifier(helpers::META[:meta]))
96
+ end
97
+ return null
98
+ end
99
+
100
+ #
101
+ # given a map of styles, get the derived style of a given property
102
+ #
103
+ # *Parameters*:
104
+ # - <tt>$styles</tt> {Map} the map of styles
105
+ # - <tt>$properties</tt> {String|List} the properties to extract the derived styles for
106
+ # - <tt>$format</tt> {String} the format to return the results in [auto|map|list]
107
+ # - <tt>$strict</tt> {Boolean} if true, will only return an exact match, and not try to extrapolate the value
108
+ # *Returns*:
109
+ # - {List|Map|*} either a list/map of the values or the individual value itself
110
+ #
111
+ def derived_style(styles, properties = [], format = 'auto', strict = false)
112
+ strict = strict.value if strict.respond_to?(:value)
113
+ return Archetype::Functions::CSS.get_derived_styles(helpers.data_to_hash(styles), properties, helpers.to_str(format).to_sym, strict)
114
+ end
115
+
116
+ #
117
+ # helper function to prevent routines from executing multiple times
118
+ #
119
+ # *Parameters*:
120
+ # - <tt>$name</tt> {String} identifier to check/register
121
+ # *Returns*:
122
+ # - {Boolean} `true` if the first time invoked, `false` otherwise
123
+ #
124
+ def do_once(name)
125
+ registry = do_once_registry
126
+ # if it's already in the registry, just return `false`
127
+ return bool(false) if do_once_registry.include?(name)
128
+ # update the registry with the identifier
129
+ registry = list(registry.dup.push(name), :comma)
130
+ environment.global_env.set_var('REGISTRY_DO_ONCE', registry)
131
+ # return true
132
+ return bool(true)
133
+ end
134
+
135
+ #
136
+ # generate a tag name with a prefix
137
+ #
138
+ # *Parameters*:
139
+ # - <tt>$tag</tt> {String} the tag to prefix
140
+ # - <tt>$prefix</tt> {String} the prefix to prepend to the tag
141
+ # *Returns*:
142
+ # - {String} the prefix joined with the tag
143
+ #
144
+ def prefixed_tag(tag, prefix = environment.var('CONFIG_GENERATED_TAG_PREFIX'))
145
+ tag = tag.value
146
+ tag = "-#{tag}" unless tag.empty?
147
+ prefix = prefix.nil? ? 'x-archetype' : prefix.value
148
+ return identifier("#{prefix}#{tag}")
149
+ end
150
+ Sass::Script::Functions.declare :prefixed_tag, [:tag]
151
+ Sass::Script::Functions.declare :prefixed_tag, [:tag, :prefix]
152
+
153
+ #
154
+ # generate a unique token
155
+ #
156
+ # *Parameters*:
157
+ # - <tt>$prefix</tt> {String} a string to prefix the UID with, `class` and `id` will generate a unique selector
158
+ # *Returns*:
159
+ # - {String} the unique string
160
+ #
161
+ def unique(prefix = '')
162
+ prefix = helpers.to_str(prefix, ' ', :quotes)
163
+ prefix = '.' if prefix == 'class'
164
+ prefix = '#' if prefix == 'id'
165
+ suffix = (defined?(ArchetypeTestHelpers) || defined?(Test::Unit)) ? "RANDOM_UID" : "#{Time.now.to_i}-#{rand(36**8).to_s(36)}-#{uid}"
166
+ return identifier("#{prefix}archetype-uid-#{suffix}")
167
+ end
168
+
169
+ #
170
+ # tokenize a given value
171
+ #
172
+ # *Parameters*:
173
+ # - <tt>$item</tt> {*} the item to generate a unique hash from
174
+ # *Returns*:
175
+ # - {String} a token of the string
176
+ #
177
+ def tokenize(item)
178
+ prefix = helpers.to_str(environment.var('CONFIG_GENERATED_TAG_PREFIX') || Archetype.name) + '-'
179
+ token = prefix + item.hash.to_s
180
+ return identifier(token)
181
+ end
182
+ Sass::Script::Functions.declare :tokenize, [:item]
183
+
184
+ #
185
+ # extracts the value associated with the current locale from the given decorated object
186
+ #
187
+ # *Parameters*:
188
+ # - <tt>$item</tt> {*} the item check against
189
+ # *Returns*:
190
+ # - {*} the value given the current locale
191
+ #
192
+ def get_runtime_locale_value(item)
193
+ item = helpers.hash_to_map(item) if item.is_a?(Hash)
194
+ return item unless has_runtime_locale_value(item).value
195
+ item = map_get(item, identifier('original')).to_h
196
+ best_match = null
197
+ item.each do |lang, value|
198
+ if lang.value == 'default' or locale(lang).value
199
+ best_match = value
200
+ end
201
+ end
202
+ return best_match
203
+ end
204
+
205
+ private
206
+
207
+ @@archetype_ui_mutex = Mutex.new
208
+
209
+ def uid
210
+ @@archetype_ui_mutex.synchronize do
211
+ @@uid ||= 0
212
+ @@uid += 1
213
+ end
214
+ end
215
+
216
+ def do_once_registry
217
+ (environment.var('REGISTRY_DO_ONCE') || []).to_a
218
+ end
219
+
220
+ end
@@ -0,0 +1,83 @@
1
+ module Archetype::SassExtensions::Util::Spacing
2
+
3
+ #
4
+ # abstract factor of measurement
5
+ #
6
+ # *Parameters*:
7
+ # - <tt>$number</tt> {Number} unit of measurement
8
+ # - <tt>$abuse</tt> {Boolean} if `false`, $number cannot be a fraction
9
+ # - <tt>$direction</tt> {Boolean} [horizontal|vertical] spacing
10
+ # *Returns*:
11
+ # - {Number} normalized number of measurement
12
+ #
13
+ def _archetype_integerize(number, abuse = bool(false))
14
+ unless unitless(number)
15
+ helpers.warn("[#{Archetype.name}:units] #{number} is not unitless, stripping units")
16
+ number = strip_units(number)
17
+ end
18
+ config = (environment.var('CONFIG_UNIT_FORCE_INT') || bool(false)).value
19
+ if config == 'strict' or !abuse.value
20
+ return ceil(number)
21
+ end
22
+ return number
23
+ end
24
+ Sass::Script::Functions.declare :_archetype_integerize, [:number]
25
+ Sass::Script::Functions.declare :_archetype_integerize, [:number, :abuse]
26
+
27
+ #
28
+ # abstract spacing calculations
29
+ #
30
+ # *Parameters*:
31
+ # - <tt>$unit</tt> {Number} unit of measurement
32
+ # - <tt>$direction</tt> {String} [horizontal|vertical] spacing
33
+ # - <tt>$abuse</tt> {Boolean} @see _archetype_integerize
34
+ # *Returns*:
35
+ # - {Number} the calculated spacing
36
+ #
37
+ def _spacing(unit = null, direction = identifier(horizontal), abuse = bool(false))
38
+ return null if is_null(unit).value
39
+ unit = _archetype_integerize(unit, abuse)
40
+ direction = helpers.to_str(direction) == 'vertical' ? 'VERTICAL' : 'HORIZONTAL'
41
+ config = "CONFIG_#{direction}_SPACING"
42
+ spacing = environment.var(config)
43
+ if spacing.nil?
44
+ spacing = number(1, 'px')
45
+ helpers.warn("[#{Archetype.name}:spacing] `#{config}` has not been set")
46
+ end
47
+ return unit.times(spacing)
48
+ end
49
+ Sass::Script::Functions.declare :_spacing, [:unit]
50
+ Sass::Script::Functions.declare :_spacing, [:unit, :direction]
51
+ Sass::Script::Functions.declare :_spacing, [:unit, :abuse]
52
+ Sass::Script::Functions.declare :_spacing, [:unit, :direction, :abuse]
53
+
54
+ #
55
+ # horizontal spacing calculations
56
+ #
57
+ # *Parameters*:
58
+ # - <tt>$unit</tt> {Number} unit of measurement
59
+ # - <tt>$abuse</tt> {Boolean} @see _archetype_integerize
60
+ # *Returns*:
61
+ # - {Number} the calculated horizontal spacing
62
+ #
63
+ def horizontal_spacing(unit, abuse = bool(false))
64
+ return _spacing(unit, null, abuse)
65
+ end
66
+ Sass::Script::Functions.declare :horizontal_spacing, [:unit]
67
+ Sass::Script::Functions.declare :horizontal_spacing, [:unit, :abuse]
68
+
69
+ #
70
+ # vertical spacing calculations
71
+ #
72
+ # *Parameters*:
73
+ # - <tt>$unit</tt> {Number} unit of measurement
74
+ # - <tt>$abuse</tt> {Boolean} @see _archetype_integerize
75
+ # *Returns*:
76
+ # - {Number} the calculated vertical spacing
77
+ #
78
+ def vertical_spacing(unit, abuse = bool(false))
79
+ return _spacing(unit, 'vertical', abuse)
80
+ end
81
+ Sass::Script::Functions.declare :vertical_spacing, [:unit]
82
+ Sass::Script::Functions.declare :vertical_spacing, [:unit, :abuse]
83
+ end
@@ -1,7 +1,6 @@
1
- require 'archetype/functions/helpers'
2
- require 'archetype/version'
3
- require 'compass/version'
4
- require 'sass/version'
1
+ %w(archetype compass sass).each do |framework|
2
+ require "#{framework}/version"
3
+ end
5
4
 
6
5
  #
7
6
  # This module provides an interface for testing against various framework version
@@ -21,27 +20,23 @@ module Archetype::SassExtensions::Version
21
20
  # - {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
21
  #
23
22
  def archetype_version(test = nil)
24
- test = test.nil? ? 'archetype' : helpers.to_str(test, ' ', :quotes).downcase
25
- lib = ''
26
- if test.include?('compass')
27
- lib = Compass::VERSION
28
- elsif test.include?('sass')
29
- lib = Sass::VERSION
23
+ test = test.nil? ? Archetype.name : helpers.to_str(test, ' ', :quotes).downcase
24
+ lib = case test
25
+ when /compass/
26
+ Compass::VERSION
27
+ when /sass/
28
+ Sass::VERSION
30
29
  else
31
- lib = Archetype::VERSION
30
+ Archetype::VERSION
32
31
  end
33
32
  # strip off any non-official versioning (e.g. pre/alpha/rc)
34
33
  lib = lib.match(VERSION_PATTERN)[0]
35
34
  result = compare_version(lib, test.match(VERSION_PATTERN), test.match(COMPARATOR_PATTERN))
36
- return Sass::Script::String.new(lib) if result.nil?
35
+ return identifier(lib) if result.nil?
37
36
  return Sass::Script::Bool.new(result)
38
37
  end
39
38
 
40
39
  private
41
- def helpers
42
- @helpers ||= Archetype::Functions::Helpers
43
- end
44
-
45
40
  #
46
41
  # compare a version of a framework
47
42
  #
@@ -82,7 +77,7 @@ private
82
77
  # *Parameters*:
83
78
  # - <tt>$version</tt> {String} the version string
84
79
  # *Returns*:
85
- # - {Number} a weighted number representing the the version
80
+ # - {Number} a weighted number representing the version
86
81
  #
87
82
  def version_value(version)
88
83
  sum = 0
@@ -1,3 +1,3 @@
1
1
  module Archetype
2
- VERSION = '0.0.1.pre.13'
2
+ VERSION = File.read(File.join(File.dirname(__FILE__), "..", "..", "VERSION")).strip
3
3
  end
@@ -1,389 +1 @@
1
- // environment
2
- $CONFIG_DEBUG_ENVS: (dev development); // environments to allow debug in
3
- $CONFIG_DEBUG: (index($CONFIG_DEBUG_ENVS, archetype-env()) != false) !default; // global debugging mode (enabled by default in $CONFIG_DEBUG_ENVS)
4
-
5
- // theme
6
- $CONFIG_THEME: archetype !default; // the theme name
7
-
8
- // units
9
- $CONFIG_UNIT_FORCE_INT: true !default; // force units to be whole integers. if set to strict, $abuse flags won't work [false|true|strict]
10
-
11
- // spacing
12
- $CONFIG_SPACING: 5px !default; // spacing factor
13
- $CONFIG_HORIZONTAL_SPACING: $CONFIG_SPACING !default; // horizontal spacing
14
- $CONFIG_VERTICAL_SPACING: $CONFIG_SPACING !default; // veritcal spacing
15
- $CONFIG_SPACING_METHOD: padding !default; // method for providing spacing [padding|margin]
16
-
17
- // resets
18
- $CONFIG_RESET_METHOD: hybrid !default; // reset method [reset|normalize|hybrid]
19
- $CONFIG_RESET_AUTO: false !default; // if true, importing `archetype` will invoke the reset
20
- $CONFIG_RESET_EXCLUDES: () !default; // list of things to exclude from the reset
21
-
22
- // states used when printing out styles
23
- $CONFIG_STATE_PREFIX: '' !default; // prefix state classnames @see to-style()
24
- $CONFIG_STATE_NO_PREFIX: () !default; // states to never apply prefix to
25
- // a mapping for state names to selectors
26
- $CORE_STATE_MAPPINGS: (
27
- 'hover' '&.#{$CONFIG_STATE_PREFIX}hover, &:hover, &.#{$CONFIG_STATE_PREFIX}focus, &:focus',
28
- 'hover-only' '&.#{$CONFIG_STATE_PREFIX}hover, &:hover',
29
- 'focus' '&.#{$CONFIG_STATE_PREFIX}focus, &:focus',
30
- 'active' '&.#{$CONFIG_STATE_PREFIX}active, &:active',
31
- 'visited' '&.#{$CONFIG_STATE_PREFIX}visited, &:visited',
32
- 'disabled' '&.#{$CONFIG_STATE_PREFIX}disabled, &[disabled]',
33
- 'focus-inner' '&::-moz-focus-inner'
34
- );
35
- $CONFIG_STATE_MAPPINGS: () !default;
36
- $CONFIG_STATE_MAPPINGS: associative-merge($CORE_STATE_MAPPINGS, $CONFIG_STATE_MAPPINGS);
37
-
38
- // misc
39
- $CONTENT_PLACEHOLDER: '\0020' !default; // content placeholder (ensures block elements display correctly even if they're empty)
40
- $CONFIG_DISABLED_CSS: () !default; // a list of CSS3 features to always disable when using output-style()
41
- $CONFIG_GENERATED_TAG_PREFIX: x-archetype !default; // the prefix for the tag name to create when using ie-pseudo method
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
-
45
- // z-layers
46
- $CONFIG_Z_INDEX_BASE: 0 !default; // the default starting layer for z-index calculations
47
- $CONFIG_Z_LAYERS_OFFSET: 100 !default; // the offset between z-layers
48
- $CONFIG_Z_LAYERS: (default dialog navigation) !default; // the orders for the z-layers
49
-
50
- // compass
51
- $COMPASS_RTL_SUPPORT: false !default; // does your Compass version support RTL? set to true if Compass mixins support RTL
52
-
53
- // sprites
54
- $CONFIG_DISABLE_STYLEGUIDE_SPRITES: false !default; // disable all sprite generation in styleguide
55
-
56
- // keyframe animations
57
- $CONFIG_KEYFRAMES_AUTO: $CONFIG_RESET_AUTO !default; // whether or not to auto generate the keyframe animations
58
- $CONFIG_KEYFRAME_LOADERS: archetype-loader !default; // loading spinner keyframe name
59
-
60
- // glyphs
61
- $CONFIG_GLYPHS_NAME: FontAwesome !default; // name for the font-face
62
- $CONFIG_GLYPHS_VERSION: '0.0.1' !default; // the glyph library version number
63
- $CONFIG_GLYPHS_SVG_ID: $CONFIG_GLYPHS_NAME !default;
64
- $CONFIG_GLYPHS_BASE_PATH: 'vendor/archetype/fontawesome-webfont' !default; // generic path to all glyph fonts (sans extensions)
65
- $CONFIG_GLYPHS_EOT: '#{$CONFIG_GLYPHS_BASE_PATH}.eot' !default;
66
- $CONFIG_GLYPHS_FILES: font-files('#{$CONFIG_GLYPHS_BASE_PATH}.woff', '#{$CONFIG_GLYPHS_BASE_PATH}.ttf', '#{$CONFIG_GLYPHS_BASE_PATH}.svg##{$CONFIG_GLYPHS_SVG_ID}') !default;
67
- $CONFIG_GLYPHS_WEIGHT: normal !default; // font-weight for glyphs
68
- $CONFIG_GLYPHS_STYLE: normal !default; // font-style for glyphs
69
- $CONFIG_GLYPHS_THRESHOLD: 16px !default; // the threshold to switch to halfling characters, if available
70
- $CONFIG_GLYPHS_AUTO: $CONFIG_RESET_AUTO !default; // whether or not to auto generate the font-face definition for the glyph font
71
- // FontAwesome icon mappings as of 2012/11/03
72
- $CORE_GLYPHS_MAPPINGS: (
73
- glass '\f000',
74
- music '\f001',
75
- search '\f002',
76
- envelope '\f003',
77
- heart '\f004',
78
- star '\f005',
79
- star-empty '\f006',
80
- user '\f007',
81
- film '\f008',
82
- th-large '\f009',
83
- th '\f00a',
84
- th-list '\f00b',
85
- ok '\f00c',
86
- remove '\f00d',
87
- zoom-in '\f00e',
88
- zoom-out '\f010',
89
- off '\f011',
90
- signal '\f012',
91
- cog '\f013',
92
- trash '\f014',
93
- home '\f015',
94
- file '\f016',
95
- time '\f017',
96
- road '\f018',
97
- download-alt '\f019',
98
- download '\f01a',
99
- upload '\f01b',
100
- inbox '\f01c',
101
- play-circle '\f01d',
102
- repeat '\f01e',
103
-
104
- refresh '\f021',
105
- list-alt '\f022',
106
- lock '\f023',
107
- flag '\f024',
108
- headphones '\f025',
109
- volume-off '\f026',
110
- volume-down '\f027',
111
- volume-up '\f028',
112
- qrcode '\f029',
113
- barcode '\f02a',
114
- tag '\f02b',
115
- tags '\f02c',
116
- book '\f02d',
117
- bookmark '\f02e',
118
- print '\f02f',
119
-
120
- camera '\f030',
121
- font '\f031',
122
- bold '\f032',
123
- italic '\f033',
124
- text-height '\f034',
125
- text-width '\f035',
126
- align-left '\f036',
127
- align-center '\f037',
128
- align-right '\f038',
129
- align-justify '\f039',
130
- list '\f03a',
131
- indent-left '\f03b',
132
- indent-right '\f03c',
133
- facetime-video '\f03d',
134
- picture '\f03e',
135
-
136
- pencil '\f040',
137
- map-marker '\f041',
138
- adjust '\f042',
139
- tint '\f043',
140
- edit '\f044',
141
- share '\f045',
142
- check '\f046',
143
- move '\f047',
144
- step-backward '\f048',
145
- fast-backward '\f049',
146
- backward '\f04a',
147
- play '\f04b',
148
- pause '\f04c',
149
- stop '\f04d',
150
- forward '\f04e',
151
-
152
- fast-forward '\f050',
153
- step-forward '\f051',
154
- eject '\f052',
155
- chevron-left '\f053',
156
- chevron-right '\f054',
157
- plus-sign '\f055',
158
- minus-sign '\f056',
159
- remove-sign '\f057',
160
- ok-sign '\f058',
161
- question-sign '\f059',
162
- info-sign '\f05a',
163
- screenshot '\f05b',
164
- remove-circle '\f05c',
165
- ok-circle '\f05d',
166
- ban-circle '\f05e',
167
-
168
- arrow-left '\f060',
169
- arrow-right '\f061',
170
- arrow-up '\f062',
171
- arrow-down '\f063',
172
- share-alt '\f064',
173
- resize-full '\f065',
174
- resize-small '\f066',
175
- plus '\f067',
176
- minus '\f068',
177
- asterisk '\f069',
178
- exclamation-sign '\f06a',
179
- gift '\f06b',
180
- leaf '\f06c',
181
- fire '\f06d',
182
- eye-open '\f06e',
183
-
184
- eye-close '\f070',
185
- warning-sign '\f071',
186
- plane '\f072',
187
- calendar '\f073',
188
- random '\f074',
189
- comment '\f075',
190
- magnet '\f076',
191
- chevron-up '\f077',
192
- chevron-down '\f078',
193
- retweet '\f079',
194
- shopping-cart '\f07a',
195
- folder-close '\f07b',
196
- folder-open '\f07c',
197
- resize-vertical '\f07d',
198
- resize-horizontal '\f07e',
199
-
200
- bar-chart '\f080',
201
- twitter-sign '\f081',
202
- facebook-sign '\f082',
203
- camera-retro '\f083',
204
- key '\f084',
205
- cogs '\f085',
206
- comments '\f086',
207
- thumbs-up '\f087',
208
- thumbs-down '\f088',
209
- star-half '\f089',
210
- heart-empty '\f08a',
211
- signout '\f08b',
212
- linkedin-sign '\f08c',
213
- pushpin '\f08d',
214
- external-link '\f08e',
215
-
216
- signin '\f090',
217
- trophy '\f091',
218
- github-sign '\f092',
219
- upload-alt '\f093',
220
- lemon '\f094',
221
- phone '\f095',
222
- check-empty '\f096',
223
- bookmark-empty '\f097',
224
- phone-sign '\f098',
225
- twitter '\f099',
226
- facebook '\f09a',
227
- github '\f09b',
228
- unlock '\f09c',
229
- credit-card '\f09d',
230
- rss '\f09e',
231
-
232
- hdd '\f0a0',
233
- bullhorn '\f0a1',
234
- bell '\f0a2',
235
- certificate '\f0a3',
236
- hand-right '\f0a4',
237
- hand-left '\f0a5',
238
- hand-up '\f0a6',
239
- hand-down '\f0a7',
240
- circle-arrow-left '\f0a8',
241
- circle-arrow-right '\f0a9',
242
- circle-arrow-up '\f0aa',
243
- circle-arrow-down '\f0ab',
244
- globe '\f0ac',
245
- wrench '\f0ad',
246
- tasks '\f0ae',
247
-
248
- filter '\f0b0',
249
- briefcase '\f0b1',
250
- fullscreen '\f0b2',
251
-
252
- group '\f0c0',
253
- link '\f0c1',
254
- cloud '\f0c2',
255
- beaker '\f0c3',
256
- cut '\f0c4',
257
- copy '\f0c5',
258
- paper-clip '\f0c6',
259
- save '\f0c7',
260
- sign-blank '\f0c8',
261
- reorder '\f0c9',
262
- list-ul '\f0ca',
263
- list-ol '\f0cb',
264
- strikethrough '\f0cc',
265
- underline '\f0cd',
266
- table '\f0ce',
267
-
268
- magic '\f0d0',
269
- truck '\f0d1',
270
- pinterest '\f0d2',
271
- pinterest-sign '\f0d3',
272
- google-plus-sign '\f0d4',
273
- google-plus '\f0d5',
274
- money '\f0d6',
275
- caret-down '\f0d7',
276
- caret-up '\f0d8',
277
- caret-left '\f0d9',
278
- caret-right '\f0da',
279
- columns '\f0db',
280
- sort '\f0dc',
281
- sort-down '\f0dd',
282
- sort-up '\f0de',
283
-
284
- envelope-alt '\f0e0',
285
- linkedin '\f0e1',
286
- undo '\f0e2',
287
- legal '\f0e3',
288
- dashboard '\f0e4',
289
- comment-alt '\f0e5',
290
- comments-alt '\f0e6',
291
- bolt '\f0e7',
292
- sitemap '\f0e8',
293
- umbrella '\f0e9',
294
- paste '\f0ea',
295
-
296
- user-md '\f200'
297
- );
298
- $CONFIG_GLYPHS_MAPPINGS: () !default;
299
- $CONFIG_GLYPHS_MAPPINGS: associative-merge($CORE_GLYPHS_MAPPINGS, $CONFIG_GLYPHS_MAPPINGS);
300
-
301
- // browser targeting
302
- $CONFIG_BROWSER_VENDORS_CLASS: (ie) !default; // a list of browsers to support via class targeting
303
- $CONFIG_BROWSER_ALLOW_HACKS: true !default; // if set to true, allow browser targeting hacks
304
- $CONFIG_BROWSER_WARN_ON_HACK: false !default; // if hacks are used, throw a warning
305
- // this is an associative list for various hacks
306
- $CONFIG_BROWSER_VENDORS_HACK: (
307
- (webkit-all, safari webkit chrome),
308
- (gecko-all, firefox gecko mozilla),
309
- (opera-all, opera) // NOTE: this may stop working once Opera switches over to using WebKit/Blink
310
- ) !default;
311
-
312
- // os targeting
313
- $CONFIG_OS_VENDORS_CLASS: (
314
- (os-win, windows win winxp win7 win8),
315
- (os-mac, apple mac osx),
316
- (os-linux, linux),
317
- (os-other, other misc unknown)
318
- ) !default;
319
-
320
- // os/language safe font stacks
321
- // these are core font definitions, these will be extended with whatever is in $CONFIG_SAFE_FONTS
322
- $CORE_SAFE_FONTS: (
323
- (sans-serif, (
324
- (default, (
325
- (default (sans-serif)),
326
- (ko_KR ('Malgun Gothic', default)),
327
- (zh_TW (SimSun, default)),
328
- (zh_CN (SimSun, default)),
329
- (th_TH (Tahoma, default)),
330
- (ar_AE (Tahoma, Arial, 'Times New Roman', default))
331
- )),
332
- (win, (
333
- (default (Arial, sans-serif)),
334
- (ja_JP (メイリオ, Meiryo, 'MS Pゴシック', 'MS PGothic', default)),
335
- (zh_TW (default, '微軟正黑體', 'Microsoft JhengHei', PMingLiu, '宋体', SimSun)),
336
- (zh_CN (Arial, '华文细黑', 'STHeiti Light', '微软雅黑体', 'Microsoft Yahei', '新宋体', NSimSun, '宋体', SimSun)), // Heiti/Yahei not showing up in Chrome and FF in windows. Removal of sans-serif fixes it.
337
- (th_TH nil),
338
- (ko_KR nil),
339
- (ar_AE nil)
340
- )),
341
- (mac, (
342
- (default (Helvetica, Arial, sans-serif)),
343
- (zh_TW (default, '黑體-繁', 'Heiti TC', '儷黑Pro', 'LiHei Pro', PMingLiu, '宋体', SimSun)),
344
- (zh_CN (default, '黑体-简', 'Heiti SC', '华文细黑', 'STHeiti Light', '华文黑体', STHeiti)),
345
- (ja_JP ('Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ Pro W3', 'MS Pゴシック', 'MS PGothic', default)),
346
- (th_TH nil),
347
- (ko_KR nil),
348
- (ar_AE nil)
349
- )),
350
- (linux, (
351
- (default (Helvetica, FreeSans, 'Liberation Sans', Helmet, Arial, sans-serif)),
352
- (zh_TW (default, PMingLiu, '宋体', SimSun)),
353
- (zh_CN (default, '新宋体', NSimSun, '宋体', SimSun)),
354
- (ja_JP nil),
355
- (th_TH nil),
356
- (ko_KR nil),
357
- (ar_AE nil)
358
- ))
359
- )),
360
- (serif, (
361
- (default, (
362
- (default (Georgia, serif)),
363
- (CJK nil) // dont use any serif fonts in CJK langs
364
- )),
365
- nil
366
- )),
367
- (monospace, (
368
- (default, (
369
- (default (Menlo, Monaco, Consolas, 'Courier New', monospace)),
370
- nil
371
- )),
372
- nil
373
- )),
374
- (headline, (
375
- (default, (
376
- (default nil), // by default, dont style headlines differently
377
- (ar_AE ('Droid Arabic Naskh')) // TODO: need to include the webfont
378
- )),
379
- nil
380
- ))
381
- ); // note that this declaration isn't a `default`, but rather is enforced everytime. this can be modified (via extending $CONFIG_SAFE_FONTS)
382
- $CONFIG_SAFE_FONTS: () !default;
383
- $CONFIG_SAFE_FONTS: associative-merge($CORE_SAFE_FONTS, $CONFIG_SAFE_FONTS);
384
-
385
- $archetype-glyph-selector: false !default;
386
- $archetype-pseudo-selector: false !default;
387
-
388
- $CORE_GLYPH_SELECTOR_VAR: '$archetype-glyph-selector';
389
- $CORE_GLYPH_SELECTOR_VAR: '$archetype-pseudo-selector';
1
+ @import "config/core";