foundation-rails 5.5.3.2 → 6.1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/README.md +2 -8
  4. data/Rakefile +23 -0
  5. data/app/views/foundation/rails/styleguide/show.html.erb +2 -5
  6. data/bower.json +2 -2
  7. data/lib/foundation/rails/version.rb +1 -1
  8. data/lib/generators/foundation/install_generator.rb +6 -3
  9. data/lib/generators/foundation/templates/_settings.scss +546 -0
  10. data/lib/generators/foundation/templates/application.html.erb +0 -1
  11. data/lib/generators/foundation/templates/application.html.haml +0 -2
  12. data/lib/generators/foundation/templates/application.html.slim +0 -2
  13. data/lib/generators/foundation/templates/foundation_and_overrides.scss +51 -0
  14. data/vendor/assets/js/foundation.abide.js +418 -0
  15. data/vendor/assets/js/foundation.accordion.js +229 -0
  16. data/vendor/assets/js/foundation.accordionMenu.js +262 -0
  17. data/vendor/assets/js/foundation.core.js +378 -0
  18. data/vendor/assets/js/foundation.drilldown.js +321 -0
  19. data/vendor/assets/js/foundation.dropdown.js +390 -0
  20. data/vendor/assets/js/foundation.dropdownMenu.js +391 -0
  21. data/vendor/assets/js/foundation.equalizer.js +274 -0
  22. data/vendor/assets/js/foundation.interchange.js +184 -0
  23. data/vendor/assets/js/foundation.js +28 -0
  24. data/vendor/assets/js/foundation.magellan.js +212 -0
  25. data/vendor/assets/js/foundation.offcanvas.js +371 -0
  26. data/vendor/assets/js/foundation.orbit.js +419 -0
  27. data/vendor/assets/js/foundation.responsiveMenu.js +145 -0
  28. data/vendor/assets/js/foundation.responsiveToggle.js +106 -0
  29. data/vendor/assets/js/foundation.reveal.js +478 -0
  30. data/vendor/assets/js/foundation.slider.js +484 -0
  31. data/vendor/assets/js/foundation.sticky.js +436 -0
  32. data/vendor/assets/js/foundation.tabs.js +306 -0
  33. data/vendor/assets/js/foundation.toggler.js +147 -0
  34. data/vendor/assets/js/foundation.tooltip.js +429 -0
  35. data/vendor/assets/js/foundation.util.box.js +169 -0
  36. data/vendor/assets/js/foundation.util.keyboard.js +115 -0
  37. data/vendor/assets/js/foundation.util.mediaQuery.js +210 -0
  38. data/vendor/assets/js/foundation.util.motion.js +89 -0
  39. data/vendor/assets/js/foundation.util.nest.js +64 -0
  40. data/vendor/assets/js/foundation.util.timerAndImageLoader.js +78 -0
  41. data/vendor/assets/js/foundation.util.touch.js +339 -0
  42. data/vendor/assets/js/foundation.util.triggers.js +222 -0
  43. data/vendor/assets/scss/_global.scss +626 -0
  44. data/vendor/assets/scss/components/_accordion-menu.scss +32 -0
  45. data/vendor/assets/scss/components/_accordion.scss +113 -0
  46. data/vendor/assets/scss/components/_badge.scss +55 -0
  47. data/vendor/assets/scss/components/_breadcrumbs.scss +94 -0
  48. data/vendor/assets/scss/components/_button-group.scss +130 -0
  49. data/vendor/assets/scss/components/_button.scss +265 -0
  50. data/vendor/assets/scss/components/_callout.scss +105 -0
  51. data/vendor/assets/scss/components/_close-button.scss +61 -0
  52. data/vendor/assets/scss/components/_drilldown.scss +75 -0
  53. data/vendor/assets/scss/components/_dropdown-menu.scss +148 -0
  54. data/vendor/assets/scss/components/_dropdown.scss +64 -0
  55. data/vendor/assets/scss/components/_flex-video.scss +63 -0
  56. data/vendor/assets/scss/components/_float.scss +27 -0
  57. data/vendor/assets/scss/components/_label.scss +56 -0
  58. data/vendor/assets/scss/components/_media-object.scss +74 -0
  59. data/vendor/assets/scss/components/_menu.scss +209 -0
  60. data/vendor/assets/scss/components/_off-canvas.scss +180 -0
  61. data/vendor/assets/scss/components/_orbit.scss +193 -0
  62. data/vendor/assets/scss/components/_pagination.scss +158 -0
  63. data/vendor/assets/scss/components/_progress-bar.scss +83 -0
  64. data/vendor/assets/scss/components/_reveal.scss +156 -0
  65. data/vendor/assets/scss/components/_slider.scss +158 -0
  66. data/vendor/assets/scss/components/_sticky.scss +38 -0
  67. data/vendor/assets/scss/components/_switch.scss +232 -0
  68. data/vendor/assets/scss/components/_table.scss +213 -0
  69. data/vendor/assets/scss/components/_tabs.scss +170 -0
  70. data/vendor/assets/scss/components/_thumbnail.scss +54 -0
  71. data/vendor/assets/scss/components/_title-bar.scss +68 -0
  72. data/vendor/assets/scss/components/_tooltip.scss +100 -0
  73. data/vendor/assets/scss/components/_top-bar.scss +89 -0
  74. data/vendor/assets/scss/components/_visibility.scss +131 -0
  75. data/vendor/assets/scss/forms/_checkbox.scss +36 -0
  76. data/vendor/assets/scss/forms/_error.scss +82 -0
  77. data/vendor/assets/scss/forms/_fieldset.scss +53 -0
  78. data/vendor/assets/scss/forms/_forms.scss +32 -0
  79. data/vendor/assets/scss/forms/_help-text.scss +30 -0
  80. data/vendor/assets/scss/forms/_input-group.scss +91 -0
  81. data/vendor/assets/scss/forms/_label.scss +48 -0
  82. data/vendor/assets/scss/forms/_select.scss +63 -0
  83. data/vendor/assets/scss/forms/_text.scss +154 -0
  84. data/vendor/assets/scss/foundation.scss +91 -0
  85. data/vendor/assets/scss/grid/_classes.scss +153 -0
  86. data/vendor/assets/scss/grid/_column.scss +124 -0
  87. data/vendor/assets/scss/grid/_flex-grid.scss +281 -0
  88. data/vendor/assets/scss/grid/_grid.scss +48 -0
  89. data/vendor/assets/scss/grid/_gutter.scss +34 -0
  90. data/vendor/assets/scss/grid/_layout.scss +33 -0
  91. data/vendor/assets/scss/grid/_position.scss +72 -0
  92. data/vendor/assets/scss/grid/_row.scss +97 -0
  93. data/vendor/assets/scss/grid/_size.scss +24 -0
  94. data/vendor/assets/scss/settings/_settings.scss +547 -0
  95. data/vendor/assets/scss/typography/_alignment.scss +22 -0
  96. data/vendor/assets/scss/typography/_base.scss +439 -0
  97. data/vendor/assets/scss/typography/_helpers.scss +77 -0
  98. data/vendor/assets/scss/typography/_print.scss +73 -0
  99. data/vendor/assets/scss/typography/_typography.scss +28 -0
  100. data/vendor/assets/scss/util/_breakpoint.scss +266 -0
  101. data/vendor/assets/scss/util/_color.scss +41 -0
  102. data/vendor/assets/scss/util/_mixins.scss +223 -0
  103. data/vendor/assets/scss/util/_selector.scss +40 -0
  104. data/vendor/assets/scss/util/_unit.scss +90 -0
  105. data/vendor/assets/scss/util/_util.scss +15 -0
  106. data/vendor/assets/scss/util/_value.scss +126 -0
  107. metadata +97 -64
  108. data/update-gem.sh +0 -20
  109. data/vendor/assets/javascripts/foundation.js +0 -17
  110. data/vendor/assets/javascripts/foundation/foundation.abide.js +0 -426
  111. data/vendor/assets/javascripts/foundation/foundation.accordion.js +0 -125
  112. data/vendor/assets/javascripts/foundation/foundation.alert.js +0 -43
  113. data/vendor/assets/javascripts/foundation/foundation.clearing.js +0 -586
  114. data/vendor/assets/javascripts/foundation/foundation.dropdown.js +0 -468
  115. data/vendor/assets/javascripts/foundation/foundation.equalizer.js +0 -104
  116. data/vendor/assets/javascripts/foundation/foundation.interchange.js +0 -360
  117. data/vendor/assets/javascripts/foundation/foundation.joyride.js +0 -935
  118. data/vendor/assets/javascripts/foundation/foundation.js +0 -732
  119. data/vendor/assets/javascripts/foundation/foundation.magellan.js +0 -214
  120. data/vendor/assets/javascripts/foundation/foundation.offcanvas.js +0 -225
  121. data/vendor/assets/javascripts/foundation/foundation.orbit.js +0 -476
  122. data/vendor/assets/javascripts/foundation/foundation.reveal.js +0 -522
  123. data/vendor/assets/javascripts/foundation/foundation.slider.js +0 -296
  124. data/vendor/assets/javascripts/foundation/foundation.tab.js +0 -247
  125. data/vendor/assets/javascripts/foundation/foundation.tooltip.js +0 -348
  126. data/vendor/assets/javascripts/foundation/foundation.topbar.js +0 -458
  127. data/vendor/assets/javascripts/vendor/modernizr.js +0 -1406
  128. data/vendor/assets/stylesheets/foundation.scss +0 -42
  129. data/vendor/assets/stylesheets/foundation/_functions.scss +0 -156
  130. data/vendor/assets/stylesheets/foundation/_settings.scss +0 -1489
  131. data/vendor/assets/stylesheets/foundation/components/_accordion.scss +0 -161
  132. data/vendor/assets/stylesheets/foundation/components/_alert-boxes.scss +0 -128
  133. data/vendor/assets/stylesheets/foundation/components/_block-grid.scss +0 -133
  134. data/vendor/assets/stylesheets/foundation/components/_breadcrumbs.scss +0 -132
  135. data/vendor/assets/stylesheets/foundation/components/_button-groups.scss +0 -208
  136. data/vendor/assets/stylesheets/foundation/components/_buttons.scss +0 -261
  137. data/vendor/assets/stylesheets/foundation/components/_clearing.scss +0 -260
  138. data/vendor/assets/stylesheets/foundation/components/_dropdown-buttons.scss +0 -130
  139. data/vendor/assets/stylesheets/foundation/components/_dropdown.scss +0 -269
  140. data/vendor/assets/stylesheets/foundation/components/_flex-video.scss +0 -51
  141. data/vendor/assets/stylesheets/foundation/components/_forms.scss +0 -607
  142. data/vendor/assets/stylesheets/foundation/components/_global.scss +0 -566
  143. data/vendor/assets/stylesheets/foundation/components/_grid.scss +0 -292
  144. data/vendor/assets/stylesheets/foundation/components/_icon-bar.scss +0 -460
  145. data/vendor/assets/stylesheets/foundation/components/_inline-lists.scss +0 -58
  146. data/vendor/assets/stylesheets/foundation/components/_joyride.scss +0 -220
  147. data/vendor/assets/stylesheets/foundation/components/_keystrokes.scss +0 -60
  148. data/vendor/assets/stylesheets/foundation/components/_labels.scss +0 -106
  149. data/vendor/assets/stylesheets/foundation/components/_magellan.scss +0 -34
  150. data/vendor/assets/stylesheets/foundation/components/_offcanvas.scss +0 -606
  151. data/vendor/assets/stylesheets/foundation/components/_orbit.scss +0 -388
  152. data/vendor/assets/stylesheets/foundation/components/_pagination.scss +0 -163
  153. data/vendor/assets/stylesheets/foundation/components/_panels.scss +0 -107
  154. data/vendor/assets/stylesheets/foundation/components/_pricing-tables.scss +0 -150
  155. data/vendor/assets/stylesheets/foundation/components/_progress-bars.scss +0 -85
  156. data/vendor/assets/stylesheets/foundation/components/_range-slider.scss +0 -177
  157. data/vendor/assets/stylesheets/foundation/components/_reveal.scss +0 -212
  158. data/vendor/assets/stylesheets/foundation/components/_side-nav.scss +0 -120
  159. data/vendor/assets/stylesheets/foundation/components/_split-buttons.scss +0 -203
  160. data/vendor/assets/stylesheets/foundation/components/_sub-nav.scss +0 -125
  161. data/vendor/assets/stylesheets/foundation/components/_switches.scss +0 -241
  162. data/vendor/assets/stylesheets/foundation/components/_tables.scss +0 -135
  163. data/vendor/assets/stylesheets/foundation/components/_tabs.scss +0 -142
  164. data/vendor/assets/stylesheets/foundation/components/_thumbs.scss +0 -66
  165. data/vendor/assets/stylesheets/foundation/components/_tooltips.scss +0 -142
  166. data/vendor/assets/stylesheets/foundation/components/_top-bar.scss +0 -745
  167. data/vendor/assets/stylesheets/foundation/components/_type.scss +0 -525
  168. data/vendor/assets/stylesheets/foundation/components/_visibility.scss +0 -425
  169. data/vendor/assets/stylesheets/normalize.scss +0 -424
@@ -0,0 +1,77 @@
1
+ // Foundation for Sites by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ ////
6
+ /// @group typography-helpers
7
+ ////
8
+
9
+ /// Default font size for lead paragraphs.
10
+ /// @type Number
11
+ $lead-font-size: $global-font-size * 1.25 !default;
12
+
13
+ /// Default line height for lead paragraphs.
14
+ /// @type String
15
+ $lead-lineheight: 1.6 !default;
16
+
17
+ /// Default line height for subheaders.
18
+ /// @type Number
19
+ $subheader-lineheight: 1.4 !default;
20
+
21
+ /// Default font color for subheaders.
22
+ /// @type Color
23
+ $subheader-color: $dark-gray !default;
24
+
25
+ /// Default font weight for subheaders.
26
+ /// @type String
27
+ $subheader-font-weight: $global-weight-normal !default;
28
+
29
+ /// Default top margin for subhheaders.
30
+ /// @type Number
31
+ $subheader-margin-top: 0.2rem !default;
32
+
33
+ /// Default bottom margin for subheaders.
34
+ /// @type Number
35
+ $subheader-margin-bottom: 0.5rem !default;
36
+
37
+ /// Default font size for statistic numbers.
38
+ /// @type Number
39
+ $stat-font-size: 2.5rem !default;
40
+
41
+ @mixin foundation-typography-helpers {
42
+ // Use to create a subheading under a main header
43
+ // Make sure you pair the two elements in a <header> element, like this:
44
+ // <header>
45
+ // <h1>Heading</h1>
46
+ // <h2>Subheading</h2>
47
+ // </header>
48
+ .subheader {
49
+ margin-top: $subheader-margin-top;
50
+ margin-bottom: $subheader-margin-bottom;
51
+ font-weight: $subheader-font-weight;
52
+ line-height: $subheader-lineheight;
53
+ color: $subheader-color;
54
+ }
55
+
56
+ // Use to style an introductory lead, deck, blurb, etc.
57
+ .lead {
58
+ font-size: $lead-font-size;
59
+ line-height: $lead-lineheight;
60
+ }
61
+
62
+ // Use to style a large number to display a statistic
63
+ .stat {
64
+ font-size: $stat-font-size;
65
+ line-height: 1;
66
+
67
+ p + & {
68
+ margin-top: -1rem;
69
+ }
70
+ }
71
+
72
+ // Use to remove the bullets from an unordered list
73
+ .no-bullet {
74
+ margin-#{$global-left}: 0;
75
+ list-style: none;
76
+ }
77
+ }
@@ -0,0 +1,73 @@
1
+ // Foundation for Sites by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ ////
6
+ /// @group typography
7
+ ////
8
+
9
+ // scss-lint:disable all
10
+
11
+ @mixin foundation-print-styles {
12
+ .show-for-print { display: none !important; }
13
+
14
+ @media print {
15
+ * {
16
+ background: transparent !important;
17
+ color: black !important; // Black prints faster: h5bp.com/s
18
+ box-shadow: none !important;
19
+ text-shadow: none !important;
20
+ }
21
+
22
+ .show-for-print { display: block !important; }
23
+ .hide-for-print { display: none !important; }
24
+
25
+ table.show-for-print { display: table !important; }
26
+ thead.show-for-print { display: table-header-group !important; }
27
+ tbody.show-for-print { display: table-row-group !important; }
28
+ tr.show-for-print { display: table-row !important; }
29
+ td.show-for-print { display: table-cell !important; }
30
+ th.show-for-print { display: table-cell !important; }
31
+
32
+ // Display the URL of a link after the text
33
+ a,
34
+ a:visited { text-decoration: underline;}
35
+ a[href]:after { content: ' (' attr(href) ')'; }
36
+
37
+ // Don't display the URL for images or JavaScript/internal links
38
+ .ir a:after,
39
+ a[href^='javascript:']:after,
40
+ a[href^='#']:after { content: ''; }
41
+
42
+ // Display what an abbreviation stands for after the text
43
+ abbr[title]:after { content: ' (' attr(title) ')'; }
44
+
45
+ // Prevent page breaks in the middle of a blockquote or preformatted text block
46
+ pre,
47
+ blockquote {
48
+ border: 1px solid #999;
49
+ page-break-inside: avoid;
50
+ }
51
+
52
+ // h5bp.com/t
53
+ thead { display: table-header-group; }
54
+
55
+ tr,
56
+ img { page-break-inside: avoid; }
57
+
58
+ img { max-width: 100% !important; }
59
+
60
+ @page { margin: 0.5cm; }
61
+
62
+ p,
63
+ h2,
64
+ h3 {
65
+ orphans: 3;
66
+ widows: 3;
67
+ }
68
+
69
+ // Avoid page breaks after a heading
70
+ h2,
71
+ h3 { page-break-after: avoid; }
72
+ }
73
+ }
@@ -0,0 +1,28 @@
1
+ // Foundation for Sites by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ ////
6
+ /// @group typography
7
+ ////
8
+
9
+ // scss-lint:disable DeclarationOrder
10
+
11
+ // Base typography styles (tags only)
12
+ @import 'base';
13
+
14
+ // Typography helper classes (classes only)
15
+ @import 'helpers';
16
+
17
+ // Text alignment classes
18
+ @import 'alignment';
19
+
20
+ // Print styles
21
+ @import 'print';
22
+
23
+ @mixin foundation-typography {
24
+ @include foundation-typography-base;
25
+ @include foundation-typography-helpers;
26
+ @include foundation-text-alignment;
27
+ @include foundation-print-styles;
28
+ }
@@ -0,0 +1,266 @@
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
+ ///
27
+ /// @param {Keyword|Number} $val [small] - Breakpoint name, or px, rem, or em value to process.
28
+ @function breakpoint($val: small) {
29
+ // Size or keyword
30
+ $bp: nth($val, 1);
31
+ // Value for max-width media queries
32
+ $bp-max: 0;
33
+ // Direction of media query (up, down, or only)
34
+ $dir: if(length($val) > 1, nth($val, 2), up);
35
+ // Eventual output
36
+ $str: '';
37
+ // Is it a named media query?
38
+ $named: false;
39
+
40
+ // Orientation media queries have a unique syntax
41
+ @if $bp == 'landscape' or $bp == 'portrait' {
42
+ @return '(orientation: #{$bp})';
43
+ }
44
+ @else if $bp == 'retina' {
45
+ @return '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)';
46
+ }
47
+
48
+ // Try to pull a named breakpoint out of the $breakpoints map
49
+ @if type-of($bp) == 'string' {
50
+ @if map-has-key($breakpoints, $bp) {
51
+ @if $dir == 'only' or $dir == 'down' {
52
+ $next-bp: -zf-map-next($breakpoints, $bp);
53
+
54
+ @if $next-bp == null {
55
+ $bp-max: null;
56
+ }
57
+ @else {
58
+ $bp-max: $next-bp;
59
+ }
60
+ }
61
+
62
+ $bp: map-get($breakpoints, $bp);
63
+ $named: true;
64
+ }
65
+ @else {
66
+ $bp: 0;
67
+ }
68
+ }
69
+
70
+ // Convert any pixel, rem, or unitless value to em
71
+ $bp: -zf-bp-to-em($bp);
72
+ @if $bp-max {
73
+ $bp-max: -zf-bp-to-em($bp-max) - (1/16);
74
+ }
75
+
76
+ // Skip media query creation if the input is "0 up"
77
+ @if $bp > 0em or $dir == 'only' or $dir == 'down' {
78
+ // `only` ranges use the format `(min-width: n) and (max-width: n)`
79
+ @if $dir == 'only' {
80
+ @if $named == true {
81
+ $str: $str + '(min-width: #{$bp})';
82
+
83
+ @if $bp-max != null {
84
+ $str: $str + ' and (max-width: #{$bp-max})';
85
+ }
86
+ }
87
+ @else {
88
+ @warn 'Only named media queries can have an `only` range.';
89
+ }
90
+ }
91
+
92
+ // `down` ranges use the format `(max-width: n)`
93
+ @else if $dir == 'down' {
94
+ $max: 0;
95
+
96
+ // For named breakpoints, subtract the breakpoint value by one "pixel", or 1/16em.
97
+ @if $named {
98
+ $max: $bp-max;
99
+ }
100
+ @else {
101
+ $max: $bp;
102
+ }
103
+
104
+ // Skip media query creation if input value is exactly "0 down" but don't "small down"
105
+ @if $named or $bp > 0em {
106
+ $str: $str + '(max-width: #{$max})';
107
+ }
108
+ }
109
+
110
+ // `up` ranges use the format `(min-width: n)`
111
+ @else if $bp > 0em {
112
+ $str: $str + '(min-width: #{$bp})';
113
+ }
114
+ }
115
+
116
+ @return $str;
117
+ }
118
+
119
+ /// Wraps a media query around the content you put inside the mixin. This mixin accepts a number of values:
120
+ /// - If a string is passed, the mixin will look for it in the `$breakpoints` map, and use a media query there.
121
+ /// - If a pixel value is passed, it will be converted to an em value using `$rem-base`.
122
+ /// - If a rem value is passed, the unit will be changed to em.
123
+ /// - If an em value is passed, the value will be used as-is.
124
+ ///
125
+ /// @param {Keyword|Number} $value - Breakpoint name, or px, rem, or em value to process.
126
+ ///
127
+ /// @output If the breakpoint is "0px and larger", outputs the content as-is. Otherwise, outputs the content wrapped in a media query.
128
+ @mixin breakpoint($value) {
129
+ $str: breakpoint($value);
130
+
131
+ // If $str is still an empty string, no media query is needed
132
+ @if $str == '' {
133
+ @content;
134
+ }
135
+
136
+ // Otherwise, wrap the content in a media query
137
+ @else {
138
+ @media screen and #{$str} {
139
+ @content;
140
+ }
141
+ }
142
+ }
143
+
144
+ /// 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.
145
+ /// @access private
146
+ ///
147
+ /// @param {Map} $map - Map to convert.
148
+ ///
149
+ /// @returns {String} A string containing the map's contents.
150
+ @function -zf-bp-serialize($map) {
151
+ $str: '';
152
+ @each $key, $value in $map {
153
+ $str: $str + $key + '=' + -zf-bp-to-em($value) + '&';
154
+ }
155
+ $str: str-slice($str, 1, -2);
156
+
157
+ @return $str;
158
+ }
159
+
160
+ /// Find the next key in a map.
161
+ /// @access private
162
+ ///
163
+ /// @param {Map} $map - Map to traverse.
164
+ /// @param {Mixed} $key - Key to use as a starting point.
165
+ ///
166
+ /// @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`.
167
+ @function -zf-map-next($map, $key) {
168
+ // Store the values of the map as a list, so we can access them with nth
169
+ $values: map-values($map);
170
+
171
+ // Ghetto for loop
172
+ $i: 1;
173
+ $found: false;
174
+ @each $val in map-keys($map) {
175
+ @if $found == false {
176
+ @if ($key == $val) {
177
+ $found: true;
178
+ }
179
+ $i: $i + 1;
180
+ }
181
+ }
182
+
183
+ // If the key doesn't exist, or it's the last key in the map, return null
184
+ @if $i > length($map) {
185
+ @return null;
186
+ }
187
+ // Otherwise, return the value
188
+ @else {
189
+ @return nth($values, $i);
190
+ }
191
+ }
192
+
193
+ /// Get a value for a breakpoint from a responsive config map. If the config map has the key `$value`, the exact breakpoint value is returned. If the config map does *not* have the breakpoint, the value matching the next lowest breakpoint in the config map is returned.
194
+ /// @access private
195
+ ///
196
+ /// @param {Map} $map - Input config map.
197
+ /// @param {Keyword} $value - Breakpoint name to use.
198
+ ///
199
+ /// @return {Mixed} The corresponding breakpoint value.
200
+ @function -zf-get-bp-val($map, $value) {
201
+ // Check if the breakpoint name exists globally
202
+ @if not map-has-key($breakpoints, $value) {
203
+ @return null;
204
+ }
205
+ // Check if the breakpoint name exists in the local config map
206
+ @else if map-has-key($map, $value) {
207
+ // If it does, just return the value
208
+ @return map-get($map, $value);
209
+ }
210
+ // Otherwise, find the next lowest breakpoint and return that value
211
+ @else {
212
+ $anchor: null;
213
+ $found: false;
214
+
215
+ @each $key, $val in $breakpoints {
216
+ @if not $found {
217
+ @if map-has-key($map, $key) {
218
+ $anchor: $key;
219
+ }
220
+ @if $key == $value {
221
+ $found: true;
222
+ }
223
+ }
224
+ }
225
+
226
+ @return map-get($map, $anchor);
227
+ }
228
+ }
229
+
230
+ // Legacy breakpoint variables
231
+ // These will be removed in 6.2
232
+ $small-up: null;
233
+ $small-only: null;
234
+ $medium-up: null;
235
+ $medium-only: null;
236
+ $large-up: null;
237
+ $large-only: null;
238
+ $xlarge-up: null;
239
+ $xlarge-only: null;
240
+ $xxlarge-up: null;
241
+ $xxlarge-only: null;
242
+
243
+ @if map-has-key($breakpoints, small) {
244
+ $small-up: screen;
245
+ $small-only: screen and #{breakpoint(small only)};
246
+ }
247
+
248
+ @if map-has-key($breakpoints, medium) {
249
+ $medium-up: screen and #{breakpoint(medium)};
250
+ $medium-only: screen and #{breakpoint(medium only)};
251
+ }
252
+
253
+ @if map-has-key($breakpoints, large) {
254
+ $large-up: screen and #{breakpoint(large)};
255
+ $large-only: screen and #{breakpoint(large only)};
256
+ }
257
+
258
+ @if map-has-key($breakpoints, xlarge) {
259
+ $xlarge-up: screen and #{breakpoint(xlarge)};
260
+ $xlarge-only: screen and #{breakpoint(xlarge only)};
261
+ }
262
+
263
+ @if map-has-key($breakpoints, xxlarge) {
264
+ $xxlarge-up: screen and #{breakpoint(xxlarge)};
265
+ $xxlarge-only: screen and #{breakpoint(xxlarge only)};
266
+ }
@@ -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
+ }