locomotivecms_wagon 2.2.0.beta1 → 2.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (219) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/generators/blank/config/metafields_schema.yml +1 -1
  4. data/generators/bootstrap/config/metafields_schema.yml +1 -1
  5. data/generators/{foundation5 → foundation}/Gemfile.tt +1 -1
  6. data/generators/{foundation5 → foundation}/Guardfile +0 -0
  7. data/generators/foundation/app/content_types/.gitkeep +0 -0
  8. data/generators/foundation/app/views/pages/404.liquid +11 -0
  9. data/generators/{foundation5 → foundation}/app/views/pages/404.liquid.haml +4 -3
  10. data/generators/{foundation5 → foundation}/app/views/pages/index.liquid +54 -78
  11. data/generators/foundation/app/views/pages/index.liquid.haml +144 -0
  12. data/generators/foundation/app/views/snippets/.gitkeep +0 -0
  13. data/generators/{foundation5 → foundation}/config/deploy.yml +2 -1
  14. data/generators/{foundation5 → foundation}/config/metafields_schema.yml +1 -1
  15. data/generators/{foundation5/config/site.yml.tt → foundation/config/site.yml} +2 -2
  16. data/generators/{foundation5 → foundation}/config/translations.yml +0 -0
  17. data/generators/foundation/data/.gitkeep +0 -0
  18. data/generators/foundation/log/.gitkeep +0 -0
  19. data/generators/foundation/public/images/.gitkeep +0 -0
  20. data/generators/foundation/public/javascripts/app.js +1 -0
  21. data/generators/foundation/public/javascripts/vendor/foundation.js +7472 -0
  22. data/generators/foundation/public/javascripts/vendor/foundation.min.js +3 -0
  23. data/generators/foundation/public/javascripts/vendor/what-input.js +212 -0
  24. data/generators/foundation/public/javascripts/vendor/what-input.min.js +1 -0
  25. data/generators/foundation/public/stylesheets/_settings.scss +529 -0
  26. data/generators/foundation/public/stylesheets/app.css +3 -0
  27. data/generators/foundation/public/stylesheets/app.scss +43 -0
  28. data/generators/foundation/public/stylesheets/foundation.css +3499 -0
  29. data/generators/foundation/public/stylesheets/foundation6/_global.scss +197 -0
  30. data/generators/foundation/public/stylesheets/foundation6/components/_accordion-menu.scss +28 -0
  31. data/generators/foundation/public/stylesheets/foundation6/components/_accordion.scss +112 -0
  32. data/generators/foundation/public/stylesheets/foundation6/components/_badge.scss +55 -0
  33. data/generators/foundation/public/stylesheets/foundation6/components/_breadcrumbs.scss +94 -0
  34. data/generators/foundation/public/stylesheets/foundation6/components/_button-group.scss +115 -0
  35. data/generators/foundation/public/stylesheets/foundation6/components/_button.scss +264 -0
  36. data/generators/foundation/public/stylesheets/foundation6/components/_callout.scss +115 -0
  37. data/generators/foundation/public/stylesheets/foundation6/components/_close-button.scss +61 -0
  38. data/generators/foundation/public/stylesheets/foundation6/components/_drilldown.scss +67 -0
  39. data/generators/foundation/public/stylesheets/foundation6/components/_dropdown-menu.scss +123 -0
  40. data/generators/foundation/public/stylesheets/foundation6/components/_dropdown.scss +64 -0
  41. data/generators/foundation/public/stylesheets/foundation6/components/_flex-video.scss +68 -0
  42. data/generators/foundation/public/stylesheets/foundation6/components/_float.scss +27 -0
  43. data/generators/foundation/public/stylesheets/foundation6/components/_label.scss +56 -0
  44. data/generators/foundation/public/stylesheets/foundation6/components/_media-object.scss +74 -0
  45. data/generators/foundation/public/stylesheets/foundation6/components/_menu.scss +213 -0
  46. data/generators/foundation/public/stylesheets/foundation6/components/_off-canvas.scss +170 -0
  47. data/generators/foundation/public/stylesheets/foundation6/components/_orbit.scss +186 -0
  48. data/generators/foundation/public/stylesheets/foundation6/components/_pagination.scss +161 -0
  49. data/generators/foundation/public/stylesheets/foundation6/components/_progress-bar.scss +83 -0
  50. data/generators/foundation/public/stylesheets/foundation6/components/_reveal.scss +155 -0
  51. data/generators/foundation/public/stylesheets/foundation6/components/_slider.scss +158 -0
  52. data/generators/foundation/public/stylesheets/foundation6/components/_sticky.scss +38 -0
  53. data/generators/foundation/public/stylesheets/foundation6/components/_switch.scss +231 -0
  54. data/generators/foundation/public/stylesheets/foundation6/components/_table.scss +212 -0
  55. data/generators/foundation/public/stylesheets/foundation6/components/_tabs.scss +137 -0
  56. data/generators/foundation/public/stylesheets/foundation6/components/_thumbnail.scss +54 -0
  57. data/generators/foundation/public/stylesheets/foundation6/components/_title-bar.scss +44 -0
  58. data/generators/foundation/public/stylesheets/foundation6/components/_tooltip.scss +110 -0
  59. data/generators/foundation/public/stylesheets/foundation6/components/_top-bar.scss +57 -0
  60. data/generators/foundation/public/stylesheets/foundation6/components/_visibility.scss +131 -0
  61. data/generators/foundation/public/stylesheets/foundation6/forms/_checkbox.scss +36 -0
  62. data/generators/foundation/public/stylesheets/foundation6/forms/_error.scss +81 -0
  63. data/generators/foundation/public/stylesheets/foundation6/forms/_fieldset.scss +53 -0
  64. data/generators/foundation/public/stylesheets/foundation6/forms/_forms.scss +32 -0
  65. data/generators/foundation/public/stylesheets/foundation6/forms/_help-text.scss +30 -0
  66. data/generators/foundation/public/stylesheets/foundation6/forms/_input-group.scss +70 -0
  67. data/generators/foundation/public/stylesheets/foundation6/forms/_label.scss +48 -0
  68. data/generators/foundation/public/stylesheets/foundation6/forms/_select.scss +64 -0
  69. data/generators/foundation/public/stylesheets/foundation6/forms/_text.scss +153 -0
  70. data/generators/foundation/public/stylesheets/foundation6/foundation.scss +91 -0
  71. data/generators/foundation/public/stylesheets/foundation6/grid/_classes.scss +132 -0
  72. data/generators/foundation/public/stylesheets/foundation6/grid/_column.scss +112 -0
  73. data/generators/foundation/public/stylesheets/foundation6/grid/_flex-grid.scss +191 -0
  74. data/generators/foundation/public/stylesheets/foundation6/grid/_grid.scss +33 -0
  75. data/generators/foundation/public/stylesheets/foundation6/grid/_gutter.scss +31 -0
  76. data/generators/foundation/public/stylesheets/foundation6/grid/_layout.scss +32 -0
  77. data/generators/foundation/public/stylesheets/foundation6/grid/_position.scss +71 -0
  78. data/generators/foundation/public/stylesheets/foundation6/grid/_row.scss +72 -0
  79. data/generators/foundation/public/stylesheets/foundation6/grid/_size.scss +24 -0
  80. data/generators/foundation/public/stylesheets/foundation6/motion-ui/_classes.scss +102 -0
  81. data/generators/foundation/public/stylesheets/foundation6/motion-ui/_settings.scss +61 -0
  82. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_fade.scss +29 -0
  83. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_hinge.scss +65 -0
  84. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_shake.scss +15 -0
  85. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_slide.scss +41 -0
  86. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_spin.scss +28 -0
  87. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_wiggle.scss +13 -0
  88. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_zoom.scss +15 -0
  89. data/generators/foundation/public/stylesheets/foundation6/motion-ui/motion-ui.scss +29 -0
  90. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_fade.scss +28 -0
  91. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_hinge.scss +43 -0
  92. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_slide.scss +42 -0
  93. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_spin.scss +39 -0
  94. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_zoom.scss +39 -0
  95. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_animation.scss +7 -0
  96. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_args.scss +15 -0
  97. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_keyframe.scss +136 -0
  98. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_selector.scss +23 -0
  99. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_series.scss +54 -0
  100. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_transition.scss +45 -0
  101. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_unit.scss +7 -0
  102. data/generators/foundation/public/stylesheets/foundation6/motion-ui.scss +4 -0
  103. data/generators/foundation/public/stylesheets/foundation6/settings/_settings.scss +531 -0
  104. data/generators/foundation/public/stylesheets/foundation6/typography/_alignment.scss +21 -0
  105. data/generators/foundation/public/stylesheets/foundation6/typography/_base.scss +436 -0
  106. data/generators/foundation/public/stylesheets/foundation6/typography/_helpers.scss +77 -0
  107. data/generators/foundation/public/stylesheets/foundation6/typography/_print.scss +73 -0
  108. data/generators/foundation/public/stylesheets/foundation6/typography/_typography.scss +28 -0
  109. data/generators/foundation/public/stylesheets/foundation6/util/_breakpoint.scss +182 -0
  110. data/generators/foundation/public/stylesheets/foundation6/util/_color.scss +41 -0
  111. data/generators/foundation/public/stylesheets/foundation6/util/_mixins.scss +190 -0
  112. data/generators/foundation/public/stylesheets/foundation6/util/_selector.scss +39 -0
  113. data/generators/foundation/public/stylesheets/foundation6/util/_unit.scss +69 -0
  114. data/generators/foundation/public/stylesheets/foundation6/util/_util.scss +15 -0
  115. data/generators/foundation/public/stylesheets/foundation6/util/_value.scss +117 -0
  116. data/generators/{foundation5/public/stylesheets/normalize.css.scss → foundation/public/stylesheets/foundation6/vendor/normalize.scss} +8 -11
  117. data/generators/site_metafields/schema.yml.tt +1 -1
  118. data/lib/locomotive/wagon/commands/push_command.rb +1 -0
  119. data/lib/locomotive/wagon/commands/serve_command.rb +1 -0
  120. data/lib/locomotive/wagon/decorators/concerns/persist_assets_concern.rb +3 -3
  121. data/lib/locomotive/wagon/decorators/content_type_decorator.rb +5 -1
  122. data/lib/locomotive/wagon/generators/site/{foundation5.rb → foundation.rb} +8 -12
  123. data/lib/locomotive/wagon/generators/site.rb +1 -1
  124. data/lib/locomotive/wagon/version.rb +1 -1
  125. data/locomotivecms_wagon.gemspec +3 -2
  126. data/spec/fixtures/cassettes/authenticate.yml +38 -38
  127. data/spec/fixtures/cassettes/delete.yml +211 -211
  128. data/spec/fixtures/cassettes/push.yml +1333 -1374
  129. data/spec/integration/cli_spec.rb +1 -1
  130. data/spec/unit/decorators/content_entry_decorator_spec.rb +23 -0
  131. metadata +133 -104
  132. data/generators/foundation5/app/content_types/.empty_directory +0 -1
  133. data/generators/foundation5/app/views/pages/404.liquid +0 -10
  134. data/generators/foundation5/app/views/pages/index.liquid.haml +0 -157
  135. data/generators/foundation5/data/.empty_directory +0 -1
  136. data/generators/foundation5/icon.png +0 -0
  137. data/generators/foundation5/public/fonts/.empty_directory +0 -1
  138. data/generators/foundation5/public/images/.empty_directory +0 -1
  139. data/generators/foundation5/public/javascripts/foundation/foundation.abide.js +0 -299
  140. data/generators/foundation5/public/javascripts/foundation/foundation.accordion.js +0 -59
  141. data/generators/foundation5/public/javascripts/foundation/foundation.alert.js +0 -43
  142. data/generators/foundation5/public/javascripts/foundation/foundation.clearing.js +0 -534
  143. data/generators/foundation5/public/javascripts/foundation/foundation.dropdown.js +0 -311
  144. data/generators/foundation5/public/javascripts/foundation/foundation.equalizer.js +0 -74
  145. data/generators/foundation5/public/javascripts/foundation/foundation.interchange.js +0 -331
  146. data/generators/foundation5/public/javascripts/foundation/foundation.joyride.js +0 -843
  147. data/generators/foundation5/public/javascripts/foundation/foundation.js +0 -611
  148. data/generators/foundation5/public/javascripts/foundation/foundation.magellan.js +0 -178
  149. data/generators/foundation5/public/javascripts/foundation/foundation.offcanvas.js +0 -108
  150. data/generators/foundation5/public/javascripts/foundation/foundation.orbit.js +0 -610
  151. data/generators/foundation5/public/javascripts/foundation/foundation.reveal.js +0 -437
  152. data/generators/foundation5/public/javascripts/foundation/foundation.slider.js +0 -199
  153. data/generators/foundation5/public/javascripts/foundation/foundation.tab.js +0 -167
  154. data/generators/foundation5/public/javascripts/foundation/foundation.tooltip.js +0 -298
  155. data/generators/foundation5/public/javascripts/foundation/foundation.topbar.js +0 -425
  156. data/generators/foundation5/public/javascripts/foundation.js +0 -4161
  157. data/generators/foundation5/public/javascripts/foundation.min.js +0 -10
  158. data/generators/foundation5/public/javascripts/vendor/custom.modernizr.js +0 -4
  159. data/generators/foundation5/public/javascripts/vendor/custom.modernizr.min.js +0 -1
  160. data/generators/foundation5/public/javascripts/vendor/fastclick.js +0 -9
  161. data/generators/foundation5/public/javascripts/vendor/fastclick.min.js +0 -11
  162. data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.js +0 -645
  163. data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.min.js +0 -1
  164. data/generators/foundation5/public/javascripts/vendor/jquery.cookie.js +0 -8
  165. data/generators/foundation5/public/javascripts/vendor/jquery.cookie.min.js +0 -8
  166. data/generators/foundation5/public/javascripts/vendor/jquery.js +0 -26
  167. data/generators/foundation5/public/javascripts/vendor/jquery.min.js +0 -27
  168. data/generators/foundation5/public/javascripts/vendor/modernizr.js +0 -8
  169. data/generators/foundation5/public/javascripts/vendor/modernizr.min.js +0 -1
  170. data/generators/foundation5/public/javascripts/vendor/placeholder.js +0 -2
  171. data/generators/foundation5/public/javascripts/vendor/placeholder.min.js +0 -1
  172. data/generators/foundation5/public/samples/.empty_directory +0 -1
  173. data/generators/foundation5/public/stylesheets/application.css +0 -2
  174. data/generators/foundation5/public/stylesheets/application.css.scss +0 -3
  175. data/generators/foundation5/public/stylesheets/foundation/_functions.scss +0 -102
  176. data/generators/foundation5/public/stylesheets/foundation/_settings.scss +0 -1441
  177. data/generators/foundation5/public/stylesheets/foundation/components/_accordion.scss +0 -157
  178. data/generators/foundation5/public/stylesheets/foundation/components/_alert-boxes.scss +0 -128
  179. data/generators/foundation5/public/stylesheets/foundation/components/_block-grid.scss +0 -132
  180. data/generators/foundation5/public/stylesheets/foundation/components/_breadcrumbs.scss +0 -132
  181. data/generators/foundation5/public/stylesheets/foundation/components/_button-groups.scss +0 -197
  182. data/generators/foundation5/public/stylesheets/foundation/components/_buttons.scss +0 -259
  183. data/generators/foundation5/public/stylesheets/foundation/components/_clearing.scss +0 -247
  184. data/generators/foundation5/public/stylesheets/foundation/components/_dropdown-buttons.scss +0 -130
  185. data/generators/foundation5/public/stylesheets/foundation/components/_dropdown.scss +0 -262
  186. data/generators/foundation5/public/stylesheets/foundation/components/_flex-video.scss +0 -51
  187. data/generators/foundation5/public/stylesheets/foundation/components/_forms.scss +0 -585
  188. data/generators/foundation5/public/stylesheets/foundation/components/_global.scss +0 -460
  189. data/generators/foundation5/public/stylesheets/foundation/components/_grid.scss +0 -275
  190. data/generators/foundation5/public/stylesheets/foundation/components/_icon-bar.scss +0 -293
  191. data/generators/foundation5/public/stylesheets/foundation/components/_inline-lists.scss +0 -57
  192. data/generators/foundation5/public/stylesheets/foundation/components/_joyride.scss +0 -222
  193. data/generators/foundation5/public/stylesheets/foundation/components/_keystrokes.scss +0 -61
  194. data/generators/foundation5/public/stylesheets/foundation/components/_labels.scss +0 -106
  195. data/generators/foundation5/public/stylesheets/foundation/components/_magellan.scss +0 -34
  196. data/generators/foundation5/public/stylesheets/foundation/components/_offcanvas.scss +0 -513
  197. data/generators/foundation5/public/stylesheets/foundation/components/_orbit.scss +0 -368
  198. data/generators/foundation5/public/stylesheets/foundation/components/_pagination.scss +0 -162
  199. data/generators/foundation5/public/stylesheets/foundation/components/_panels.scss +0 -95
  200. data/generators/foundation5/public/stylesheets/foundation/components/_pricing-tables.scss +0 -150
  201. data/generators/foundation5/public/stylesheets/foundation/components/_progress-bars.scss +0 -79
  202. data/generators/foundation5/public/stylesheets/foundation/components/_range-slider.scss +0 -168
  203. data/generators/foundation5/public/stylesheets/foundation/components/_reveal.scss +0 -222
  204. data/generators/foundation5/public/stylesheets/foundation/components/_side-nav.scss +0 -116
  205. data/generators/foundation5/public/stylesheets/foundation/components/_split-buttons.scss +0 -191
  206. data/generators/foundation5/public/stylesheets/foundation/components/_sub-nav.scss +0 -123
  207. data/generators/foundation5/public/stylesheets/foundation/components/_switches.scss +0 -230
  208. data/generators/foundation5/public/stylesheets/foundation/components/_tables.scss +0 -135
  209. data/generators/foundation5/public/stylesheets/foundation/components/_tabs.scss +0 -123
  210. data/generators/foundation5/public/stylesheets/foundation/components/_thumbs.scss +0 -66
  211. data/generators/foundation5/public/stylesheets/foundation/components/_toolbar.scss +0 -70
  212. data/generators/foundation5/public/stylesheets/foundation/components/_tooltips.scss +0 -142
  213. data/generators/foundation5/public/stylesheets/foundation/components/_top-bar.scss +0 -685
  214. data/generators/foundation5/public/stylesheets/foundation/components/_type.scss +0 -525
  215. data/generators/foundation5/public/stylesheets/foundation/components/_visibility.scss +0 -408
  216. data/generators/foundation5/public/stylesheets/foundation.css +0 -6138
  217. data/generators/foundation5/public/stylesheets/foundation.css.scss +0 -45
  218. data/generators/foundation5/public/stylesheets/normalize.css +0 -357
  219. data/lib/locomotive/wagon/generators/site/foundation4.rb +0 -34
@@ -0,0 +1,182 @@
1
+ // Foundation for Sites by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ ////
6
+ /// @group breakpoints
7
+ ////
8
+
9
+ // scss-lint:disable ZeroUnit
10
+
11
+ /// A list of named breakpoints. You can use these with the `breakpoint()` mixin to quickly create media queries.
12
+ /// @type Map
13
+ $breakpoints: (
14
+ small: 0,
15
+ medium: 640px,
16
+ large: 1024px,
17
+ xlarge: 1200px,
18
+ xxlarge: 1440px,
19
+ ) !default;
20
+
21
+ /// All of the names in this list will be output as classes in your CSS, like `.small-12`, `.medium-6`, and so on. Each value in this list must also be in the `$breakpoints` map.
22
+ /// @type List
23
+ $breakpoint-classes: (small medium large) !default;
24
+
25
+ /// Generates a media query string matching the input value. Refer to the documentation for the `breakpoint()` mixin to see what the possible inputs are.
26
+ /// @param {Keyword|Number} $val - Breakpoint name, or px, rem, or em value to process.
27
+ @function breakpoint($val: small) {
28
+ // Size or keyword
29
+ $bp: nth($val, 1);
30
+ // Value for max-width media queries
31
+ $bp-max: 0;
32
+ // Direction of media query (up, down, or only)
33
+ $dir: if(length($val) > 1, nth($val, 2), up);
34
+ // Eventual output
35
+ $str: '';
36
+ // Is it a named media query?
37
+ $named: false;
38
+
39
+ // Orientation media queries have a unique syntax
40
+ @if $bp == 'landscape' or $bp == 'portrait' {
41
+ @return '(orientation: #{$bp})';
42
+ }
43
+ @else if $bp == 'retina' {
44
+ @return '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)';
45
+ }
46
+
47
+ // Try to pull a named breakpoint out of the $breakpoints map
48
+ @if type-of($bp) == 'string' {
49
+ @if map-has-key($breakpoints, $bp) {
50
+ @if $dir == 'only' or $dir == 'down' {
51
+ $next-bp: -zf-map-next($breakpoints, $bp);
52
+
53
+ @if $next-bp == null {
54
+ $bp-max: null;
55
+ }
56
+ @else {
57
+ $bp-max: $next-bp;
58
+ }
59
+ }
60
+
61
+ $bp: map-get($breakpoints, $bp);
62
+ $named: true;
63
+ }
64
+ @else {
65
+ $bp: 0;
66
+ }
67
+ }
68
+
69
+ // Convert any pixel, rem, or unitless value to em
70
+ $bp: -zf-bp-to-em($bp);
71
+ @if $bp-max {
72
+ $bp-max: -zf-bp-to-em($bp-max) - (1/16);
73
+ }
74
+
75
+ // Skip media query creation if the input is "0 up" or "0 down"
76
+ @if $bp > 0 or $dir == 'only' {
77
+ // "Only" ranges use the format "(min-width: n) and (max-width: n)"
78
+ @if $dir == 'only' {
79
+ @if $named == true {
80
+ $str: $str + '(min-width: #{$bp})';
81
+
82
+ @if $bp-max != null {
83
+ $str: $str + ' and (max-width: #{$bp-max})';
84
+ }
85
+ }
86
+ @else {
87
+ @warn 'Only named media queries can have an "only" range.';
88
+ }
89
+ }
90
+
91
+ // "Down" ranges use the format "(max-width: n)"
92
+ @else if $dir == 'down' {
93
+ $max: 0;
94
+
95
+ // For named breakpoints, subtract the breakpoint value by one "pixel", or 1/16em.
96
+ @if $named {
97
+ $max: $bp-max;
98
+ }
99
+ @else {
100
+ $max: $bp;
101
+ }
102
+
103
+ $str: $str + '(max-width: #{$max})';
104
+ }
105
+
106
+ // "Up" ranges use the format "(min-width: n)"
107
+ @else if strip-unit($bp) > 0 {
108
+ $str: $str + '(min-width: #{$bp})';
109
+ }
110
+ }
111
+
112
+ @return $str;
113
+ }
114
+
115
+ /// Wraps a media query around the content you put inside the mixin. This mixin accepts a number of values:
116
+ /// - If a string is passed, the mixin will look for it in the `$breakpoints` map, and use a media query there.
117
+ /// - If a pixel value is passed, it will be converted to an em value using `$rem-base`.
118
+ /// - If a rem value is passed, the unit will be changed to em.
119
+ /// - If an em value is passed, the value will be used as-is.
120
+ /// @content
121
+ /// @param {Keyword|Number} $value - Breakpoint name, or px, rem, or em value to process.
122
+ /// @output If the breakpoint is "0px and larger", outputs the content as-is. Otherwise, outputs the content wrapped in a media query.
123
+ @mixin breakpoint($value) {
124
+ $str: breakpoint($value);
125
+
126
+ // If $str is still an empty string, no media query is needed
127
+ @if $str == '' {
128
+ @content;
129
+ }
130
+
131
+ // Otherwise, wrap the content in a media query
132
+ @else {
133
+ @media screen and #{$str} {
134
+ @content;
135
+ }
136
+ }
137
+ }
138
+
139
+ /// Convers the breakpoints map to a URL-encoded string, like this: `key1=value1&key2=value2`. The value is then dropped into the CSS for a special `<meta>` tag, which is read by the Foundation JavaScript. This is how we transfer values from Sass to JavaScript, so they can be defined in one place.
140
+ /// @access private
141
+ /// @param {Map} $map - Map to convert.
142
+ /// @returns {String} A string containing the map's contents.
143
+ @function -zf-bp-serialize($map) {
144
+ $str: '';
145
+ @each $key, $value in $map {
146
+ $str: $str + $key + '=' + -zf-bp-to-em($value) + '&';
147
+ }
148
+ $str: str-slice($str, 1, -2);
149
+
150
+ @return $str;
151
+ }
152
+
153
+ /// Find the next key in a map.
154
+ /// @access private
155
+ /// @param {Map} $map - Map to traverse.
156
+ /// @param {Mixed} $key - Key to use as a starting point.
157
+ /// @returns {Mixed} The value for the key after `$key`, if `$key` was found. If `$key` was not found, or `$key` was the last value in the map, returns `null`.
158
+ @function -zf-map-next($map, $key) {
159
+ // Store the values of the map as a list, so we can access them with nth
160
+ $values: map-values($map);
161
+
162
+ // Ghetto for loop
163
+ $i: 1;
164
+ $found: false;
165
+ @each $val in map-keys($map) {
166
+ @if $found == false {
167
+ @if ($key == $val) {
168
+ $found: true;
169
+ }
170
+ $i: $i + 1;
171
+ }
172
+ }
173
+
174
+ // If the key doesn't exist, or it's the last key in the map, return null
175
+ @if $i > length($map) {
176
+ @return null;
177
+ }
178
+ // Otherwise, return the value
179
+ @else {
180
+ @return nth($values, $i);
181
+ }
182
+ }
@@ -0,0 +1,41 @@
1
+ // Foundation for Sites by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ ////
6
+ /// @group functions
7
+ ////
8
+
9
+ /// Checks the lightness of `$color`, and if it passes the `$threshold` of lightness, it returns the `$yes` color. Otherwise, it returns the `$no` color. Use this function to dynamically output a foreground color based on a given background color.
10
+ ///
11
+ /// @param {color} $color - Color to check the lightness of.
12
+ /// @param {color} $yes [$black] - Color to return if `$color` is light.
13
+ /// @param {color} $no [$white] - Color to return if `$color` is dark.
14
+ /// @param {percentage} $threshold [60%] - Threshold of lightness to check against.
15
+ ///
16
+ /// @returns {Color} The $yes color or $no color.
17
+ @function foreground($color, $yes: $black, $no: $white, $threshold: 60%) {
18
+ @if $color == transparent {
19
+ $color: $body-background;
20
+ }
21
+ @if (lightness($color) > $threshold) {
22
+ @return $yes;
23
+ }
24
+ @else {
25
+ @return $no;
26
+ }
27
+ }
28
+
29
+ /// Scales a color to be lighter if it's light, or darker if it's dark. Use this function to tint a color appropriate to its lightness.
30
+ ///
31
+ /// @param {color} $color - Color to scale.
32
+ /// @param {percentage} $scale [5%] - Amount to scale up or down.
33
+ /// @param {percentage} $threshold [40%] - Threshold of lightness to check against.
34
+ ///
35
+ /// @returns {Color} A scaled color.
36
+ @function smart-scale($color, $scale: 5%, $threshold: 40%) {
37
+ @if lightness($color) > $threshold {
38
+ $scale: -$scale;
39
+ }
40
+ @return scale-color($color, $lightness: $scale);
41
+ }
@@ -0,0 +1,190 @@
1
+ // Foundation for Sites by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ ////
6
+ /// @group functions
7
+ ////
8
+
9
+ /// Creates a CSS triangle, which can be used for dropdown arrows, dropdown pips, and more. Use this mixin inside a `&::before` or `&::after` selector, to attach the triangle to an existing element.
10
+ /// @param {Number} $triangle-size - Width of the triangle.
11
+ /// @param {Color} $triangle-color - Color of the triangle.
12
+ /// @param {Keyword} $triangle-direction - Direction the triangle points. Can be `top`, `right`, `bottom`, or `left`.
13
+ @mixin css-triangle(
14
+ $triangle-size,
15
+ $triangle-color,
16
+ $triangle-direction
17
+ ) {
18
+ content: '';
19
+ display: block;
20
+ width: 0;
21
+ height: 0;
22
+ border: inset $triangle-size;
23
+
24
+ @if ($triangle-direction == down) {
25
+ border-color: $triangle-color transparent transparent;
26
+ border-top-style: solid;
27
+ }
28
+ @if ($triangle-direction == up) {
29
+ border-color: transparent transparent $triangle-color;
30
+ border-bottom-style: solid;
31
+ }
32
+ @if ($triangle-direction == right) {
33
+ border-color: transparent transparent transparent $triangle-color;
34
+ border-left-style: solid;
35
+ }
36
+ @if ($triangle-direction == left) {
37
+ border-color: transparent $triangle-color transparent transparent;
38
+ border-right-style: solid;
39
+ }
40
+ }
41
+
42
+ /// Creates a menu icon with a set width, height, number of bars, and colors. The mixin uses the height of the icon and the weight of the bars to determine spacing. <div class="docs-example-burger"></div>
43
+ /// @param {Color} $color - Color to use for the icon.
44
+ /// @param {Color} $color-hover - Color to use when the icon is hovered over.
45
+ /// @param {Number} $width - Width of the icon.
46
+ /// @param {Number} $height - Height of the icon.
47
+ /// @param {Number} $weight - Height of individual bars in the icon.
48
+ /// @param {Number} $bars - Number of bars in the icon.
49
+ @mixin hamburger(
50
+ $color: black,
51
+ $color-hover: #666,
52
+ $width: 20px,
53
+ $height: 16px,
54
+ $weight: 2px,
55
+ $bars: 3
56
+ ) {
57
+ // box-shadow CSS output
58
+ $shadow: ();
59
+ $hover-shadow: ();
60
+
61
+ // Spacing between bars is calculated based on the total height of the icon and the weight of each bar
62
+ $spacing: floor(($height - ($weight * $bars)) / ($bars - 1));
63
+
64
+ // Icon container
65
+ position: relative;
66
+ display: inline-block;
67
+ vertical-align: middle;
68
+ cursor: pointer;
69
+ width: $width;
70
+ height: $height;
71
+
72
+ // Icon bars
73
+ &::after {
74
+ content: '';
75
+ position: absolute;
76
+ display: block;
77
+ width: 100%;
78
+ height: $weight;
79
+ background: $color;
80
+ top: 0;
81
+ left: 0;
82
+
83
+ @for $i from 2 through $bars {
84
+ $offset: ($weight + $spacing) * ($i - 1);
85
+ $shadow: append($shadow, 0 $offset 0 $color, comma);
86
+ }
87
+
88
+ box-shadow: $shadow;
89
+ }
90
+
91
+ // Hover state
92
+ @if $color-hover {
93
+ // Generate CSS
94
+ @for $i from 2 through $bars {
95
+ $offset: ($weight + $spacing) * ($i - 1);
96
+ $hover-shadow: append($hover-shadow, 0 $offset 0 $color-hover, comma);
97
+ }
98
+
99
+ &:hover::after {
100
+ background: $color-hover;
101
+ box-shadow: $hover-shadow;
102
+ }
103
+ }
104
+ }
105
+
106
+ /// Adds a downward-facing triangle as a background image to an element. The image is formatted as an SVG, making it easy to change the color. Because Internet Explorer doesn't support encoded SVGs as background images, a PNG fallback is also included.
107
+ /// There are two PNG fallbacks: a black triangle and a white triangle. The one used depends on the lightness of the input color.
108
+ /// @param {Color} $color [$black] - Color to use for the triangle.
109
+ @mixin background-triangle($color: $black) {
110
+ $rgb: 'rgb(#{red($color)}, #{green($color)}, #{blue($color)})';
111
+
112
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="32" height="24" viewBox="0 0 32 24"><polygon points="0,0 32,0 16,24" style="fill: #{$rgb}"></polygon></svg>');
113
+
114
+ @media screen and (min-width:0\0) {
115
+ @if lightness($color) < 50% {
116
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAYCAYAAACbU/80AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIpJREFUeNrEkckNgDAMBBfRkEt0ObRBBdsGXUDgmQfK4XhH2m8czQAAy27R3tsw4Qfe2x8uOO6oYLb6GlOor3GF+swURAOmUJ+RwtEJs9WvTGEYxBXqI1MQAZhCfUQKRzDMVj+TwrAIV6jvSUEkYAr1LSkcyTBb/V+KYfX7xAeusq3sLDtGH3kEGACPWIflNZfhRQAAAABJRU5ErkJggg==');
117
+ }
118
+ @else {
119
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAYCAYAAACbU/80AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAMBJREFUeNrEllsOhCAMRVszC9IlzU7KCmVHTJsoMWYMUtpyv9BgbuXQB5ZSdgBYYY4ycgBivk8KYFsQMfMiTTBP4o3nUzCKzOabLJbLy2/g31evGkAginR4/ZegKH5qX3bJCscA3t0x3kgO5tQFyhhFf50xRqFLbyMUNJQzgyjGS/wgCpvKqkRBpuWrE4V9d+1E4dPUXqIg107SQOE/2DRQxMwTDygIInVDET9T3lCoj/6j/VCmGjZOl2lKpZ8AAwDQP7zIimDGFQAAAABJRU5ErkJggg==');
120
+ }
121
+ }
122
+ }
123
+
124
+ /// Applies the micro clearfix hack popularized by Nicolas Gallagher. Include this mixin on a container if its children are all floated, to give the container a proper height.
125
+ /// @link http://nicolasgallagher.com/micro-clearfix-hack/ Micro Clearfix Hack
126
+ @mixin clearfix {
127
+ &::before,
128
+ &::after {
129
+ content: ' ';
130
+ display: table;
131
+ }
132
+
133
+ &::after {
134
+ clear: both;
135
+ }
136
+ }
137
+
138
+ /// Adds CSS for a "quantity query" selector that automatically sizes elements based on how many there are inside a container.
139
+ /// @param {Number} $max - Maximum number of items to detect. The higher this number is, the more CSS that's required to cover each number of items.
140
+ /// @param {Keyword} $elem [li] - Tag to use for sibling selectors.
141
+ /// @link http://alistapart.com/article/quantity-queries-for-css Quantity Queries for CSS
142
+ @mixin auto-width($max, $elem: li) {
143
+ @for $i from 2 through $max {
144
+ &:nth-last-child(#{$i}):first-child,
145
+ &:nth-last-child(#{$i}):first-child ~ #{$elem} {
146
+ width: percentage(1 / $i);
147
+ }
148
+ }
149
+ }
150
+
151
+ /// Removes the focus ring around an element when a mouse input is detected.
152
+ @mixin disable-mouse-outline {
153
+ [data-whatinput="mouse"] & {
154
+ outline: 0;
155
+ }
156
+ }
157
+
158
+ /// Makes an element visually hidden, but still accessible to keyboards and assistive devices.
159
+ /// @link http://snook.ca/archives/html_and_css/hiding-content-for-accessibility Hiding Content for Accessibility
160
+ @mixin element-invisible {
161
+ position: absolute !important;
162
+ width: 1px;
163
+ height: 1px;
164
+ overflow: hidden;
165
+ clip: rect(0, 0, 0, 0);
166
+ }
167
+
168
+ /// Reverses the CSS output created by the `element-invisible()` mixin.
169
+ @mixin element-invisible-off {
170
+ position: static !important;
171
+ height: auto;
172
+ width: auto;
173
+ overflow: visible;
174
+ clip: auto;
175
+ }
176
+
177
+ /// Vertically and horizontally centers an element using `transform`.
178
+ @mixin vertical-center {
179
+ position: absolute;
180
+ top: 50%;
181
+ left: 50%;
182
+ transform: translate(-50%, -50%);
183
+ }
184
+
185
+ /// Vertically centers an element using `transform`.
186
+ @mixin v-align-middle {
187
+ position: absolute;
188
+ top: 50%;
189
+ transform: translateY(-50%);
190
+ }
@@ -0,0 +1,39 @@
1
+ // Foundation for Sites by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ ////
6
+ /// @group functions
7
+ ////
8
+
9
+ /// Generates a selector with every text input type. You can also filter the list to only output a subset of those selectors.
10
+ /// @param {List|Keyword} $types [()] - A list of text input types to use. Leave blank to use all of them.
11
+ @function text-inputs($types: ()) {
12
+ $return: ();
13
+
14
+ $all-types:
15
+ text
16
+ password
17
+ date
18
+ datetime
19
+ datetime-local
20
+ month
21
+ week
22
+ email
23
+ number
24
+ search
25
+ tel
26
+ time
27
+ url
28
+ color;
29
+
30
+ @if not(hasvalue($types)) {
31
+ $types: $all-types;
32
+ }
33
+
34
+ @each $type in $types {
35
+ $return: append($return, unquote('[type="#{$type}"]'), comma);
36
+ }
37
+
38
+ @return $return;
39
+ }
@@ -0,0 +1,69 @@
1
+ // Foundation for Sites by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ ////
6
+ /// @group functions
7
+ ////
8
+
9
+ // scss-lint:disable ZeroUnit
10
+
11
+ /// Defines the base font size of the page, which is the value `1rem` is equal to.
12
+ /// @type Number
13
+ /// @group global
14
+ $rem-base: 16px !default;
15
+
16
+ /// Removes the unit (e.g. px, em, rem) from a value, returning the number only.
17
+ /// @param {Number} $num - Number to strip unit from.
18
+ /// @returns {Number} The same number, sans unit.
19
+ @function strip-unit($num) {
20
+ @return $num / ($num * 0 + 1);
21
+ }
22
+
23
+ /// Converts one or more pixel values into matching rem values.
24
+ /// @param {Number|List} $values - One or more values to convert. Be sure to separate them with spaces and not commas. If you need to convert a comma-separated list, wrap the list in parentheses.
25
+ /// @param {Number} $base [$rem-base] - The base value to use when calculating the `rem`. If you're using Foundation out of the box, this is 16px.
26
+ /// @returns {List} A list of converted values.
27
+ @function rem-calc($values, $base: $rem-base) {
28
+ $rem-values: ();
29
+ $count: length($values);
30
+
31
+ @if $base == null {
32
+ $base: $rem-base;
33
+ }
34
+
35
+ @if $count == 1 {
36
+ @return -zf-to-rem($values, $base);
37
+ }
38
+
39
+ @for $i from 1 through $count {
40
+ $rem-values: append($rem-values, -zf-to-rem(nth($values, $i), $base));
41
+ }
42
+
43
+ @return $rem-values;
44
+ }
45
+
46
+ // Converts a unitless, pixel, or rem value to em, for use in breakpoints.
47
+ @function -zf-bp-to-em($value) {
48
+ // Pixel and unitless values are converted to rems
49
+ @if unit($value) == 'px' or unit($value) == '' {
50
+ $value: rem-calc($value);
51
+ }
52
+
53
+ // Then the value is converted to ems
54
+ @return strip-unit($value) * 1em;
55
+ }
56
+
57
+ /// Converts a pixel value to matching rem value. *Any* value passed, regardless of unit, is assumed to be a pixel value. By default, the base pixel value used to calculate the rem value is taken from the `$rem-base` variable.
58
+ /// @param {Number} $value - Pixel value to convert.
59
+ /// @returns {Number} A number in rems, calculated based on the given value and the base pixel value. rem values are passed through as is.
60
+ /// @access private
61
+ @function -zf-to-rem($value, $base: $rem-base) {
62
+ // Calculate rem if units for $value is not rem
63
+ @if (unit($value) != 'rem') {
64
+ $value: strip-unit($value) / strip-unit($base) * 1rem;
65
+ }
66
+ // Turn 0rem into 0
67
+ @if ($value == 0rem) { $value: 0; }
68
+ @return $value;
69
+ }
@@ -0,0 +1,15 @@
1
+ // Foundation for Sites by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ // Utilities
6
+ @import 'unit';
7
+ @import 'value';
8
+ @import 'color';
9
+ @import 'selector';
10
+
11
+ // Libraries
12
+ @import 'breakpoint';
13
+
14
+ // Mixins
15
+ @import 'mixins';
@@ -0,0 +1,117 @@
1
+ // Foundation for Sites by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ ////
6
+ /// @group functions
7
+ ////
8
+
9
+ /// Determine if a value is not falsey, in CSS terms. Falsey values are `null`, `none`, `0` with any unit, or an empty list.
10
+ /// @param $val - Value to check.
11
+ /// @returns {Boolean} `true` if `$val` is not falsey.
12
+ @function hasvalue($val) {
13
+ @if $val == null or $val == none {
14
+ @return false;
15
+ }
16
+ @if type-of($val) == 'number' and strip-unit($val) == 0 {
17
+ @return false;
18
+ }
19
+ @if type-of($val) == 'list' and length($val) == 0 {
20
+ @return false;
21
+ }
22
+ @return true;
23
+ }
24
+
25
+ /// Determine a top/right/bottom/right value on a padding, margin, etc. property, no matter how many values were passed in. Use this function if you need to know the specific side of a value, but don't know if the value is using a shorthand format.
26
+ /// @param {List|Number} $val - Value to analyze. Should be a shorthand sizing property, e.g. "1em 2em 1em"
27
+ /// @param {Keyword} $side - Side to return. Should be `top`, `right`, `bottom`, or `left`.
28
+ /// @returns {Number} A single value based on `$val` and `$side`.
29
+ @function get-side($val, $side) {
30
+ $length: length($val);
31
+
32
+ @if $length == 1 {
33
+ @return $val;
34
+ }
35
+ @if $length == 2 {
36
+ @return map-get((
37
+ top: nth($val, 1),
38
+ bottom: nth($val, 1),
39
+ left: nth($val, 2),
40
+ right: nth($val, 2),
41
+ ), $side);
42
+ }
43
+ @if $length == 3 {
44
+ @return map-get((
45
+ top: nth($val, 1),
46
+ left: nth($val, 2),
47
+ right: nth($val, 2),
48
+ bottom: nth($val, 3),
49
+ ), $side);
50
+ }
51
+ @if $length == 4 {
52
+ @return map-get((
53
+ top: nth($val, 1),
54
+ right: nth($val, 2),
55
+ bottom: nth($val, 3),
56
+ left: nth($val, 4),
57
+ ), $side);
58
+ }
59
+ }
60
+
61
+ /// Given border $val, find a specific element of the border, which is $elem. The possible values for $elem are width, style, and color.
62
+ /// @param {List} $val - Border value to find a value in.
63
+ /// @param {Keyword} $elem - Border component to extract.
64
+ /// @returns {Mixed} If the value exists, returns the value. If the value is not in the border definition, the function will return a 0px width, solid style, or black border.
65
+ @function get-border-value($val, $elem) {
66
+ // Find the width, style, or color and return it
67
+ @each $v in $val {
68
+ $type: type-of($v);
69
+ @if $elem == width and $type == 'number' {
70
+ @return $v;
71
+ }
72
+ @if $elem == style and $type == 'string' {
73
+ @return $v;
74
+ }
75
+ @if $elem == color and $type == 'color' {
76
+ @return $v;
77
+ }
78
+ }
79
+
80
+ // Defaults
81
+ $defaults: (
82
+ width: 0,
83
+ style: solid,
84
+ color: #000,
85
+ );
86
+ @return map-get($defaults, $elem);
87
+ }
88
+
89
+ /// Calculates x^y, where x is `$base` and y is `$power`.
90
+ /// @access private
91
+ /// @param {Number} $base - Base number (x).
92
+ /// @param {Number} $power - Exponent (y).
93
+ @function pow($base, $power) {
94
+ @if $power == 0 { @return 1; }
95
+ @return $base * pow($base, $power - 1);
96
+ }
97
+
98
+ // TODO: Remove this (it's used by the grid but is overkill)
99
+ /// Given a user-defined list of keywords and a list of possible keywords, find the ones that were passed in.
100
+ /// @param {List} $opts - List of values to find keywords in.
101
+ /// @param {List} $seeking - List of all possible keywords.
102
+ /// @access private
103
+ /// @returns {Map} A map of all keywords in $seeking. If a keyword was found in $opts, its value is true, otherwise false.
104
+ @function -zf-get-options($opts, $seeking) {
105
+ @if type-of($opts) != 'list' {
106
+ $opts: ($opts);
107
+ }
108
+
109
+ $map: ();
110
+ @each $keyword in $seeking {
111
+ $val: if(index($opts, $keyword) != null, true, false);
112
+ $item: ($keyword: $val);
113
+ $map: map-merge($map, $item);
114
+ }
115
+
116
+ @return $map;
117
+ }