woo 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +20 -0
  4. data/app/assets/fonts/styleguide/styleguide.eot +0 -0
  5. data/app/assets/fonts/styleguide/styleguide.json +231 -0
  6. data/app/assets/fonts/styleguide/styleguide.svg +18 -0
  7. data/app/assets/fonts/styleguide/styleguide.ttf +0 -0
  8. data/app/assets/fonts/styleguide/styleguide.woff +0 -0
  9. data/app/assets/javascripts/styleguide/application.js +18555 -0
  10. data/app/assets/stylesheets/styleguide/application.css.scss +20 -0
  11. data/app/assets/stylesheets/styleguide/config/_colors.scss +47 -0
  12. data/app/assets/stylesheets/styleguide/config/_fonts.scss +14 -0
  13. data/app/assets/stylesheets/styleguide/config/_icons.scss +20 -0
  14. data/app/assets/stylesheets/styleguide/config/_media-queries.scss +31 -0
  15. data/app/assets/stylesheets/styleguide/config/_settings.scss +1 -0
  16. data/app/assets/stylesheets/styleguide/lib/_animation-mixins.scss +49 -0
  17. data/app/assets/stylesheets/styleguide/lib/_functions.scss +13 -0
  18. data/app/assets/stylesheets/styleguide/lib/_icon-factory.scss +58 -0
  19. data/app/assets/stylesheets/styleguide/mixins/_color-block.scss +24 -0
  20. data/app/assets/stylesheets/styleguide/mixins/_hover-border.scss +15 -0
  21. data/app/assets/stylesheets/styleguide/partials/_main.scss +268 -0
  22. data/app/controllers/styleguide/application_controller.rb +4 -0
  23. data/app/controllers/styleguide/styleguide_controller.rb +16 -0
  24. data/app/helpers/styleguide/application_helper.rb +4 -0
  25. data/app/helpers/styleguide/styleguide_helper.rb +71 -0
  26. data/app/views/layouts/styleguide/application.html.haml +13 -0
  27. data/app/views/styleguide/shared/_navigation.html.haml +26 -0
  28. data/app/views/styleguide/shared/_navigation_link.html.haml +2 -0
  29. data/app/views/styleguide/shared/_single_page.html.haml +21 -0
  30. data/app/views/styleguide/styleguide/index.html.haml +3 -0
  31. data/config/routes.rb +3 -0
  32. data/lib/styleguide/engine.rb +12 -0
  33. data/lib/styleguide/version.rb +3 -0
  34. data/lib/styleguide.rb +7 -0
  35. data/lib/tasks/styleguide_tasks.rake +4 -0
  36. data/spec/dummy/README.rdoc +28 -0
  37. data/spec/dummy/Rakefile +6 -0
  38. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  39. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  40. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  41. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  42. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  43. data/spec/dummy/bin/bundle +3 -0
  44. data/spec/dummy/bin/rails +4 -0
  45. data/spec/dummy/bin/rake +4 -0
  46. data/spec/dummy/config/application.rb +23 -0
  47. data/spec/dummy/config/boot.rb +5 -0
  48. data/spec/dummy/config/database.yml +25 -0
  49. data/spec/dummy/config/environment.rb +5 -0
  50. data/spec/dummy/config/environments/development.rb +37 -0
  51. data/spec/dummy/config/environments/production.rb +78 -0
  52. data/spec/dummy/config/environments/test.rb +39 -0
  53. data/spec/dummy/config/initializers/assets.rb +8 -0
  54. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  55. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  56. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  57. data/spec/dummy/config/initializers/inflections.rb +16 -0
  58. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  59. data/spec/dummy/config/initializers/session_store.rb +3 -0
  60. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  61. data/spec/dummy/config/locales/en.yml +23 -0
  62. data/spec/dummy/config/routes.rb +3 -0
  63. data/spec/dummy/config/secrets.yml +22 -0
  64. data/spec/dummy/config.ru +4 -0
  65. data/spec/dummy/db/test.sqlite3 +0 -0
  66. data/spec/dummy/log/test.log +358 -0
  67. data/spec/dummy/public/404.html +67 -0
  68. data/spec/dummy/public/422.html +67 -0
  69. data/spec/dummy/public/500.html +66 -0
  70. data/spec/dummy/public/favicon.ico +0 -0
  71. data/spec/dummy/tmp/cache/assets/test/sass/1801d541a5989ffaf7492457e257ec09b687cdef/_animation-mixins.scssc +0 -0
  72. data/spec/dummy/tmp/cache/assets/test/sass/1801d541a5989ffaf7492457e257ec09b687cdef/_functions.scssc +0 -0
  73. data/spec/dummy/tmp/cache/assets/test/sass/1801d541a5989ffaf7492457e257ec09b687cdef/_icon-factory.scssc +0 -0
  74. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_animation.scssc +0 -0
  75. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_appearance.scssc +0 -0
  76. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_backface-visibility.scssc +0 -0
  77. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_background-image.scssc +0 -0
  78. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_background.scssc +0 -0
  79. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_border-image.scssc +0 -0
  80. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_border-radius.scssc +0 -0
  81. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_box-sizing.scssc +0 -0
  82. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_calc.scssc +0 -0
  83. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_columns.scssc +0 -0
  84. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_filter.scssc +0 -0
  85. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_flex-box.scssc +0 -0
  86. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_font-face.scssc +0 -0
  87. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_font-feature-settings.scssc +0 -0
  88. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_hidpi-media-query.scssc +0 -0
  89. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_hyphens.scssc +0 -0
  90. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_image-rendering.scssc +0 -0
  91. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_inline-block.scssc +0 -0
  92. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_keyframes.scssc +0 -0
  93. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_linear-gradient.scssc +0 -0
  94. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_perspective.scssc +0 -0
  95. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_placeholder.scssc +0 -0
  96. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_radial-gradient.scssc +0 -0
  97. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_transform.scssc +0 -0
  98. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_transition.scssc +0 -0
  99. data/spec/dummy/tmp/cache/assets/test/sass/2708ff5ff5ba63039f9a086efdcf7c87d1a66b67/_user-select.scssc +0 -0
  100. data/spec/dummy/tmp/cache/assets/test/sass/2b2790ec8b4cd70e250a13b83f1c029cb40c65fd/_main.scssc +0 -0
  101. data/spec/dummy/tmp/cache/assets/test/sass/38b68d2bc0adfc5c693bdbe45080166bf5ba79fe/_gradient-positions-parser.scssc +0 -0
  102. data/spec/dummy/tmp/cache/assets/test/sass/38b68d2bc0adfc5c693bdbe45080166bf5ba79fe/_linear-positions-parser.scssc +0 -0
  103. data/spec/dummy/tmp/cache/assets/test/sass/38b68d2bc0adfc5c693bdbe45080166bf5ba79fe/_radial-arg-parser.scssc +0 -0
  104. data/spec/dummy/tmp/cache/assets/test/sass/38b68d2bc0adfc5c693bdbe45080166bf5ba79fe/_radial-positions-parser.scssc +0 -0
  105. data/spec/dummy/tmp/cache/assets/test/sass/38b68d2bc0adfc5c693bdbe45080166bf5ba79fe/_render-gradients.scssc +0 -0
  106. data/spec/dummy/tmp/cache/assets/test/sass/38b68d2bc0adfc5c693bdbe45080166bf5ba79fe/_shape-size-stripper.scssc +0 -0
  107. data/spec/dummy/tmp/cache/assets/test/sass/3e654c1f9e7d6749b1bdb09c28dbfd60292cf201/_bourbon-deprecated-upcoming.scssc +0 -0
  108. data/spec/dummy/tmp/cache/assets/test/sass/3e654c1f9e7d6749b1bdb09c28dbfd60292cf201/_bourbon.scssc +0 -0
  109. data/spec/dummy/tmp/cache/assets/test/sass/3e924086eaf4a69990f259d1480dde032b0049c0/_color-block.scssc +0 -0
  110. data/spec/dummy/tmp/cache/assets/test/sass/3e924086eaf4a69990f259d1480dde032b0049c0/_hover-border.scssc +0 -0
  111. data/spec/dummy/tmp/cache/assets/test/sass/6ae24caf21d9a373ddab51a973badb8787d497db/_button.scssc +0 -0
  112. data/spec/dummy/tmp/cache/assets/test/sass/6ae24caf21d9a373ddab51a973badb8787d497db/_clearfix.scssc +0 -0
  113. data/spec/dummy/tmp/cache/assets/test/sass/6ae24caf21d9a373ddab51a973badb8787d497db/_directional-values.scssc +0 -0
  114. data/spec/dummy/tmp/cache/assets/test/sass/6ae24caf21d9a373ddab51a973badb8787d497db/_ellipsis.scssc +0 -0
  115. data/spec/dummy/tmp/cache/assets/test/sass/6ae24caf21d9a373ddab51a973badb8787d497db/_font-family.scssc +0 -0
  116. data/spec/dummy/tmp/cache/assets/test/sass/6ae24caf21d9a373ddab51a973badb8787d497db/_hide-text.scssc +0 -0
  117. data/spec/dummy/tmp/cache/assets/test/sass/6ae24caf21d9a373ddab51a973badb8787d497db/_html5-input-types.scssc +0 -0
  118. data/spec/dummy/tmp/cache/assets/test/sass/6ae24caf21d9a373ddab51a973badb8787d497db/_position.scssc +0 -0
  119. data/spec/dummy/tmp/cache/assets/test/sass/6ae24caf21d9a373ddab51a973badb8787d497db/_prefixer.scssc +0 -0
  120. data/spec/dummy/tmp/cache/assets/test/sass/6ae24caf21d9a373ddab51a973badb8787d497db/_retina-image.scssc +0 -0
  121. data/spec/dummy/tmp/cache/assets/test/sass/6ae24caf21d9a373ddab51a973badb8787d497db/_size.scssc +0 -0
  122. data/spec/dummy/tmp/cache/assets/test/sass/6ae24caf21d9a373ddab51a973badb8787d497db/_timing-functions.scssc +0 -0
  123. data/spec/dummy/tmp/cache/assets/test/sass/6ae24caf21d9a373ddab51a973badb8787d497db/_triangle.scssc +0 -0
  124. data/spec/dummy/tmp/cache/assets/test/sass/6ae24caf21d9a373ddab51a973badb8787d497db/_word-wrap.scssc +0 -0
  125. data/spec/dummy/tmp/cache/assets/test/sass/be657e1ebe76b4319695275b777559a635f0eb0b/_color-lightness.scssc +0 -0
  126. data/spec/dummy/tmp/cache/assets/test/sass/be657e1ebe76b4319695275b777559a635f0eb0b/_flex-grid.scssc +0 -0
  127. data/spec/dummy/tmp/cache/assets/test/sass/be657e1ebe76b4319695275b777559a635f0eb0b/_golden-ratio.scssc +0 -0
  128. data/spec/dummy/tmp/cache/assets/test/sass/be657e1ebe76b4319695275b777559a635f0eb0b/_grid-width.scssc +0 -0
  129. data/spec/dummy/tmp/cache/assets/test/sass/be657e1ebe76b4319695275b777559a635f0eb0b/_linear-gradient.scssc +0 -0
  130. data/spec/dummy/tmp/cache/assets/test/sass/be657e1ebe76b4319695275b777559a635f0eb0b/_modular-scale.scssc +0 -0
  131. data/spec/dummy/tmp/cache/assets/test/sass/be657e1ebe76b4319695275b777559a635f0eb0b/_px-to-em.scssc +0 -0
  132. data/spec/dummy/tmp/cache/assets/test/sass/be657e1ebe76b4319695275b777559a635f0eb0b/_px-to-rem.scssc +0 -0
  133. data/spec/dummy/tmp/cache/assets/test/sass/be657e1ebe76b4319695275b777559a635f0eb0b/_radial-gradient.scssc +0 -0
  134. data/spec/dummy/tmp/cache/assets/test/sass/be657e1ebe76b4319695275b777559a635f0eb0b/_strip-units.scssc +0 -0
  135. data/spec/dummy/tmp/cache/assets/test/sass/be657e1ebe76b4319695275b777559a635f0eb0b/_tint-shade.scssc +0 -0
  136. data/spec/dummy/tmp/cache/assets/test/sass/be657e1ebe76b4319695275b777559a635f0eb0b/_transition-property-name.scssc +0 -0
  137. data/spec/dummy/tmp/cache/assets/test/sass/be657e1ebe76b4319695275b777559a635f0eb0b/_unpack.scssc +0 -0
  138. data/spec/dummy/tmp/cache/assets/test/sass/c7efa635f3444096ac687dd06020550ba563f393/application.css.scssc +0 -0
  139. data/spec/dummy/tmp/cache/assets/test/sass/d4acd46669bf2e39dd28e0f4309fe901dcf2ed06/_asset-pipeline.scssc +0 -0
  140. data/spec/dummy/tmp/cache/assets/test/sass/d4acd46669bf2e39dd28e0f4309fe901dcf2ed06/_prefixer.scssc +0 -0
  141. data/spec/dummy/tmp/cache/assets/test/sass/d4acd46669bf2e39dd28e0f4309fe901dcf2ed06/_px-to-em.scssc +0 -0
  142. data/spec/dummy/tmp/cache/assets/test/sass/e392f4294bba0348ea805db6c9152599a2b26b74/_colors.scssc +0 -0
  143. data/spec/dummy/tmp/cache/assets/test/sass/e392f4294bba0348ea805db6c9152599a2b26b74/_fonts.scssc +0 -0
  144. data/spec/dummy/tmp/cache/assets/test/sass/e392f4294bba0348ea805db6c9152599a2b26b74/_icons.scssc +0 -0
  145. data/spec/dummy/tmp/cache/assets/test/sass/e392f4294bba0348ea805db6c9152599a2b26b74/_media-queries.scssc +0 -0
  146. data/spec/dummy/tmp/cache/assets/test/sass/e392f4294bba0348ea805db6c9152599a2b26b74/_settings.scssc +0 -0
  147. data/spec/dummy/tmp/cache/assets/test/sprockets/04acbf5b33b91aa9da1943504eb5afa6 +0 -0
  148. data/spec/dummy/tmp/cache/assets/test/sprockets/1d71d75773f417dbe9b7b77720cdb863 +0 -0
  149. data/spec/dummy/tmp/cache/assets/test/sprockets/228fa94ec3fb3dab5b949ebf68147c9c +0 -0
  150. data/spec/dummy/tmp/cache/assets/test/sprockets/2c7c521501ccfa2acf525bdd77bf3f0a +0 -0
  151. data/spec/dummy/tmp/cache/assets/test/sprockets/376f2aaa806b203d9629b538d1f3c165 +0 -0
  152. data/spec/dummy/tmp/cache/assets/test/sprockets/5984a3df242d59c074b99565aabfc410 +0 -0
  153. data/spec/dummy/tmp/cache/assets/test/sprockets/68a1be219c5f28abde8e508743098849 +0 -0
  154. data/spec/dummy/tmp/cache/assets/test/sprockets/6f8710a7961b83ff2f0745974af3bbc2 +0 -0
  155. data/spec/dummy/tmp/cache/assets/test/sprockets/7eebe4bfaea24e43176732eb5b1c7a1b +0 -0
  156. data/spec/dummy/tmp/cache/assets/test/sprockets/8de6884091cb5b477f1e1e39a7db8119 +0 -0
  157. data/spec/dummy/tmp/cache/assets/test/sprockets/9493130ae6146f32012d474e534555b8 +0 -0
  158. data/spec/dummy/tmp/cache/assets/test/sprockets/b0becd2e3c00668ba309cf65af87e46c +0 -0
  159. data/spec/dummy/tmp/cache/assets/test/sprockets/b27a6ff083e857238d42243a6084f88b +0 -0
  160. data/spec/dummy/tmp/cache/assets/test/sprockets/cd5dcbe2dba335440a63df3c8073b88f +0 -0
  161. data/spec/dummy/tmp/cache/assets/test/sprockets/d72fa45a91193cbd01c52087bdf48251 +0 -0
  162. data/spec/dummy/tmp/cache/assets/test/sprockets/e80af8c6904d4e4a9c5bbfe63774211b +0 -0
  163. data/spec/dummy/tmp/cache/assets/test/sprockets/f12901ffadce417983ed7b4b5b824ce7 +0 -0
  164. data/spec/dummy/tmp/cache/assets/test/sprockets/fc498c3fcba98bece9d2c0f8e8cc7add +0 -0
  165. data/spec/features/styleguide_spec.rb +46 -0
  166. data/spec/spec_helper.rb +18 -0
  167. metadata +522 -0
@@ -0,0 +1,20 @@
1
+ @import "bourbon";
2
+
3
+ // config
4
+ @import "styleguide/config/colors";
5
+ @import "styleguide/config/fonts";
6
+ @import "styleguide/config/icons";
7
+ @import "styleguide/config/settings";
8
+ @import "styleguide/config/media-queries";
9
+
10
+ // My lyberries
11
+ @import "styleguide/lib/functions";
12
+ @import "styleguide/lib/animation-mixins";
13
+ @import "styleguide/lib/icon-factory";
14
+
15
+ // Mixins
16
+ @import "styleguide/mixins/color-block";
17
+ @import "styleguide/mixins/hover-border";
18
+
19
+ // partials
20
+ @import "styleguide/partials/main";
@@ -0,0 +1,47 @@
1
+ /******************************************************************************/
2
+ // config/_colors.scss
3
+ //
4
+ // DESCRIPTION: Establishes the brand colors. Only colors relative to the brand
5
+ // definition live here.
6
+ //
7
+
8
+ $black: #41414e;
9
+ $white: #e6e7ec;
10
+
11
+ $grey: #e7e8ea;
12
+ $dark-grey: #48505f;
13
+
14
+ $off-white: #f7f7f7;
15
+
16
+ $green: #7fc35f;
17
+ $light-green: #cfe7cd;
18
+
19
+ $yellow: #f08a24;
20
+
21
+ $red: #ed5770;
22
+
23
+ $primary-color: #f35656;
24
+ $secondary-color: $grey;
25
+ $alert-color: $red;
26
+ $success-color: $green;
27
+ $warning-color: $yellow;
28
+ $info-color: #a0d3e8;
29
+
30
+
31
+ // color implementation
32
+ $body-background-color: $white;
33
+ $light-text-color: rgba($white, .35);
34
+
35
+ // navigation
36
+ $nav-border-color: $primary-color;
37
+ $nav-menu-icon-color: $primary-color;
38
+ $nav-link-color: $light-text-color;
39
+ $nav-link-hover-color: $light-text-color;
40
+ $nav-link-hr-color: $light-text-color;
41
+
42
+ // @mixin color-block
43
+ $colors-border: rgba($dark-grey, .25);
44
+ $colors-h5-background-color: $grey;
45
+
46
+ // @mixin hover-border
47
+ $hover-border-background-color: $red;
@@ -0,0 +1,14 @@
1
+ /******************************************************************************/
2
+ // config/_fonts.scss
3
+ //
4
+ // DESCRIPTION: Loading of font files and their font-stack variables.
5
+ //
6
+ //
7
+ @import url(http://fonts.googleapis.com/css?family=Source+Code+Pro);
8
+ @import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,300italic,400italic,700italic);
9
+
10
+ //
11
+ // Styleguide font-family overrides
12
+ $header-font: 'Source Sans Pro', sans-serif;
13
+ $body-font: 'Source Sans Pro', Helvetica, sans-serif;
14
+ $code-font: 'Source Code Pro', Fixed, monospace;
@@ -0,0 +1,20 @@
1
+ /******************************************************************************/
2
+ // config/_icons.scss
3
+ //
4
+ // DESCRIPTION: Configuration for the icon fonts
5
+ //
6
+ // $icon-name: the base filename for the icon font
7
+ // $icon-path: the relative path to the icon font file (used in asset-path)
8
+ // $icons: list of names and character maps used in the icon class and mixin
9
+
10
+ $icon-name: 'styleguide';
11
+ $icon-path: 'styleguide/';
12
+
13
+ $icons: mobile "\e000",
14
+ expand "\e110",
15
+ close "\e117",
16
+ page "\e124",
17
+ menu "\e601",
18
+ arrow-right "\e603",
19
+ arrow-down "\e604",
20
+ arrow-up "\e605";
@@ -0,0 +1,31 @@
1
+ // Media Query Ranges
2
+ $small-range: (0em, 40em);
3
+ $medium-range: (40.063em, 64em);
4
+ $large-range: (64.063em, 90em);
5
+ $xlarge-range: (90.063em, 120em);
6
+ $xxlarge-range: (120.063em);
7
+
8
+ $screen: "only screen";
9
+
10
+ $landscape: "#{$screen} and (orientation: landscape)";
11
+ $portrait: "#{$screen} and (orientation: portrait)";
12
+
13
+ $small-up: $screen;
14
+ $small-only: "#{$screen} and (max-width: #{upper-bound($small-range)})";
15
+
16
+ $medium-up: "#{$screen} and (min-width:#{lower-bound($medium-range)})";
17
+ $medium-only: "#{$screen} and (min-width:#{lower-bound($medium-range)}) and (max-width:#{upper-bound($medium-range)})";
18
+
19
+ $large-up: "#{$screen} and (min-width:#{lower-bound($large-range)})";
20
+ $large-only: "#{$screen} and (min-width:#{lower-bound($large-range)}) and (max-width:#{upper-bound($large-range)})";
21
+
22
+ $xlarge-up: "#{$screen} and (min-width:#{lower-bound($xlarge-range)})";
23
+ $xlarge-only: "#{$screen} and (min-width:#{lower-bound($xlarge-range)}) and (max-width:#{upper-bound($xlarge-range)})";
24
+
25
+ $xxlarge-up: "#{$screen} and (min-width:#{lower-bound($xxlarge-range)})";
26
+ $xxlarge-only: "#{$screen} and (min-width:#{lower-bound($xxlarge-range)}) and (max-width:#{upper-bound($xxlarge-range)})";
27
+
28
+ // Legacy
29
+ $small: $medium-up;
30
+ $medium: $medium-up;
31
+ $large: $large-up;
@@ -0,0 +1 @@
1
+ $global-radius: 3px;
@@ -0,0 +1,49 @@
1
+ /******************************************************************************/
2
+ // _animation.scss
3
+ //
4
+ // DESCRIPTION: a set of mixins to simplify cross-browser animation
5
+
6
+ $vendor: '', '-webkit-', '-moz-', '-ms-', '-o-';
7
+
8
+ @mixin animation-timing-function($name) {
9
+ @each $prefix in $vendor {
10
+ #{$prefix}animation-timing-function: $name;
11
+ }
12
+ }
13
+
14
+ @mixin animation-name($name) {
15
+ @each $prefix in $vendor {
16
+ #{$prefix}animation-name: $name;
17
+ }
18
+ }
19
+
20
+ @mixin animation-fill-mode($mode) {
21
+ @each $prefix in $vendor {
22
+ #{$prefix}animation-fill-mode: $mode;
23
+ }
24
+ }
25
+
26
+ @mixin animation-duration($duration) {
27
+ @each $prefix in $vendor {
28
+ #{$prefix}animation-duration: $duration;
29
+ }
30
+ }
31
+
32
+ @mixin animation-iteration-count($value) {
33
+ @each $prefix in $vendor {
34
+ #{$prefix}animation-iteration-count: $value;
35
+ }
36
+ }
37
+
38
+ @mixin animation-delay($value) {
39
+ @each $prefix in $vendor {
40
+ #{$prefix}animation-delay: $value;
41
+ }
42
+ }
43
+
44
+ @mixin keyframes($name) {
45
+ @-webkit-keyframes #{$name} { @content; }
46
+ @-moz-keyframes #{$name} { @content; }
47
+ @-ms-keyframes #{$name} { @content; }
48
+ @keyframes #{$name} { @content; }
49
+ }
@@ -0,0 +1,13 @@
1
+ /******************************************************************************/
2
+ // function.scss
3
+ //
4
+ // DESCRIPTION: Generic functions for use throughout the SCSS
5
+
6
+ @function get-list-value($list, $key) {
7
+ @each $item in $list {
8
+ @if ($key == nth($item, 1)) {
9
+ @return nth($item, 2);
10
+ }
11
+ }
12
+ @return false;
13
+ }
@@ -0,0 +1,58 @@
1
+ /******************************************************************************/
2
+ // _icons.scss
3
+ //
4
+ // DESCRIPTION: Loads the icon font, generates icon classes, and creates an
5
+ // icon() mixin to be used within CSS.
6
+ //
7
+ // Configuration for this file is in config/_icons.scss
8
+ @include font-face($icon-name, "#{$icon-path}#{$icon-name}", $asset-pipeline: true);
9
+
10
+ %icon-font-#{$icon-name} {
11
+ font-family: $icon-name;
12
+ speak: none;
13
+ font-variant: normal;
14
+ font-style: normal;
15
+ font-weight: normal;
16
+ text-transform: none;
17
+ line-height: 1;
18
+ -webkit-font-smoothing: antialiased;
19
+ }
20
+
21
+ $icon-prefix: '' !default;
22
+ @if $icon-prefix { $icon-prefix: "-#{$icon-prefix}"; }
23
+
24
+ /* Use the following CSS code if you want to use data attributes for inserting your icons */
25
+ [data-icon]:before {
26
+ @extend %icon-font-#{$icon-name};
27
+ content: attr(data-icon);
28
+ }
29
+
30
+ .button > [class*="icon-"] { margin-right: rem-calc(5); }
31
+
32
+ [class*="icon#{$icon-prefix}-"] {
33
+ @extend %icon-font-#{$icon-name};
34
+ background: none;
35
+ &:active { text-decoration: none; }
36
+ }
37
+
38
+ @each $icon in $icons {
39
+ .icon#{$icon-prefix}-#{nth($icon, 1)}:before { content: '#{nth($icon, 2)}' }
40
+ }
41
+
42
+ // Helpers
43
+ @mixin icon($icon) {
44
+ $char-code: get-list-value($icons, $icon);
45
+ @extend %icon-font-#{$icon-name};
46
+ content: "#{$char-code}";
47
+ }
48
+
49
+ // Adds the specified icon to the specified pseudo class
50
+ @mixin inline-icon($icon-name: '', $color: inherit, $pseudo: before, $font-size: false, $margin: 0, $padding: 0) {
51
+ &:#{$pseudo} {
52
+ @include icon($icon-name);
53
+ @if $font-size { font-size: $font-size; }
54
+ color: $color;
55
+ margin: $margin;
56
+ padding: $padding;
57
+ }
58
+ }
@@ -0,0 +1,24 @@
1
+ $colors-border: rgba($dark-grey, .25) !default;
2
+ $colors-h5-background-color: $grey !default;
3
+
4
+ @mixin color-block($color) {
5
+ .color {
6
+ @include box-shadow(0 0 0 1px $colors-border);
7
+ background-color: $color;
8
+ min-height: 100px;
9
+ }
10
+ h5 {
11
+ @include inline-block;
12
+ background-color: $colors-h5-background-color;
13
+ border-radius: $global-radius;
14
+ font-size: 13px;
15
+ font-family: $code-font;
16
+ padding: 2px 5px 3px;
17
+ }
18
+ h5:after {
19
+ @include inline-block;
20
+ content: ": #{$color};";
21
+ vertical-align: baseline;
22
+ position: relative;
23
+ }
24
+ }
@@ -0,0 +1,15 @@
1
+ @mixin hover-border($pseudo: before, $width: 5px, $background-color: $hover-border-background-color) {
2
+ $modifier: left;
3
+ @if $pseudo == after { $modifier: right; }
4
+ &:#{$pseudo} {
5
+ @include transition(all .3s ease);
6
+ #{$modifier}: 0;
7
+ background-color: $background-color;
8
+ bottom: 0;
9
+ content: '';
10
+ position: absolute;
11
+ top: 0;
12
+ width: $width;
13
+ z-index: 100;
14
+ }
15
+ }
@@ -0,0 +1,268 @@
1
+
2
+ // Colors
3
+ //
4
+ // Notes
5
+ $notes-section-background-color: rgba($white, .85);
6
+ $notes-background-color: $white;
7
+
8
+ // Smoove dem fonts!
9
+ * { -webkit-font-smoothing: antialiased; }
10
+
11
+ #styleguide-rails {
12
+ background: $black;
13
+ padding: 0;
14
+ margin: 0;
15
+ font-family: $body-font;
16
+
17
+ &.open nav,
18
+ nav.near-menu { border-left: 5px solid $primary-color; }
19
+
20
+ &.open {
21
+ nav {
22
+ background-color: darken($black, 5%);
23
+ overflow-y: auto;
24
+ overflow-x: hidden;
25
+ pointer-events: auto;
26
+ top: 0;
27
+ width: 300px;
28
+
29
+ a { @include box-shadow(0 1px 0 0 $black); }
30
+
31
+ .menu { @include inline-icon('close'); }
32
+ .nav-item { opacity: 1; }
33
+ .nav-item-list{ background: $black; }
34
+ }
35
+ }
36
+
37
+ //
38
+ // NAVIGATION
39
+ // ******************************************************************
40
+ nav {
41
+ @include transition(all .3s ease);
42
+ background-color: transparent;
43
+ border-left: 0px solid $nav-border-color;
44
+ display: block;
45
+ font-size: 0.8em;
46
+ left: 0;
47
+ bottom: 0;
48
+ padding: 0;
49
+ position: fixed;
50
+ text-align: left;
51
+ top: 0;
52
+ width: 10px;
53
+ z-index: 1000;
54
+
55
+ a.menu {
56
+ @include transition(all .3s ease);
57
+ @include inline-icon('menu');
58
+
59
+ pointer-events: auto;
60
+ color: $nav-menu-icon-color;
61
+ display: block;
62
+ font-size: 1.2em;
63
+ line-height: 2em;
64
+ margin-right: 0;
65
+ text-align: right;
66
+ z-index: 1000;
67
+ span { display: none; }
68
+
69
+ &:hover { @include box-shadow(none); }
70
+ }
71
+
72
+ .nav-item {
73
+ @include transition(all .3s ease .2s);
74
+ opacity: 0;
75
+
76
+ &.open {
77
+ .nav-item-title {
78
+ color: $white;
79
+ &:after { @include icon('arrow-down'); }
80
+ }
81
+ ul.nav-item-list { display: block; }
82
+ }
83
+
84
+ .nav-item-title {
85
+ @include transition(all .3s ease);
86
+ font-weight: 500;
87
+ margin-bottom: 1px;
88
+ text-transform: uppercase;
89
+
90
+ &:after {
91
+ @include icon('arrow-up');
92
+ position: absolute;
93
+ right: 20px;
94
+ }
95
+ }
96
+ }
97
+
98
+ a {
99
+ @include transition(all .3s ease);
100
+ @include box-shadow(0 1px 0 0 transparent);
101
+ color: $nav-link-color;
102
+ font-family: $header-font;
103
+ font-size: 1em;
104
+ display: block;
105
+ padding: 20px;
106
+ &:hover {
107
+ color: $nav-link-hover-color;
108
+ }
109
+ }
110
+
111
+ .nav-item-list {
112
+ @include transition(all .3s ease);
113
+ background-color: transparent;
114
+ display: none;
115
+ overflow: hidden;
116
+ padding: 10px 0;
117
+ margin: 0;
118
+
119
+ li {
120
+ display: block;
121
+ &:last-child { margin-right: 0; }
122
+
123
+ a {
124
+ font-size: 13px;
125
+ padding-left: 45px;
126
+ position: relative;
127
+ &:before {
128
+ @include box-shadow(inset 0 0 0 1px $nav-link-hr-color);
129
+ border-radius: 1000px;
130
+ left: 25px;
131
+ position: absolute;
132
+ width: 10px;
133
+ height: 10px;
134
+ content: '';
135
+ font-size: 10px;
136
+ vertical-align: top;
137
+ margin-top: 4px;
138
+ }
139
+ }
140
+ }
141
+ }
142
+ }
143
+
144
+
145
+ //
146
+ // COLORS
147
+ // ******************************************************************
148
+
149
+ .colors {
150
+ // @include block-grid(1);
151
+ li {
152
+ // base colors
153
+ &.green { @include color-block($green); }
154
+ &.grey { @include color-block($grey); }
155
+ &.dark-grey { @include color-block($dark-grey); }
156
+ &.off-white { @include color-block($off-white); }
157
+ &.white { @include color-block($white); }
158
+
159
+ // component colors
160
+ &.primary-color { @include color-block($primary-color); }
161
+ &.secondary-color { @include color-block($secondary-color); }
162
+ &.alert-color { @include color-block($alert-color); }
163
+ &.success-color { @include color-block($success-color); }
164
+ &.warning-color { @include color-block($warning-color); }
165
+ &.info-color { @include color-block($info-color); }
166
+ }
167
+ @media #{$small} {
168
+ // @include block-grid(3);
169
+ }
170
+ }
171
+
172
+
173
+ //
174
+ // BLOCK
175
+ // ******************************************************************
176
+
177
+ dl.styleguide {
178
+ margin: 200px 0;
179
+ position: relative;
180
+
181
+ a[name] {
182
+ height: 0;
183
+ padding: 0;
184
+ margin: 0;
185
+ }
186
+ dt.page-title {
187
+ background-color: rgba($white, .95);
188
+ color: $black;
189
+ display: block;
190
+ font-size: 2em;
191
+ font-weight: 100;
192
+ margin: 2em 0 0;
193
+ padding: 10px 0;
194
+ text-align: center;
195
+ }
196
+
197
+ dd {
198
+ margin: 0 auto;
199
+ padding-top: 4em;
200
+ padding-bottom: 4em;
201
+ position: relative;
202
+ overflow: hidden;
203
+
204
+ &.notes {
205
+ background: $notes-section-background-color;
206
+ padding-top: 2em;
207
+ padding-bottom: 2em;
208
+ .wrapper {
209
+ background: $notes-background-color;
210
+ padding: 4em;
211
+ }
212
+ .notes-title {
213
+ @include box-shadow(0 1px 0 0 rgba($black, .08));
214
+ color: rgba($black, .35);
215
+ font-size: rem-calc(14);
216
+ font-weight: 100;
217
+ font-style: italic;
218
+ padding-bottom: .35em;
219
+ position: relative;
220
+ }
221
+
222
+ h1, h2, h3, h4, h5, h6, p {
223
+ color: lighten($black, 15%);
224
+ font-weight: 200;
225
+ }
226
+
227
+ }
228
+ &.preview {
229
+ background: $body-background-color;
230
+ }
231
+ &.location-title {
232
+ padding: 0;
233
+ }
234
+ }
235
+ }
236
+
237
+ .location {
238
+ background-color: rgba($white, .95);
239
+ color: rgba($black, .45);
240
+ cursor: pointer;
241
+ font-style: italic;
242
+ padding: 10px 20px;
243
+ position: relative;
244
+
245
+ &.show-code { color: $black; }
246
+ &.show-code + pre { display: block; }
247
+ &.show-code:after { @include icon('arrow-down'); }
248
+
249
+ &:after {
250
+ @include icon('arrow-up');
251
+ right: 20px;
252
+ top: 14px;
253
+ position: absolute;
254
+ font-style: normal;
255
+ padding-left: 5px;
256
+ }
257
+
258
+ &:hover { color: $primary-color; }
259
+
260
+ + pre { display: none; }
261
+ + pre code {
262
+ @include box-shadow(inset 0 -20px 0 #fafaff);
263
+ background-color: #f3f3fa;
264
+ font-size: 14px;
265
+ padding: 4em 20px 4.6em;
266
+ }
267
+ }
268
+ }
@@ -0,0 +1,4 @@
1
+ module Styleguide
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,16 @@
1
+ module Styleguide
2
+ class StyleguideController < ApplicationController
3
+ include StyleguideHelper
4
+
5
+ # expose(:navigation) { navigation_hash() }
6
+
7
+ def index
8
+ @ui_elements = ui_elements
9
+ end
10
+
11
+ def page
12
+ @page = current_page(params[:folder], params[:page])
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,4 @@
1
+ module Styleguide
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,71 @@
1
+ module Styleguide
2
+ module StyleguideHelper
3
+
4
+ BASE_PATH = "app/views/styleguide"
5
+
6
+ def ui_elements
7
+ ui_elements_partials = Dir.glob("#{BASE_PATH}/ui_elements/_*.html*")
8
+ ui_elements_partials.map do |filepath|
9
+ page_hash(filepath)
10
+ end
11
+ end
12
+
13
+ def current_page(folder, page)
14
+ filepath = Dir.glob("#{BASE_PATH}/#{folder}/#{page}.html*").first
15
+ page_hash(filepath)
16
+ end
17
+
18
+ def render_haml_string(contents)
19
+ Haml::Engine.new(contents).render
20
+ end
21
+
22
+ def load_notes(filepath)
23
+ haml_frontmatter = /^-{1,3}$\n(?<notes_contents>.*)^-{1,3}$\n/m
24
+ match = haml_frontmatter.match(File.read(filepath))
25
+ match[:notes_contents] if match
26
+ end
27
+
28
+ def page_hash(filepath)
29
+ lang = filepath.match(/haml$/) ? 'haml' : 'markup'
30
+ name = File.basename(filepath)
31
+ .gsub(/^\_|.html.*/, '')
32
+
33
+ {
34
+ :name => name,
35
+ :filepath => filepath,
36
+ :contents => File.read(filepath).sub(/^-{1,3}$\n.*^-{1,3}$\n/m, ''),
37
+ :notes => load_notes(filepath),
38
+ :lang => lang
39
+ }
40
+ end
41
+
42
+ def navigation_hash
43
+ folders = folders_names
44
+ folders.each_with_object({}) do |filepath, collection|
45
+ collection[filepath] = folder_files(filepath)
46
+ end
47
+ end
48
+
49
+ def folders_names
50
+ Dir.glob("#{BASE_PATH}/*").map do |filepath|
51
+ name = File.basename(filepath)
52
+ name if File.directory?(filepath) && name != 'shared'
53
+ end.compact
54
+ end
55
+
56
+ def folder_files(folder_name)
57
+ prefix = (folder_name == 'ui_elements') ? '#' : "#{folder_name}/"
58
+
59
+ files = Dir.glob("#{BASE_PATH}/#{folder_name}/*.html*")
60
+ files.map do |filepath|
61
+ name = File.basename(filepath)
62
+ .gsub(/^\_|.html.*/, '')
63
+
64
+ route = "/styleguide/#{prefix}#{name}"
65
+
66
+ {:name => name, :route => route}
67
+ end
68
+ end
69
+
70
+ end
71
+ end
@@ -0,0 +1,13 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title Application Style Guide
5
+ %meta(content="width=device-width, initial-scale=1.0, maximum-scale=1.0" name="viewport")
6
+
7
+ = javascript_include_tag 'styleguide/application'
8
+ = stylesheet_link_tag 'styleguide/application', media: 'all', 'data-turbolinks-track' => true
9
+ = stylesheet_link_tag "//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/styles/github.min.css"
10
+ %body#styleguide-rails
11
+ = yield
12
+
13
+ / %script(src="/assets/styleguide/main.js")