archetype 0.0.1.pre.1 → 0.0.1.pre.3.00dfd9a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +88 -0
  3. data/LICENSE +16 -0
  4. data/README.md +87 -1
  5. data/VERSION.yml +6 -0
  6. data/lib/README.rdoc +4 -0
  7. data/lib/archetype.rb +45 -0
  8. data/lib/archetype/functions.rb +9 -0
  9. data/lib/archetype/functions/hash.rb +149 -0
  10. data/lib/archetype/functions/helpers.rb +125 -0
  11. data/lib/archetype/functions/styleguide_memoizer.rb +61 -0
  12. data/lib/archetype/sass_extensions.rb +6 -0
  13. data/lib/archetype/sass_extensions/functions.rb +14 -0
  14. data/lib/archetype/sass_extensions/functions/environment.rb +14 -0
  15. data/lib/archetype/sass_extensions/functions/lists.rb +284 -0
  16. data/lib/archetype/sass_extensions/functions/locale.rb +77 -0
  17. data/lib/archetype/sass_extensions/functions/numbers.rb +19 -0
  18. data/lib/archetype/sass_extensions/functions/styleguide.rb +406 -0
  19. data/lib/archetype/sass_extensions/functions/ui.rb +59 -0
  20. data/lib/archetype/sass_extensions/functions/version.rb +95 -0
  21. data/lib/archetype/version.rb +75 -0
  22. data/stylesheets/_archetype.scss +2 -0
  23. data/stylesheets/archetype/_base.scss +46 -0
  24. data/stylesheets/archetype/_config.scss +366 -0
  25. data/stylesheets/archetype/_grid.scss +3 -0
  26. data/stylesheets/archetype/_hacks.scss +72 -0
  27. data/stylesheets/archetype/_init.scss +23 -0
  28. data/stylesheets/archetype/_styleguide.scss +6 -0
  29. data/stylesheets/archetype/_ui.scss +326 -0
  30. data/stylesheets/archetype/_util.scss +12 -0
  31. data/stylesheets/archetype/base/_h5bp.scss +307 -0
  32. data/stylesheets/archetype/base/_hybrid.scss +25 -0
  33. data/stylesheets/archetype/base/_normalize.scss +595 -0
  34. data/stylesheets/archetype/base/_reset.scss +72 -0
  35. data/stylesheets/archetype/grid/_config.scss +14 -0
  36. data/stylesheets/archetype/grid/_grid.scss +391 -0
  37. data/stylesheets/archetype/styleguide/_components.scss +25 -0
  38. data/stylesheets/archetype/styleguide/_helpers.scss +215 -0
  39. data/stylesheets/archetype/styleguide/_primitives.scss +10 -0
  40. data/stylesheets/archetype/styleguide/_styleguide.scss +41 -0
  41. data/stylesheets/archetype/styleguide/components/_alerts.scss +59 -0
  42. data/stylesheets/archetype/styleguide/components/_annotations.scss +27 -0
  43. data/stylesheets/archetype/styleguide/components/_bristol.scss +15 -0
  44. data/stylesheets/archetype/styleguide/components/_button_groups.scss +47 -0
  45. data/stylesheets/archetype/styleguide/components/_button_toolbars.scss +17 -0
  46. data/stylesheets/archetype/styleguide/components/_buttons.scss +338 -0
  47. data/stylesheets/archetype/styleguide/components/_canvas.scss +15 -0
  48. data/stylesheets/archetype/styleguide/components/_carets.scss +336 -0
  49. data/stylesheets/archetype/styleguide/components/_closes.scss +63 -0
  50. data/stylesheets/archetype/styleguide/components/_container.scss +27 -0
  51. data/stylesheets/archetype/styleguide/components/_copy.scss +85 -0
  52. data/stylesheets/archetype/styleguide/components/_flyouts.scss +52 -0
  53. data/stylesheets/archetype/styleguide/components/_headings.scss +33 -0
  54. data/stylesheets/archetype/styleguide/components/_headlines.scss +63 -0
  55. data/stylesheets/archetype/styleguide/components/_hovercards.scss +27 -0
  56. data/stylesheets/archetype/styleguide/components/_icons.scss +17 -0
  57. data/stylesheets/archetype/styleguide/components/_identities.scss +34 -0
  58. data/stylesheets/archetype/styleguide/components/_links.scss +66 -0
  59. data/stylesheets/archetype/styleguide/components/_loaders.scss +154 -0
  60. data/stylesheets/archetype/styleguide/components/_menu_items.scss +31 -0
  61. data/stylesheets/archetype/styleguide/components/_module.scss +15 -0
  62. data/stylesheets/archetype/styleguide/components/_pullquotes.scss +29 -0
  63. data/stylesheets/archetype/styleguide/components/_punchcut.scss +18 -0
  64. data/stylesheets/archetype/styleguide/components/_tooltips.scss +28 -0
  65. data/stylesheets/archetype/styleguide/primitives/_animations.scss +17 -0
  66. data/stylesheets/archetype/styleguide/primitives/_dimensions.scss +50 -0
  67. data/stylesheets/archetype/styleguide/primitives/_glyphs.scss +11 -0
  68. data/stylesheets/archetype/styleguide/primitives/_misc.scss +8 -0
  69. data/stylesheets/archetype/styleguide/primitives/_palettes.scss +94 -0
  70. data/stylesheets/archetype/styleguide/primitives/_shadows.scss +23 -0
  71. data/stylesheets/archetype/styleguide/primitives/_sprites.scss +46 -0
  72. data/stylesheets/archetype/styleguide/primitives/_textures.scss +10 -0
  73. data/stylesheets/archetype/styleguide/primitives/_typography.scss +56 -0
  74. data/stylesheets/archetype/util/_debug.scss +40 -0
  75. data/stylesheets/archetype/util/_lists.scss +57 -0
  76. data/stylesheets/archetype/util/_misc.scss +108 -0
  77. data/stylesheets/archetype/util/_rtl.scss +279 -0
  78. data/stylesheets/archetype/util/_spacing.scss +78 -0
  79. data/stylesheets/archetype/util/_styles.scss +466 -0
  80. data/stylesheets/archetype/util/_targeting.scss +210 -0
  81. data/stylesheets/archetype/util/_units.scss +18 -0
  82. data/templates/example/index.html +40 -0
  83. data/templates/example/manifest.rb +13 -0
  84. data/templates/example/screen.scss +99 -0
  85. data/templates/example/vendor/archetype/animations/loaders/large/large.png +0 -0
  86. data/templates/example/vendor/archetype/animations/loaders/large/large_dark.png +0 -0
  87. data/templates/example/vendor/archetype/animations/loaders/large/large_dark_static.png +0 -0
  88. data/templates/example/vendor/archetype/animations/loaders/large/large_static.png +0 -0
  89. data/templates/example/vendor/archetype/animations/loaders/medium/medium.png +0 -0
  90. data/templates/example/vendor/archetype/animations/loaders/medium/medium_dark.png +0 -0
  91. data/templates/example/vendor/archetype/animations/loaders/medium/medium_dark_static.png +0 -0
  92. data/templates/example/vendor/archetype/animations/loaders/medium/medium_static.png +0 -0
  93. data/templates/example/vendor/archetype/animations/loaders/small/small.png +0 -0
  94. data/templates/example/vendor/archetype/animations/loaders/small/small_dark.png +0 -0
  95. data/templates/example/vendor/archetype/animations/loaders/small/small_dark_static.png +0 -0
  96. data/templates/example/vendor/archetype/animations/loaders/small/small_static.png +0 -0
  97. data/templates/example/vendor/archetype/fontawesome-webfont.eot +0 -0
  98. data/templates/example/vendor/archetype/fontawesome-webfont.svg +255 -0
  99. data/templates/example/vendor/archetype/fontawesome-webfont.ttf +0 -0
  100. data/templates/example/vendor/archetype/fontawesome-webfont.woff +0 -0
  101. data/templates/project/manifest.rb +9 -0
  102. data/templates/project/screen.scss +1 -0
  103. data/templates/project/vendor/archetype/animations/loaders/large/large.png +0 -0
  104. data/templates/project/vendor/archetype/animations/loaders/large/large_dark.png +0 -0
  105. data/templates/project/vendor/archetype/animations/loaders/large/large_dark_static.png +0 -0
  106. data/templates/project/vendor/archetype/animations/loaders/large/large_static.png +0 -0
  107. data/templates/project/vendor/archetype/animations/loaders/medium/medium.png +0 -0
  108. data/templates/project/vendor/archetype/animations/loaders/medium/medium_dark.png +0 -0
  109. data/templates/project/vendor/archetype/animations/loaders/medium/medium_dark_static.png +0 -0
  110. data/templates/project/vendor/archetype/animations/loaders/medium/medium_static.png +0 -0
  111. data/templates/project/vendor/archetype/animations/loaders/small/small.png +0 -0
  112. data/templates/project/vendor/archetype/animations/loaders/small/small_dark.png +0 -0
  113. data/templates/project/vendor/archetype/animations/loaders/small/small_dark_static.png +0 -0
  114. data/templates/project/vendor/archetype/animations/loaders/small/small_static.png +0 -0
  115. data/templates/project/vendor/archetype/fontawesome-webfont.eot +0 -0
  116. data/templates/project/vendor/archetype/fontawesome-webfont.svg +255 -0
  117. data/templates/project/vendor/archetype/fontawesome-webfont.ttf +0 -0
  118. data/templates/project/vendor/archetype/fontawesome-webfont.woff +0 -0
  119. data/test/fixtures/stylesheets/archetype/assets/fonts/fontawesome-webfont.eot +0 -0
  120. data/test/fixtures/stylesheets/archetype/assets/fonts/fontawesome-webfont.svg +255 -0
  121. data/test/fixtures/stylesheets/archetype/assets/fonts/fontawesome-webfont.ttf +0 -0
  122. data/test/fixtures/stylesheets/archetype/assets/fonts/fontawesome-webfont.woff +0 -0
  123. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/large/large.png +0 -0
  124. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/large/large_dark.png +0 -0
  125. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/large/large_dark_static.png +0 -0
  126. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/large/large_static.png +0 -0
  127. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/medium/medium.png +0 -0
  128. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/medium/medium_dark.png +0 -0
  129. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/medium/medium_dark_static.png +0 -0
  130. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/medium/medium_static.png +0 -0
  131. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/small/small.png +0 -0
  132. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/small/small_dark.png +0 -0
  133. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/small/small_dark_static.png +0 -0
  134. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders/small/small_static.png +0 -0
  135. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/sprites/hovercard_tip.png +0 -0
  136. data/test/fixtures/stylesheets/archetype/config.rb +19 -0
  137. data/test/fixtures/stylesheets/archetype/expected/b.css +14 -0
  138. data/test/fixtures/stylesheets/archetype/expected/base.css +349 -0
  139. data/test/fixtures/stylesheets/archetype/expected/hacks/ie_pseudo.css +11 -0
  140. data/test/fixtures/stylesheets/archetype/expected/locale.css +23 -0
  141. data/test/fixtures/stylesheets/archetype/expected/styleguide/buttons.css +2091 -0
  142. data/test/fixtures/stylesheets/archetype/expected/styleguide/fallback_styles.css +9 -0
  143. data/test/fixtures/stylesheets/archetype/expected/styleguide/nested_styleguides.css +24 -0
  144. data/test/fixtures/stylesheets/archetype/expected/styleguide/selective_state.css +174 -0
  145. data/test/fixtures/stylesheets/archetype/expected/ui/glyph_icon.css +37 -0
  146. data/test/fixtures/stylesheets/archetype/expected/ui/hide_element.css +8 -0
  147. data/test/fixtures/stylesheets/archetype/expected/ui/stroke.css +17 -0
  148. data/test/fixtures/stylesheets/archetype/expected/ui/triangle.css +35 -0
  149. data/test/fixtures/stylesheets/archetype/expected/utilities/associative.css +9 -0
  150. data/test/fixtures/stylesheets/archetype/expected/utilities/if-set.css +9 -0
  151. data/test/fixtures/stylesheets/archetype/expected/utilities/spacing/horizontal-spacing.css +29 -0
  152. data/test/fixtures/stylesheets/archetype/expected/utilities/spacing/vertical-spacing.css +29 -0
  153. data/test/fixtures/stylesheets/archetype/expected/utilities/styles/filter.css +11 -0
  154. data/test/fixtures/stylesheets/archetype/expected/utilities/styles/font-family.css +16 -0
  155. data/test/fixtures/stylesheets/archetype/expected/utilities/styles/z-index.css +15 -0
  156. data/test/fixtures/stylesheets/archetype/expected/utilities/targeting/target-browser.css +100 -0
  157. data/test/fixtures/stylesheets/archetype/expected/utilities/targeting/target-os.css +55 -0
  158. data/test/fixtures/stylesheets/archetype/source/b.scss +9 -0
  159. data/test/fixtures/stylesheets/archetype/source/base.scss +3 -0
  160. data/test/fixtures/stylesheets/archetype/source/hacks/ie_pseudo.scss +13 -0
  161. data/test/fixtures/stylesheets/archetype/source/locale.scss +43 -0
  162. data/test/fixtures/stylesheets/archetype/source/styleguide/buttons.scss +18 -0
  163. data/test/fixtures/stylesheets/archetype/source/styleguide/fallback_styles.scss +22 -0
  164. data/test/fixtures/stylesheets/archetype/source/styleguide/nested_styleguides.scss +40 -0
  165. data/test/fixtures/stylesheets/archetype/source/styleguide/selective_state.scss +22 -0
  166. data/test/fixtures/stylesheets/archetype/source/ui/glyph_icon.scss +13 -0
  167. data/test/fixtures/stylesheets/archetype/source/ui/hide_element.scss +5 -0
  168. data/test/fixtures/stylesheets/archetype/source/ui/stroke.scss +13 -0
  169. data/test/fixtures/stylesheets/archetype/source/ui/triangle.scss +13 -0
  170. data/test/fixtures/stylesheets/archetype/source/utilities/associative.scss +24 -0
  171. data/test/fixtures/stylesheets/archetype/source/utilities/if-set.scss +16 -0
  172. data/test/fixtures/stylesheets/archetype/source/utilities/spacing/horizontal-spacing.scss +27 -0
  173. data/test/fixtures/stylesheets/archetype/source/utilities/spacing/vertical-spacing.scss +27 -0
  174. data/test/fixtures/stylesheets/archetype/source/utilities/styles/filter.scss +9 -0
  175. data/test/fixtures/stylesheets/archetype/source/utilities/styles/font-family.scss +9 -0
  176. data/test/fixtures/stylesheets/archetype/source/utilities/styles/z-index.scss +18 -0
  177. data/test/fixtures/stylesheets/archetype/source/utilities/targeting/target-browser.scss +70 -0
  178. data/test/fixtures/stylesheets/archetype/source/utilities/targeting/target-os.scss +42 -0
  179. data/test/helpers/diff.rb +49 -0
  180. data/test/helpers/io.rb +36 -0
  181. data/test/helpers/test_case.rb +62 -0
  182. data/test/integrations/archetype_test.rb +126 -0
  183. data/test/test_helper.rb +26 -0
  184. data/test/units/sass_extensions_test.rb +207 -0
  185. metadata +303 -15
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 97c23e2750bc27861f4602ddb1c1a80f48a172b8
4
+ data.tar.gz: fe2470feea0f4c8ae90db32247c4b1a8159400ba
5
+ SHA512:
6
+ metadata.gz: 0125375a83db183fe5f903730204110f0d77073f509696392a5ab91bee052f27e72e6539b16f567102de3be5a9c1106f35d56f6a7198eb92453407d771aa6721
7
+ data.tar.gz: d53907489ca4c58266946c2ee08eb49e93f11a4a124c41d7ffba53cf920958c70e6281be8db0e8c13f683759926e710161537d86b74fec367ed15da3358d297f
data/CHANGELOG.md ADDED
@@ -0,0 +1,88 @@
1
+ # Changelog
2
+
3
+ ## 0.0.1
4
+
5
+ - initial public release
6
+
7
+ ## 0.0.1.pre.3 (pre-released)
8
+
9
+ ### New Features:
10
+
11
+ - added `styleguide-component-exists()` method to check if a component/extension has already been registered in the theme
12
+ - added `memoize` compiler configuration to allow enabling/disabling the internal styleguide memoizer
13
+ - `glyph-icon()` can now take `false` as an icon name and not output anything
14
+ - added `unstyled-button()` method to remove default styling from a `<button>` element
15
+ - added `prefixed-tag()` method for consistency when generating tag names
16
+ - added Chinese font stacks
17
+ - added wildcard support to `locale()` function (e.g. `locale(en_ ja_JP _DE)`)
18
+
19
+ ### Resolved Issues:
20
+
21
+ - quotes on strings passed to `associative()` weren't being stripped correctly
22
+ - fixed some minor glyph issues
23
+ - out-of-order CSS issues in Ruby 1.8.7 are fixed using `Hashery::OrderedHash`
24
+
25
+ ### Tests:
26
+
27
+ - added test case for fallback CSS properties
28
+ - added test case for generating loading spinner keyframe animations
29
+ - updated test cases for minor changes
30
+
31
+ ## 0.0.1.pre.2 (unreleased)
32
+
33
+ ### New Features:
34
+
35
+ - added HTML5 Boilerplate reset
36
+ - updated normalize to 2.0.1
37
+ - added support for selective states in `styleguide` calls (e.g. styleguide(large primary button, $state: disabled))
38
+ - added support for `drop` and `styleguide` keywords in components
39
+ - `drop` allows you to drop previously defined styles within a component definition (e.g. if you need to remove defaults)
40
+ - `styleguide` in a component definition will insert the derived styles from a styleguide() call. this allows you to share styles between components
41
+ - added `styleguide-diff()` method
42
+ - added `ie-pseudo()` methods to support dynamically generating pseudo :before and :after elements (using expressions)
43
+ - added `stroke()` mixin to create a stroke line around text (or font icon)
44
+ - added `hide-element()` mixin to hide elements from screen but keep them screen-reader accessible
45
+ - added basic support for fallback CSS values (e.g. border: red; border: rgba(255,0,0, 0.8);)
46
+ - added `$CONFIG_STATE_MAPPINGS` to simplify the mapping between state names and selectors
47
+
48
+ ### Major Changes:
49
+
50
+ - loading spinners now use CSS3 animations and require some integration work
51
+ - updated default vertical/horizontal spacing to 5px
52
+ - `list-extend()` is now `associative-merge()`
53
+
54
+ ### Resolved Issues:
55
+
56
+ - nested inheritance would get corrupted (due to a volatile context being passed along)
57
+ - `$exclude` in `to-styles` wasn't taking a list of keys cleanly
58
+ - `font-family()` and `lang()` weren't respecting locale aliases
59
+ - fixed thread safety issues
60
+
61
+ ### Documentation:
62
+
63
+ - updated README to be a bit friendlier
64
+ - added CONTRIBUTING
65
+ - added RDoc documentation to source
66
+
67
+ ## 0.0.1.pre.1 (unreleased)
68
+
69
+ ### New Features:
70
+
71
+ - `styleguide-add-component()`, `styleguide-extend-component()`, and `styleguide()` now take a `$theme` parameter
72
+ - `$CONFIG_THEME` can change the global theme
73
+ - `$CONFIG_STYLEGUIDE_DISABLE_SPRITES` will prevent styleguide sprites from being generated if set to `true`
74
+ - theme components are cached
75
+ - `styleguide()` calls are memoized
76
+
77
+ ### Major Changes:
78
+
79
+ - `filter()` mixin is now `ie-filter()` to prevent conflicts with Compass' `filter()` mixin
80
+ - Compass overrides are no longer loaded as Archetype core
81
+
82
+ ### Resolved Issues:
83
+
84
+ - no known issues to resolve
85
+
86
+ ### Documentation:
87
+
88
+ - added README
data/LICENSE ADDED
@@ -0,0 +1,16 @@
1
+ Archetype
2
+ Copyright (c) 2013 LinkedIn Corp. All rights reserved.
3
+ Apache Software License 2.0
4
+
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License.
8
+ You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
data/README.md CHANGED
@@ -1 +1,87 @@
1
- placeholder
1
+ # Archetype
2
+
3
+ [![Build Status](https://travis-ci.org/linkedin/archetype.png)](https://travis-ci.org/linkedin/archetype)
4
+
5
+ Archetype is a UI pattern and component library for quickly iterating on and maintaining scalable web interfaces.
6
+
7
+ ## Resources
8
+
9
+ - [Archetype Homepage](http://www.archetypecss.com/)
10
+ - [Documentation](http://www.archetypecss.com/documentation/)
11
+ - [Components](http://www.archetypecss.com/components/)
12
+ - [Tutorials](http://www.archetypecss.com/tutorials/)
13
+ - [Blog](http://www.archetypecss.com/blog/)
14
+ - [Add-ons](http://www.archetypecss.com/addons/)
15
+ - [Discussion](https://github.com/eoneill/archetype/issues)
16
+ - [Archetype configuration](http://www.archetypecss.com/documentation/configuration/)
17
+
18
+ ## Installation
19
+
20
+ ### Install the gem
21
+
22
+ ```bash
23
+ [sudo] gem install archetype --pre
24
+ ```
25
+
26
+ Instead of installing the gem directly via the command line, we recommend using [Bundler](http://gembundler.com/) to manage your gem dependencies.
27
+
28
+ ### Creating a new project with Archetype
29
+
30
+ ```bash
31
+ compass create ~/workspace/your-project -r archetype --using archetype
32
+ ```
33
+
34
+ ### Adding Archetype to an existing Compass project
35
+
36
+ In your `config.rb`, add
37
+
38
+ ```ruby
39
+ require "archetype"
40
+ ```
41
+
42
+ ### Import Archetype into your Sass file
43
+
44
+ ```sass
45
+ @import "archetype";
46
+ ```
47
+
48
+ Learn more about [Archetype configuration](http://www.archetypecss.com/documentation/configuration/).
49
+
50
+ ## Credits
51
+
52
+ ### Author
53
+
54
+ Archetype was originally written by [Eugene O'Neill](http://www.linkedin.com/in/eugeneoneill).
55
+
56
+ ### Inspiration
57
+
58
+ - [Styleguides for the Web](http://paulrobertlloyd.com/2010/12/styleguides_for_the_web/)
59
+ - [BBC Global Experience Language](http://www.bbc.co.uk/gel)
60
+ - [Our Living Style Guide (Writing maintainable HTML/CSS)](http://blog.rjmetrics.com/our-living-style-guide-writing-maintainable-htmlcss/)
61
+ - [The Fight for a Living Style Guide](http://www.mapletonhillmedia.com/the-fight-for-a-living-style-guide/)
62
+ - [Anchoring Your Design Language in a Live Style Guide ](http://uxmag.com/articles/anchoring-your-design-language-in-a-live-style-guide)
63
+ - [Unifying Agile and UX with Live Style Guides](https://speakerdeck.com/u/thoughtmerchant/p/unifying-agile-and-ux-with-live-style-guides)
64
+ - [Twitter Bootstrap](http://twitter.github.com/bootstrap/)
65
+ - [ZURB Foundation](http://foundation.zurb.com/)
66
+
67
+ ### Special Thanks
68
+
69
+ - [Johnathan Leppert](http://www.linkedin.com/in/jleppert)
70
+ - [Jakob Heuser](http://www.felocity.com/)
71
+ - [David Delo](http://www.linkedin.com/in/daviddelo)
72
+ - [Robert Martone](http://www.linkedin.com/in/robertmartone)
73
+ - [Sean Sands](http://www.linkedin.com/in/snds117)
74
+ - [Chris Eppstein](http://chriseppstein.github.com/)
75
+ - [LinkedIn](http://www.linkedin.com/)
76
+ - [Compass](http://compass-style.org/)
77
+ - [Sass](http://sass-lang.com/)
78
+
79
+ ### Acknowledgements
80
+
81
+ This project couldn't have been made possible without the amazing work by the following heroes:
82
+
83
+ - Dave Gandy for his awesome work on [FontAwesome](http://fortawesome.github.com/Font-Awesome/)
84
+ - Chris Eppstein and other contributors of [Compass](http://compass-style.org/) for building an amazing framework, and for some great scaffolding code we've _borrowed_
85
+ - Nathan Weizenbaum and contributors for [making CSS fun again](http://sass-lang.com/)
86
+ - Nicolas Gallagher and Jonathan Neal for some [Normalize.css](https://github.com/necolas/normalize.css) greatness
87
+ - Nicolas Gallagher, Jonathan Neal, Kroc Camen, Paul Irish, and others for [HTML5 Boilerplate](http://html5boilerplate.com/)
data/VERSION.yml ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ :major: 0
3
+ :minor: 0
4
+ :build: 1
5
+ :state: pre
6
+ :iteration: 3
data/lib/README.rdoc ADDED
@@ -0,0 +1,4 @@
1
+ = Archetype UI pattern and component library
2
+
3
+ Archetype is a feature rich, front-end development framework built
4
+ on top of Compass and Sass.
data/lib/archetype.rb ADDED
@@ -0,0 +1,45 @@
1
+ require 'compass'
2
+
3
+ #
4
+ # Initialize Archetype and register it as a Compass extension
5
+ #
6
+ module Archetype
7
+ # extension info
8
+ @archetype = {}
9
+ @archetype[:name] = 'archetype'
10
+ @archetype[:path] = File.expand_path(File.join(File.dirname(__FILE__), ".."))
11
+ # register the extension
12
+ def self.register
13
+ Compass::Frameworks.register(@archetype[:name], :path => @archetype[:path])
14
+ end
15
+ # initialize Archetype
16
+ def self.init
17
+ # register it
18
+ self.register
19
+ # setup configs
20
+ # locale
21
+ Compass::Configuration.add_configuration_property(:locale, "the user locale") do
22
+ 'en_US'
23
+ end
24
+ # reading direction (ltr|rtl)
25
+ Compass::Configuration.add_configuration_property(:reading, "the user interface reading direction") do
26
+ 'ltr'
27
+ end
28
+ # environment
29
+ Compass::Configuration.add_configuration_property(:environment, "current environment") do
30
+ :development
31
+ end
32
+ # memoize
33
+ Compass::Configuration.add_configuration_property(:memoize, "should the memoizer be used to improve compilation speed") do
34
+ not (Compass.configuration.environment || :development).to_s.include?('dev')
35
+ end
36
+ end
37
+ end
38
+
39
+ # init
40
+ Archetype.init
41
+
42
+ # load dependencies
43
+ %w(functions sass_extensions).each do |lib|
44
+ require "archetype/#{lib}"
45
+ end
@@ -0,0 +1,9 @@
1
+ # :stopdoc:
2
+ # Load necessary functions.
3
+ #
4
+ module Archetype::Functions
5
+ end
6
+
7
+ %w(hash helpers styleguide_memoizer).each do |dep|
8
+ require "archetype/functions/#{dep}"
9
+ end
@@ -0,0 +1,149 @@
1
+ # :stopdoc:
2
+ # This module extends the native Ruby Hash class to support deep merging
3
+ # and comparing the difference between hashes.
4
+ # This functionality mimics that found in ActiveSupport
5
+ # @see https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/hash/deep_merge.rb
6
+ #
7
+ module Archetype::Functions::Hash
8
+ #
9
+ # recursively merge two hashes with deep merging
10
+ #
11
+ # *Parameters*:
12
+ # - +other_hash+ {Hash} the other hash to merge with
13
+ # *Returns*:
14
+ # - {Hash} a new hash containing the contents of other_hash and the contents of hsh, deep merged
15
+ #
16
+ def rmerge(other_hash, &block)
17
+ dup.rmerge!(other_hash, &block)
18
+ end
19
+
20
+ #
21
+ # adds the contents of other_hash to hsh, deep merged
22
+ #
23
+ # *Parameters*:
24
+ # - +other_hash+ {Hash} the other hash to merge with
25
+ # *Returns*:
26
+ # - {Hash} the original hash with the addition of the contents of other_hash
27
+ #
28
+ def rmerge!(other_hash, &block)
29
+ other_hash.each_pair do |k,v|
30
+ tv = self[k]
31
+ if tv.is_a?(Hash) && v.is_a?(Hash)
32
+ self[k] = tv.rmerge(v, &block)
33
+ else
34
+ self[k] = block && tv ? block.call(k, tv, v) : v
35
+ end
36
+ end
37
+ return self
38
+ end
39
+
40
+ #
41
+ # get the difference of another hash
42
+ #
43
+ # *Parameters*:
44
+ # - +other_hash+ {Hash} the other hash to compare against
45
+ # *Returns*:
46
+ # - {Hash} a representation of the difference between the two hashes
47
+ #
48
+ def diff(other_hash)
49
+ (self.keys + other_hash.keys).uniq.inject(Archetype::Hash.new) do |tmp, key|
50
+ # special comparison for gradients
51
+ are_gradients = self[key].is_a?(Compass::SassExtensions::Functions::GradientSupport::LinearGradient) and other_hash[key].is_a?(Compass::SassExtensions::Functions::GradientSupport::LinearGradient)
52
+ eq_gradients = are_gradients ? (self[key].to_s == other_hash[key].to_s) : true
53
+ unless self[key] == other_hash[key] and eq_gradients
54
+ if self[key].kind_of?(Hash) && other_hash[key].kind_of?(Hash)
55
+ tmp[key] = self[key].diff(other_hash[key])
56
+ else
57
+ tmp[key] = other_hash[key] || css_defaults(key)
58
+ # if the key is `filter-gradient` and it was removed, we need to change the key to `ie-filter`
59
+ tmp['ie-filter'] = css_defaults('ie-filter') if key == 'filter-gradient' and tmp[key].nil?
60
+ # if it came back as `nil` we couldn't understand it or it has no default, so axe it
61
+ tmp.delete(key) if tmp[key].nil?
62
+ end
63
+ end
64
+ tmp
65
+ end
66
+ end
67
+
68
+ private
69
+ #
70
+ # returns a best guess for the default CSS value of a given property
71
+ #
72
+ # *Parameters*:
73
+ # - <tt>key</tt> {String} the property to lookup
74
+ # *Returns*:
75
+ # - {Sass::String|Sass::Number} the default value
76
+ #
77
+ def css_defaults(key)
78
+ if @css_defaults.nil?
79
+ s = {}
80
+ # color
81
+ s['color'] = 'inherit'
82
+ # text
83
+ s['font'] = s['font-size'] = s['font-family'] = s['font-style'] = s['font-variant'] = s['font-weight'] = 'inherit'
84
+ s['text-decoration'] = s['text-transform'] = 'none'
85
+ s['text-align'] = 'left'
86
+ s['text-indent'] = 0
87
+ s['text-justify'] = 'auto'
88
+ s['text-overflow'] = 'clip'
89
+ s['line-height'] = 'normal'
90
+ # backgrounds
91
+ s['background'] = 'none'
92
+ s['background-color'] = 'transparent'
93
+ s['background-image'] = 'none'
94
+ s['background-repeat'] = 'repeat'
95
+ s['background-position'] = 'left top'
96
+ s['background-attachment'] = 'scroll'
97
+ s['background-clip'] = 'border-box'
98
+ s['background-size'] = 'auto'
99
+ s['background-origin'] = 'padding-box'
100
+ # borders
101
+ s['border'] = s['border-top'] = s['border-left'] = s['border-bottom'] = s['border-right'] = 'none'
102
+ s['border-color'] = s['border-top-color'] = s['border-left-color'] = s['border-bottom-color'] = s['border-right-color'] = 'transparent'
103
+ s['border-width'] = s['border-top-width'] = s['border-left-width'] = s['border-bottom-width'] = s['border-right-width'] = 0
104
+ s['border-style'] = s['border-top-style'] = s['border-left-style'] = s['border-bottom-style'] = s['border-right-style'] = 'solid'
105
+ # border-radius
106
+ s['border-radius'] = s['border-top-left-radius'] = s['border-top-right-radius'] = s['border-bottom-left-radius'] = s['border-bottom-right-radius'] = 0
107
+ # margin
108
+ s['margin'] = s['margin-top'] = s['margin-left'] = s['margin-bottom'] = s['margin-right'] = 0
109
+ # padding
110
+ s['padding'] = s['padding-top'] = s['padding-left'] = s['padding-bottom'] = s['padding-right'] = 0
111
+ # shadows
112
+ s['text-shadow'] = s['box-shadow'] = 'none'
113
+ # width/height
114
+ s['height'] = s['width'] = 'auto'
115
+ s['min-width'] = s['max-width'] = s['min-height'] = s['max-height'] = 'none'
116
+ # position
117
+ s['position'] = 'static'
118
+ s['top'] = s['right'] = s['bottom'] = s['left'] = 'auto'
119
+ s['clear'] = s['float'] = 'none'
120
+ # misc
121
+ s['overflow'] = 'visible'
122
+ s['opacity'] = 1
123
+ s['visibility'] = 'visible'
124
+ s['ie-filter'] = 'gradient(enabled=false)'
125
+ s['z-index'] = 0
126
+ # --------------------
127
+ @css_defaults = s
128
+ end
129
+ value = @css_defaults[key]
130
+ value = Sass::Script::String.new(value) if value.is_a? String
131
+ value = Sass::Script::Number.new(value) if value.is_a? Numeric
132
+ return value
133
+ end
134
+ end
135
+
136
+ # this shims the Hash functionality to ensure we have an ordered hash guarantee
137
+ module Archetype
138
+ if RUBY_VERSION < '1.9'
139
+ require 'hashery/ordered_hash'
140
+ class Hash < Hashery::OrderedHash
141
+ include Archetype::Functions::Hash
142
+ end
143
+ else
144
+ class Hash < ::Hash
145
+ include Archetype::Functions::Hash
146
+ end
147
+ end
148
+ end
149
+
@@ -0,0 +1,125 @@
1
+ # :stopdoc:
2
+ # This module provides a set of helper functions and methods for working with Sass literals.
3
+ #
4
+ module Archetype::Functions::Helpers
5
+ private
6
+
7
+ #
8
+ # provides a convenience interface to the Compass::Logger
9
+ #
10
+ def self.logger
11
+ @logger ||= Compass::Logger.new
12
+ end
13
+
14
+ #
15
+ # convert a Hash to a Sass::List
16
+ #
17
+ # *Parameters*:
18
+ # - <tt>hsh</tt> {Hash} the hash to convert
19
+ # - <tt>depth</tt> {Integer} the depth to walk down into the hash
20
+ # - <tt>separator</tt> {Symbol} the separator to use for the Sass::List
21
+ # *Returns*:
22
+ # - {Sass::List} the converted list
23
+ #
24
+ def self.hash_to_list(hsh, depth = 0, separator = :comma)
25
+ if hsh.is_a? Hash
26
+ list = []
27
+ hsh.each do |key, item|
28
+ item = [key, item]
29
+ # if its a hash, convert it to a List
30
+ if item.is_a? Hash or item.is_a? Array
31
+ tmp = []
32
+ item[1] = [item[1]] if not item[1].is_a? Array
33
+ item[1].each do |i|
34
+ list.push Sass::Script::List.new([Sass::Script::String.new(item[0]), hash_to_list(i, depth + 1)], separator)
35
+ end
36
+ end
37
+ end
38
+ return Sass::Script::List.new(list, separator)
39
+ end
40
+ # if its an array, cast to a List
41
+ return Sass::Script::List.new(hsh, separator) if hsh.is_a? Array
42
+ # otherwise just return it
43
+ return hsh
44
+ end
45
+
46
+ #
47
+ # convert a Sass::List to a Hash
48
+ #
49
+ # *Parameters*:
50
+ # - <tt>list</tt> {Sass::List} the list to convert
51
+ # - <tt>depth</tt> {Integer} the depth to reach into nested Lists
52
+ # - <tt>nest</tt> {Array} a list of keys to treat as nested objects
53
+ # *Returns*:
54
+ # - {Hash} the converted hash
55
+ #
56
+ def self.list_to_hash(list, depth = 0, nest = [], additives = [])
57
+ list = list.to_a
58
+ hsh = Archetype::Hash.new
59
+ list.each do |item|
60
+ item = item.to_a
61
+ # convert the key to a string and strip off quotes
62
+ key = to_str(item[0], ' ' , :quotes)
63
+ value = item[1]
64
+ if key != 'nil'
65
+ # check if if it's a nesting hash
66
+ nested = nest.include?(key)
67
+ # if it's nested or we haven't reached out depth, recurse
68
+ if nested or depth > 0
69
+ value = list_to_hash(value, nested ? depth + 1 : depth - 1, nest, additives)
70
+ end
71
+ # update the hash key
72
+ if not is_value(value, :blank)
73
+ if additives.include?(key)
74
+ hsh[key] ||= []
75
+ hsh[key].push(value)
76
+ else
77
+ hsh[key] = value
78
+ end
79
+ end
80
+ end
81
+ end
82
+ return hsh
83
+ end
84
+
85
+ #
86
+ # convert things to a String
87
+ #
88
+ # *Parameters*:
89
+ # - <tt>value</tt> {String|Sass::String|Sass::List} the thing to convert
90
+ # - <tt>separator</tt> {String} the separator to use for joining Sass::List
91
+ # *Returns*:
92
+ # - {String} the converted String
93
+ #
94
+ def self.to_str(value, separator = ' ', strip = nil)
95
+ value = value.is_a?(String) ? value : ((value.to_a).each{ |i| i.is_a?(String) ? i : i.value }).join(separator || '')
96
+ strip = /\A"|"\Z/ if strip == :quotes
97
+ return strip.nil? ? value : value.gsub(strip, '')
98
+ end
99
+
100
+ #
101
+ # test a value for blankness or nilness
102
+ #
103
+ # *Parameters*:
104
+ # - <tt>value</tt> {String|Array|Sass::String|Sass::List} the thing to test
105
+ # - <tt>test</tt> {Symbol} the test to perform [:blank|:nil]
106
+ # *Returns*:
107
+ # - {Boolean} whether or not the value is nil/blank
108
+ #
109
+ def self.is_value(value, test = :nil)
110
+ is_it = nil
111
+ case test
112
+ when :blank
113
+ is_it = false
114
+ value = value.value if value.is_a?(Sass::Script::String)
115
+ is_it = value.empty? if value.is_a?(String)
116
+ is_it = value.to_a.empty? if value.is_a?(Sass::Script::List) or value.is_a?(Array)
117
+ when :nil
118
+ is_it = false
119
+ value = value.value if value.is_a?(Sass::Script::String)
120
+ is_it = value == 'nil' if value.is_a?(String)
121
+ is_it = to_str(value) == 'nil' if value.is_a?(Sass::Script::List) or value.is_a?(Array)
122
+ end
123
+ return is_it
124
+ end
125
+ end