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
@@ -0,0 +1,25 @@
1
+ // import components
2
+ @import "components/alerts";
3
+ @import "components/annotations";
4
+ @import "components/bristol";
5
+ @import "components/button_groups";
6
+ @import "components/button_toolbars";
7
+ @import "components/buttons";
8
+ @import "components/canvas";
9
+ @import "components/carets";
10
+ @import "components/closes";
11
+ @import "components/container";
12
+ @import "components/copy";
13
+ @import "components/flyouts";
14
+ @import "components/headings";
15
+ @import "components/headlines";
16
+ @import "components/hovercards";
17
+ @import "components/icons";
18
+ @import "components/identities";
19
+ @import "components/links";
20
+ @import "components/loaders";
21
+ @import "components/menu_items";
22
+ @import "components/module";
23
+ @import "components/pullquotes";
24
+ @import "components/punchcut";
25
+ @import "components/tooltips";
@@ -0,0 +1,215 @@
1
+ // @category styleguide
2
+
3
+ // helper function to get the height of a button
4
+ // @function _styleguideGetButtonHeight
5
+ // @private
6
+ // @param $size {String} the size of the button to calculate
7
+ // @return {Number} the height of the button
8
+ @function _styleguideGetButtonHeight($size: medium) {
9
+ @if type-of($size) != list {
10
+ $sizes: (
11
+ (small, $CONFIG_FONT_BUTTON_SMALL),
12
+ (medium, $CONFIG_FONT_BUTTON_MEDIUM),
13
+ (large, $CONFIG_FONT_BUTTON_LARGE)
14
+ );
15
+ $size: associative($sizes, $size);
16
+ }
17
+ // font size + top/bottom padding
18
+ @return nth($size, 1) + (2 * nth($size, 2));
19
+ }
20
+
21
+ // helper function to get the padding of a button
22
+ // @function _styleguideGetButtonPadding
23
+ // @private
24
+ // @param $size {String} the size of the button to calculate
25
+ // @param $narrow {Bool} is the button narrow or not
26
+ // @return {Number} the padding on the button
27
+ @function _styleguideGetButtonPadding($size: medium, $narrow: false) {
28
+ @if type-of($size) != list {
29
+ $sizes: (
30
+ (small, $CONFIG_FONT_BUTTON_SMALL),
31
+ (medium, $CONFIG_FONT_BUTTON_MEDIUM),
32
+ (large, $CONFIG_FONT_BUTTON_LARGE)
33
+ );
34
+ $size: nth(associative($sizes, $size), 3);
35
+ }
36
+ $size: floor(if($narrow, $size * 0.75, $size));
37
+ @return (0 $size);
38
+ }
39
+
40
+ // helper function to get the size of the caret
41
+ // @function _styleguideCaretSize
42
+ // @private
43
+ // @param $size {String} the size of the caret to calculate
44
+ // @param $direction {String} the direction the caret is facing [up|down]
45
+ // @return {List} the border widths needed to generate the caret
46
+ @function _styleguideCaretSize($size: medium, $direction: south) {
47
+ @if type-of($size) != number {
48
+ $size: associative((
49
+ (small $CONFIG_FONT_CARET_SMALL),
50
+ (medium $CONFIG_FONT_CARET_MEDIUM),
51
+ (large $CONFIG_FONT_CARET_LARGE),
52
+ (tooltip $CONFIG_DIM_TOOLTIP_TIP)
53
+ ), $size);
54
+ }
55
+ @return associative((
56
+ (default ($size $size 0)),
57
+ (north (0 $size $size)),
58
+ (east ($size 0 $size $size)),
59
+ (west ($size $size $size 0))
60
+ ), $direction);
61
+ }
62
+
63
+ // helper function to get the alert icon offset
64
+ // @function _styleguideGetAlertGlyphOffset
65
+ // @private
66
+ // @param $type {List} the glpyh data
67
+ // @return {List} the top and left offsets for the glyph
68
+ @function _styleguideGetAlertGlyphOffset($type: $CONFIG_GLYPH_ALERT_NOTIFY) {
69
+ $top: (nth-cyclic($CONFIG_DIM_ALERTS_SPACING, 1) + nth-cyclic($CONFIG_DIM_ALERTS_SPACING, 3) + nth-cyclic($CONFIG_FONT_NOTICE, 2) - nth($type, 4)) / 2;
70
+ $left: ((nth-cyclic($CONFIG_DIM_ALERTS_SPACING, 4) - nth($type, 4))/2);
71
+ @return ($top $left);
72
+ }
73
+
74
+ // helper function to extract the glyhp styles for an alert icon
75
+ // @function _styleguideGetAlertGlyph
76
+ // @private
77
+ // @param $type {List} the glpyh data
78
+ // @return {List} the parameters needed for glyph-icon()
79
+ @function _styleguideGetAlertGlyph($type: $CONFIG_GLYPH_ALERT_NOTIFY) {
80
+ $offset: _styleguideGetAlertGlyphOffset($type);
81
+ $top: nth($offset, 1);
82
+ $left: nth($offset, 2);
83
+ @return (nth($type, 1), nth($type, 2), nth($type, 3), before, 'position:absolute;line-height:1;top:#{$top};left:#{$left};')
84
+ }
85
+
86
+
87
+ // helper function to return the list of shadows for the alert
88
+ // alerts have two shadows, one thats shared and ones that unique
89
+ // @function _styleguideGetAlertShadow
90
+ // @private
91
+ // @param $type {String} the type of alert [success|notice|yield|error]
92
+ // @return {List} the shadows on the alert
93
+ @function _styleguideGetAlertShadow($type: notice) {
94
+ $color: $type;
95
+ @if type-of($type) == string {
96
+ $color: associative((
97
+ (notice $CONFIG_COLOR_BORDER_ALERT_NOTIFY),
98
+ (success $CONFIG_COLOR_BORDER_ALERT_SUCCESS),
99
+ (error $CONFIG_COLOR_BORDER_ALERT_ERROR),
100
+ (yield $CONFIG_COLOR_BORDER_ALERT_YIELD)
101
+ ), $type);
102
+ }
103
+ @if($color != nil and $CONFIG_DIM_GENERIC_BORDER != nil) {
104
+ @return ((0 0 0 $CONFIG_DIM_GENERIC_BORDER $color), $CONFIG_SHADOW_ALERT);
105
+ }
106
+ @else {
107
+ @return $CONFIG_SHADOW_ALERT;
108
+ }
109
+ }
110
+
111
+ // helper function to get the color of a context
112
+ // @function _styleguideGetContextColor
113
+ // @private
114
+ // @param $texture {List|String} a list or string for a background texture
115
+ // @return {Color} the color in the list
116
+ @function _styleguideGetContextColor($texture: $CONFIG_TEXTURE_CONTAINER) {
117
+ $texture: -compass-list(first-value-of($texture)); // cast a string into a list
118
+ @return first-value-of($texture); // pull off the first value in the string/list
119
+ }
120
+
121
+ // helper function to get background position for the tooltip sprite
122
+ // @function _styleguideGetTooltipTipBG
123
+ // @private
124
+ // @param $direction {String} the direction the tip is pointing [north|south|east|west]
125
+ // @param $type {String} the type of the tip [hovercard]
126
+ // @return {List} the background position offsets
127
+ @function _styleguideGetTooltipTipBG($direction: south, $type: hovercard) {
128
+ $dim: $type;
129
+ @if type-of($type) == string {
130
+ $dim: associative((
131
+ hovercard $CONFIG_DIM_HOVERCARD_TIP,
132
+ nil
133
+ ), $type);
134
+ }
135
+ $a: nth($dim, 1);
136
+ $b: nth-cyclic($dim, 2);
137
+ // TODO - RTL support
138
+ @return associative((
139
+ north (-$b 0),
140
+ south ((-$b) (-($a+$b))),
141
+ east ((-($a+$b)) (-$b)),
142
+ west (0 (-$b))
143
+ ), $direction);
144
+ }
145
+
146
+ // helper function to get the position of the loading spinner
147
+ // @function _styleguideGetLoaderPosition
148
+ // @private
149
+ // @param $size {String} the size of the loading spinner e.g. [small|medium|large]
150
+ // @param $type {String} the type of the loading spinner e.g. [static|dynamic]
151
+ // @param $context {Number} the index for the context type
152
+ // @return {List} background position of the image or nil
153
+ @function _styleguideGetLoaderPosition($size: medium, $type: static, $context: 1) {
154
+ $img: nth-cyclic(associative(associative($CONFIG_LOADERS, $size), $type), $context);
155
+ @return styleguide-sprite-position($CONFIG_SPRITE_LOADERS, $img);
156
+ }
157
+
158
+ // helper function to get the dimensions of the loading spinner
159
+ // @function _styleguideGetLoaderDimension
160
+ // @private
161
+ // @param $size {String} the size of the loading spinner e.g. [small|medium|large]
162
+ // @param $type {String} the type of the loading spinner e.g. [static|dynamic]
163
+ // @param $dim {String} the dimension to return [width|height]
164
+ // @param $context {Number} the index for the context type
165
+ // @return {Number} the width/height of the loading spinner
166
+ @function _styleguideGetLoaderDimension($size: medium, $type: static, $dim: width, $context: 1) {
167
+ $img: nth-cyclic(associative(associative($CONFIG_LOADERS, $size), $type), $context);
168
+ $sprite-file: styleguide-sprite-file($CONFIG_SPRITE_LOADERS, $img);
169
+ @if $dim == width {
170
+ @return styleguide-image-width($sprite-file);
171
+ }
172
+ @else {
173
+ @return styleguide-image-height($sprite-file);
174
+ }
175
+ @return 0;
176
+ }
177
+
178
+ // helper function to get the animation routine of the loading spinner
179
+ // @function _styleguideGetLoaderAnimation
180
+ // @private
181
+ // @param $size {String} the size of the loading spinner e.g. [small|medium|large]
182
+ // @param $context {Number} the index for the context type
183
+ // @return {String} the animation value
184
+ @function _styleguideGetLoaderAnimation($size: medium, $context: 1) {
185
+ $values: associative($CONFIG_LOADERS, $size);
186
+ $anim: ($CONFIG_KEYFRAME_LOADERS);
187
+ $duration: nth-cyclic(associative($values, duration, $strict: true), $context);
188
+ $delay: nth-cyclic(associative($values, delay, $strict: true), $context);
189
+ $steps: nth-cyclic(associative($values, steps, $strict: true), $context);
190
+ $iterations: nth-cyclic(associative($values, iterations, $strict: true), $context);
191
+ @if $duration != nil { $anim: append($anim, $duration); }
192
+ @if $delay != nil { $anim: append($anim, $delay); }
193
+ @if $steps != nil { $anim: append($anim, steps($steps, end)); }
194
+ @if $iterations != nil { $anim: append($anim, $iterations); }
195
+ $position-keyframe-name: #{$CONFIG_KEYFRAME_LOADERS}-position-#{$size}-#{$context};
196
+ $anim: unquote("#{$anim}, #{$position-keyframe-name} 0.1ms step-end infinite");
197
+ @return $anim;
198
+ }
199
+
200
+ // helper function to get the CSS expression of the loading spinner (for IE6/7 support)
201
+ // @function _styleguideGetLoaderExpression
202
+ // @private
203
+ // @param $size {String} the size of the loading spinner e.g. [small|medium|large]
204
+ // @param $context {Number} the index for the context type
205
+ // @return {String} the CSS expression styles
206
+ @function _styleguideGetLoaderExpression($size: medium, $context: 1) {
207
+ $img: nth-cyclic(associative(associative($CONFIG_LOADERS, $size), static), $context);
208
+ $bg: styleguide-sprite($CONFIG_SPRITE_LOADERS, $img) no-repeat;
209
+ $bg: if($bg == nil, none, $bg);
210
+ $width: _styleguideGetLoaderDimension($size, static, width, $context);
211
+ $height: _styleguideGetLoaderDimension($size, static, height, $context);
212
+ $margin-top: $height / -2;
213
+ $margin-left: $width / -2;
214
+ @return ("position:absolute;top:50%;left:50%;background:#{$bg};width:#{$width};height:#{$height};margin-left:#{$margin-left};margin-top:#{$margin-top};", false, loader);
215
+ }
@@ -0,0 +1,10 @@
1
+ // manifest for primitives
2
+ @import "primitives/animations";
3
+ @import "primitives/palettes";
4
+ @import "primitives/textures";
5
+ @import "primitives/typography";
6
+ @import "primitives/dimensions";
7
+ @import "primitives/sprites";
8
+ @import "primitives/glyphs";
9
+ @import "primitives/shadows";
10
+ @import "primitives/misc";
@@ -0,0 +1,41 @@
1
+ // styleguide
2
+ // @category styleguide
3
+
4
+ // interface for the styleguide references
5
+ // @mixin styleguide
6
+ // @param $is ... $is-10 {List} a descriptive definition of the element, must contain an ID and optionally any modifiers e.g. `large primary button`
7
+ // @param $exclude {List} a list of styles to exclude from output
8
+ // @param $state {String} a specific state to output
9
+ // @param $theme {String} the theme name
10
+ @mixin styleguide($is: (), $is-2: false, $is-3: false, $is-4: false, $is-5: false, $is-6: false, $is-7: false, $is-8: false, $is-9: false, $is-10: false, $exclude: (), $state: false, $theme: $CONFIG_THEME) {
11
+ $definition: compact($is, $is-2, $is-3, $is-4, $is-5, $is-6, $is-7, $is-8, $is-9, $is-10);
12
+ @if length($definition) > 0 {
13
+ $styles: styleguide($definition, $state, $theme);
14
+ // output a debug message
15
+ @include debug-message("[archetype:styleguide:begin] --- #{$definition} ---");
16
+ // generate actual styles
17
+ @include to-styles($styles, $exclude: $exclude);
18
+ // more debugging
19
+ @include debug-message("[archetype:styleguide:end] --- #{$definition} ---");
20
+ }
21
+ }
22
+
23
+ // output the difference between two styelguide invocations
24
+ // @mixin styleguide-diff
25
+ // @param $original {List} the original styleguide reference to compare to
26
+ // @param $other {List} the other styleguide reference
27
+ // @param $exclude {List} a list of styles to exclude from output
28
+ // @param $theme {String} the theme name
29
+ @mixin styleguide-diff($original, $other, $exclude: (), $theme: $CONFIG_THEME) {
30
+ $original: compact($original, nil);
31
+ $other: compact($other, nil);
32
+ $diff: styleguide-diff($original, $other, $theme);
33
+ @if length($diff) > 0 {
34
+ // output a debug message
35
+ @include debug-message("[archetype:styleguide:diff:begin] --- `#{$original}` vs `#{$other}` ---");
36
+ // generate actual styles
37
+ @include to-styles($diff, $exclude: $exclude);
38
+ // more debugging
39
+ @include debug-message("[archetype:styleguide:diff:end] --- `#{$original}` vs `#{$other}` ---");
40
+ }
41
+ }
@@ -0,0 +1,59 @@
1
+ // ==========
2
+ // ALERTS
3
+ // ==========
4
+ $STYLEGUIDE_ALERTS_ID: alert !default;
5
+ $STYLEGUIDE_ALERTS: () !default;
6
+
7
+ @if not styleguide-component-exists($STYLEGUIDE_ALERTS_ID, $CONFIG_THEME) {
8
+ $a-blackhole: styleguide-add-component($STYLEGUIDE_ALERTS_ID, $STYLEGUIDE_ALERTS, (
9
+ (default, (
10
+ // fallback background
11
+ background-color $CONFIG_COLOR_BG_ALERT_NOTIFY,
12
+ background-repeat no-repeat,
13
+ // gradient background
14
+ background $CONFIG_GRADIENT_ALERT_NOTIFY,
15
+ box-shadow _styleguideGetAlertShadow(notice),
16
+ // common
17
+ overflow hidden,
18
+ display block,
19
+ color nth-cyclic($CONFIG_COLOR_COPY, 2),
20
+ font-size nth($CONFIG_FONT_NOTICE, 1),
21
+ line-height nth-cyclic($CONFIG_FONT_NOTICE, 2),
22
+ position relative,
23
+ padding $CONFIG_DIM_ALERTS_SPACING,
24
+ glyph-icon _styleguideGetAlertGlyph($CONFIG_GLYPH_ALERT_NOTIFY),
25
+ (selectors, (
26
+ ('&:before', (
27
+ position absolute,
28
+ top nth(_styleguideGetAlertGlyphOffset($CONFIG_GLYPH_ALERT_NOTIFY), 1),
29
+ left nth(_styleguideGetAlertGlyphOffset($CONFIG_GLYPH_ALERT_NOTIFY), 2),
30
+ line-height 1
31
+ )),
32
+ nil
33
+ )),
34
+ nil
35
+ )),
36
+ (notice, (
37
+ // notice - default
38
+ nil
39
+ )),
40
+ (success, (
41
+ background-color $CONFIG_COLOR_BG_ALERT_SUCCESS,
42
+ background $CONFIG_GRADIENT_ALERT_SUCCESS,
43
+ glyph-icon _styleguideGetAlertGlyph($CONFIG_GLYPH_ALERT_SUCCESS),
44
+ box-shadow _styleguideGetAlertShadow(success)
45
+ )),
46
+ (error, (
47
+ background-color $CONFIG_COLOR_BG_ALERT_ERROR,
48
+ background $CONFIG_GRADIENT_ALERT_ERROR,
49
+ glyph-icon _styleguideGetAlertGlyph($CONFIG_GLYPH_ALERT_ERROR),
50
+ box-shadow _styleguideGetAlertShadow(error)
51
+ )),
52
+ (yield, (
53
+ background-color $CONFIG_COLOR_BG_ALERT_YIELD,
54
+ background $CONFIG_GRADIENT_ALERT_YIELD,
55
+ glyph-icon _styleguideGetAlertGlyph($CONFIG_GLYPH_ALERT_YIELD),
56
+ box-shadow _styleguideGetAlertShadow(yield)
57
+ ))
58
+ ), $CONFIG_THEME);
59
+ }
@@ -0,0 +1,27 @@
1
+ // ==========
2
+ // ANNOTATIONS
3
+ // ==========
4
+ $STYLEGUIDE_ANNOTATIONS_ID: annotation !default;
5
+ $STYLEGUIDE_ANNOTATIONS: () !default;
6
+
7
+ @if not styleguide-component-exists($STYLEGUIDE_ANNOTATIONS_ID, $CONFIG_THEME) {
8
+ $a-blackhole: styleguide-add-component($STYLEGUIDE_ANNOTATIONS_ID, $STYLEGUIDE_ANNOTATIONS, (
9
+ (default, (
10
+ font-size nth($CONFIG_FONT_ANNOTATION_MEDIUM, 1),
11
+ line-height nth-cyclic($CONFIG_FONT_ANNOTATION_MEDIUM, 2),
12
+ color nth($CONFIG_COLOR_ANNOTATION, 1)
13
+ )),
14
+ (in-dark, (
15
+ color nth-cyclic($CONFIG_COLOR_ANNOTATION, 2),
16
+ text-shadow (1px 1px 1px rgba(0, 0, 0, .75))
17
+ )),
18
+ (in-tooltip, (
19
+ inherit (in-dark),
20
+ nil
21
+ )),
22
+ (in-punchcut, (
23
+ inherit (in-dark),
24
+ nil
25
+ ))
26
+ ), $CONFIG_THEME);
27
+ }
@@ -0,0 +1,15 @@
1
+ // ==========
2
+ // BRISTOL
3
+ // ==========
4
+ $STYLEGUIDE_BRISTOLS_ID: bristol !default;
5
+ $STYLEGUIDE_BRISTOLS: () !default;
6
+
7
+ @if not styleguide-component-exists($STYLEGUIDE_BRISTOLS_ID, $CONFIG_THEME) {
8
+ $a-blackhole: styleguide-add-component($STYLEGUIDE_BRISTOLS_ID, $STYLEGUIDE_BRISTOLS, (
9
+ (default, (
10
+ background nth($CONFIG_TEXTURE_BRISTOL, 1),
11
+ nil
12
+ )),
13
+ nil
14
+ ), $CONFIG_THEME);
15
+ }
@@ -0,0 +1,47 @@
1
+ // ==========
2
+ // BUTTON GROUPS
3
+ // ==========
4
+ $STYLEGUIDE_BUTTON_GROUPS_ID: button-group !default;
5
+ $STYLEGUIDE_BUTTON_GROUPS: () !default;
6
+
7
+ @if not styleguide-component-exists($STYLEGUIDE_BUTTON_GROUPS_ID, $CONFIG_THEME) {
8
+ $a-blackhole: styleguide-add-component($STYLEGUIDE_BUTTON_GROUPS_ID, $STYLEGUIDE_BUTTON_GROUPS, (
9
+ (default, (
10
+ line-height 1,
11
+ inline-block true, // this will use the inline-block() mixin
12
+ vertical-align middle,
13
+ clearfix legacy-pie-clearfix,
14
+ position relative,
15
+ nil
16
+ )),
17
+ // BUTTON TOOLBARS
18
+ (in-button-toolbar, (
19
+ margin-right $CONFIG_DIM_BUTTON_SPACING_OUTER,
20
+ float left,
21
+ display block,
22
+ inline-block nil
23
+ )),
24
+ (small in-button-toolbar, (
25
+ margin-right $CONFIG_DIM_BUTTON_SPACING_OUTER_NARROW,
26
+ nil
27
+ )),
28
+ (last in-button-toolbar, (
29
+ margin-right nil,
30
+ nil
31
+ )),
32
+ (right aligned in-button-toolbar, (
33
+ float right,
34
+ margin-right nil,
35
+ margin-left $CONFIG_DIM_BUTTON_SPACING_OUTER
36
+ )),
37
+ (right aligned small in-button-toolbar, (
38
+ margin-left $CONFIG_DIM_BUTTON_SPACING_OUTER_NARROW,
39
+ nil
40
+ )),
41
+ (right aligned last in-button-toolbar, (
42
+ margin-left nil,
43
+ nil
44
+ )),
45
+ nil
46
+ ), $CONFIG_THEME);
47
+ }