zurb-foundation-5 5.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. checksums.yaml +7 -0
  2. data/.bowerrc +3 -0
  3. data/.editorconfig +9 -0
  4. data/.gitignore +46 -0
  5. data/.travis.yml +34 -0
  6. data/CONTRIBUTING.md +55 -0
  7. data/Gemfile +3 -0
  8. data/Gemfile.lock +16 -0
  9. data/Gruntfile.js +222 -0
  10. data/LICENSE +22 -0
  11. data/README.md +44 -0
  12. data/bower.json +20 -0
  13. data/composer.json +9 -0
  14. data/foundation.gemspec +21 -0
  15. data/humans.txt +8 -0
  16. data/js/foundation/foundation.abide.js +299 -0
  17. data/js/foundation/foundation.accordion.js +54 -0
  18. data/js/foundation/foundation.alert.js +43 -0
  19. data/js/foundation/foundation.clearing.js +531 -0
  20. data/js/foundation/foundation.dropdown.js +306 -0
  21. data/js/foundation/foundation.equalizer.js +68 -0
  22. data/js/foundation/foundation.interchange.js +331 -0
  23. data/js/foundation/foundation.joyride.js +849 -0
  24. data/js/foundation/foundation.js +609 -0
  25. data/js/foundation/foundation.magellan.js +173 -0
  26. data/js/foundation/foundation.offcanvas.js +50 -0
  27. data/js/foundation/foundation.orbit.js +606 -0
  28. data/js/foundation/foundation.reveal.js +427 -0
  29. data/js/foundation/foundation.slider.js +200 -0
  30. data/js/foundation/foundation.tab.js +168 -0
  31. data/js/foundation/foundation.tooltip.js +272 -0
  32. data/js/foundation/foundation.topbar.js +422 -0
  33. data/karma.conf.js +114 -0
  34. data/lib/foundation/engine.rb +20 -0
  35. data/lib/foundation/generators/USAGE +15 -0
  36. data/lib/foundation/generators/install_generator.rb +54 -0
  37. data/lib/foundation/generators/templates/application.html.erb +47 -0
  38. data/lib/foundation/generators/templates/application.html.haml +31 -0
  39. data/lib/foundation/generators/templates/application.html.slim +35 -0
  40. data/lib/foundation/sprockets.rb +4 -0
  41. data/lib/foundation/version.rb +3 -0
  42. data/lib/scss.js +114 -0
  43. data/lib/zurb-foundation.rb +33 -0
  44. data/package.json +48 -0
  45. data/robots.txt +4 -0
  46. data/run-tests.sh +83 -0
  47. data/sache.json +5 -0
  48. data/scss/foundation.scss +45 -0
  49. data/scss/foundation/_functions.scss +101 -0
  50. data/scss/foundation/_settings.scss +1279 -0
  51. data/scss/foundation/components/_accordion.scss +52 -0
  52. data/scss/foundation/components/_alert-boxes.scss +126 -0
  53. data/scss/foundation/components/_block-grid.scss +132 -0
  54. data/scss/foundation/components/_breadcrumbs.scss +127 -0
  55. data/scss/foundation/components/_button-groups.scss +108 -0
  56. data/scss/foundation/components/_buttons.scss +222 -0
  57. data/scss/foundation/components/_clearing.scss +247 -0
  58. data/scss/foundation/components/_dropdown-buttons.scss +129 -0
  59. data/scss/foundation/components/_dropdown.scss +248 -0
  60. data/scss/foundation/components/_flex-video.scss +51 -0
  61. data/scss/foundation/components/_forms.scss +496 -0
  62. data/scss/foundation/components/_global.scss +365 -0
  63. data/scss/foundation/components/_grid.scss +261 -0
  64. data/scss/foundation/components/_inline-lists.scss +56 -0
  65. data/scss/foundation/components/_joyride.scss +220 -0
  66. data/scss/foundation/components/_keystrokes.scss +61 -0
  67. data/scss/foundation/components/_labels.scss +104 -0
  68. data/scss/foundation/components/_magellan.scss +34 -0
  69. data/scss/foundation/components/_offcanvas.scss +381 -0
  70. data/scss/foundation/components/_orbit.scss +415 -0
  71. data/scss/foundation/components/_pagination.scss +150 -0
  72. data/scss/foundation/components/_panels.scss +91 -0
  73. data/scss/foundation/components/_pricing-tables.scss +150 -0
  74. data/scss/foundation/components/_progress-bars.scss +79 -0
  75. data/scss/foundation/components/_range-slider.scss +148 -0
  76. data/scss/foundation/components/_reveal-new.scss +0 -0
  77. data/scss/foundation/components/_reveal.scss +216 -0
  78. data/scss/foundation/components/_side-nav.scss +93 -0
  79. data/scss/foundation/components/_split-buttons.scss +191 -0
  80. data/scss/foundation/components/_sub-nav.scss +125 -0
  81. data/scss/foundation/components/_switch.scss +294 -0
  82. data/scss/foundation/components/_tables.scss +97 -0
  83. data/scss/foundation/components/_tabs.scss +105 -0
  84. data/scss/foundation/components/_thumbs.scss +68 -0
  85. data/scss/foundation/components/_tooltips.scss +140 -0
  86. data/scss/foundation/components/_top-bar.scss +640 -0
  87. data/scss/foundation/components/_type.scss +493 -0
  88. data/scss/foundation/components/_visibility.scss +345 -0
  89. data/scss/foundation/test.html +0 -0
  90. data/scss/normalize.scss +423 -0
  91. data/spec/abide/abide.js +173 -0
  92. data/spec/abide/advanced.html +22 -0
  93. data/spec/abide/basic.html +13 -0
  94. data/spec/accordion/accordion.js +94 -0
  95. data/spec/accordion/basic.html +39 -0
  96. data/spec/accordion/grid.html +44 -0
  97. data/spec/accordion/multiexpand.html +20 -0
  98. data/spec/alert/alert.js +35 -0
  99. data/spec/alert/basic.html +4 -0
  100. data/spec/clearing/222.gif +0 -0
  101. data/spec/clearing/777.gif +0 -0
  102. data/spec/clearing/basic.html +5 -0
  103. data/spec/clearing/ccc.gif +0 -0
  104. data/spec/clearing/clearing.js +55 -0
  105. data/spec/dropdown/basic.html +10 -0
  106. data/spec/dropdown/dropdown.js +65 -0
  107. data/spec/equalizer/basic.html +24 -0
  108. data/spec/equalizer/equalizer.js +30 -0
  109. data/spec/framework/framework.js +14 -0
  110. data/spec/helpers.js +37 -0
  111. data/spec/interchange/basic.html +3 -0
  112. data/spec/interchange/interchange.js +60 -0
  113. data/spec/joyride/joyride.js +14 -0
  114. data/spec/magellan/magellan.js +14 -0
  115. data/spec/offcanvas/offcanvas.js +14 -0
  116. data/spec/orbit/orbit.js +14 -0
  117. data/spec/reveal/reveal.js +14 -0
  118. data/spec/tab/tab.js +14 -0
  119. data/spec/tooltip/tooltip.js +14 -0
  120. data/spec/topbar/multidropdown.html +60 -0
  121. data/spec/topbar/sticky.html +31 -0
  122. data/spec/topbar/topbar.js +96 -0
  123. metadata +238 -0
@@ -0,0 +1,129 @@
1
+ // Foundation by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ @import "global";
6
+
7
+ //
8
+ // @variables
9
+ //
10
+ $include-html-button-classes: $include-html-classes !default;
11
+
12
+ // We use these to set the color of the pip in dropdown buttons
13
+ $dropdown-button-pip-color: #fff !default;
14
+ $dropdown-button-pip-color-alt: #333 !default;
15
+
16
+ $button-pip-tny: rem-calc(6) !default;
17
+ $button-pip-sml: rem-calc(7) !default;
18
+ $button-pip-med: rem-calc(9) !default;
19
+ $button-pip-lrg: rem-calc(11) !default;
20
+
21
+ // We use these to style tiny dropdown buttons
22
+ $dropdown-button-padding-tny: $button-pip-tny * 7 !default;
23
+ $dropdown-button-pip-size-tny: $button-pip-tny !default;
24
+ $dropdown-button-pip-opposite-tny: $button-pip-tny * 3 !default;
25
+ $dropdown-button-pip-top-tny: -$button-pip-tny / 2 + rem-calc(1) !default;
26
+
27
+ // We use these to style small dropdown buttons
28
+ $dropdown-button-padding-sml: $button-pip-sml * 7 !default;
29
+ $dropdown-button-pip-size-sml: $button-pip-sml !default;
30
+ $dropdown-button-pip-opposite-sml: $button-pip-sml * 3 !default;
31
+ $dropdown-button-pip-top-sml: -$button-pip-sml / 2 + rem-calc(1) !default;
32
+
33
+ // We use these to style medium dropdown buttons
34
+ $dropdown-button-padding-med: $button-pip-med * 6 + rem-calc(3) !default;
35
+ $dropdown-button-pip-size-med: $button-pip-med - rem-calc(3) !default;
36
+ $dropdown-button-pip-opposite-med: $button-pip-med * 2.5 !default;
37
+ $dropdown-button-pip-top-med: -$button-pip-med / 2 + rem-calc(2) !default;
38
+
39
+ // We use these to style large dropdown buttons
40
+ $dropdown-button-padding-lrg: $button-pip-lrg * 5 + rem-calc(3) !default;
41
+ $dropdown-button-pip-size-lrg: $button-pip-lrg - rem-calc(6) !default;
42
+ $dropdown-button-pip-opposite-lrg: $button-pip-lrg * 2.5 !default;
43
+ $dropdown-button-pip-top-lrg: -$button-pip-lrg / 2 + rem-calc(3) !default;
44
+
45
+ // @mixins
46
+ //
47
+ // Dropdown Button Mixin
48
+ //
49
+ // We use this mixin to build off of the button mixin and add dropdown button styles
50
+ //
51
+ // $padding - Determines the size of button you're working with. Default: medium. Options [tiny, small, medium, large]
52
+ // $pip-color - Color of the little triangle that points to the dropdown. Default: #fff.
53
+ // $base-style - Add in base-styles. This can be set to false. Default:true
54
+
55
+ @mixin dropdown-button($padding:medium, $pip-color:#fff, $base-style:true) {
56
+
57
+ // We add in base styles, but they can be negated by setting to 'false'.
58
+ @if $base-style {
59
+ position: relative;
60
+
61
+ // This creates the base styles for the triangle pip
62
+ &:before {
63
+ position: absolute;
64
+ content: "";
65
+ width: 0;
66
+ height: 0;
67
+ display: block;
68
+ border-style: solid;
69
+ border-color: $dropdown-button-pip-color transparent transparent transparent;
70
+ top: 50%;
71
+ }
72
+ }
73
+
74
+ // If we're dealing with tiny buttons, use these styles
75
+ @if $padding == tiny {
76
+ padding-#{$opposite-direction}: $dropdown-button-padding-tny;
77
+ &:before {
78
+ border-width: $dropdown-button-pip-size-tny;
79
+ #{$opposite-direction}: $dropdown-button-pip-opposite-tny;
80
+ margin-top: $dropdown-button-pip-top-tny;
81
+ }
82
+ }
83
+
84
+ // If we're dealing with small buttons, use these styles
85
+ @if $padding == small {
86
+ padding-#{$opposite-direction}: $dropdown-button-padding-sml;
87
+ &:before {
88
+ border-width: $dropdown-button-pip-size-sml;
89
+ #{$opposite-direction}: $dropdown-button-pip-opposite-sml;
90
+ margin-top: $dropdown-button-pip-top-sml;
91
+ }
92
+ }
93
+
94
+ // If we're dealing with default (medium) buttons, use these styles
95
+ @if $padding == medium {
96
+ padding-#{$opposite-direction}: $dropdown-button-padding-med;
97
+ &:before {
98
+ border-width: $dropdown-button-pip-size-med;
99
+ #{$opposite-direction}: $dropdown-button-pip-opposite-med;
100
+ margin-top: $dropdown-button-pip-top-med;
101
+ }
102
+ }
103
+
104
+ // If we're dealing with large buttons, use these styles
105
+ @if $padding == large {
106
+ padding-#{$opposite-direction}: $dropdown-button-padding-lrg;
107
+ &:before {
108
+ border-width: $dropdown-button-pip-size-lrg;
109
+ #{$opposite-direction}: $dropdown-button-pip-opposite-lrg;
110
+ margin-top: $dropdown-button-pip-top-lrg;
111
+ }
112
+ }
113
+
114
+ // We can control the pip color. We didn't use logic in this case, just set it and forget it.
115
+ @if $pip-color {
116
+ &:before { border-color: $pip-color transparent transparent transparent; }
117
+ }
118
+ }
119
+
120
+ @include exports("dropdown-button") {
121
+ @if $include-html-button-classes {
122
+ .dropdown.button, button.dropdown { @include dropdown-button;
123
+ &.tiny { @include dropdown-button(tiny,$base-style:false); }
124
+ &.small { @include dropdown-button(small,$base-style:false); }
125
+ &.large { @include dropdown-button(large,$base-style:false); }
126
+ &.secondary:before { border-color: $dropdown-button-pip-color-alt transparent transparent transparent; }
127
+ }
128
+ }
129
+ }
@@ -0,0 +1,248 @@
1
+ // Foundation by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ @import "global";
6
+
7
+ //
8
+ // @variables
9
+ //
10
+ $include-html-dropdown-classes: $include-html-classes !default;
11
+
12
+ // We use these to controls height and width styles.
13
+ $f-dropdown-max-width: 200px !default;
14
+ $f-dropdown-height: auto !default;
15
+ $f-dropdown-max-height: none !default;
16
+
17
+ // Used for bottom position
18
+ $f-dropdown-margin-top: 2px !default;
19
+
20
+ // Used for right position
21
+ $f-dropdown-margin-left: $f-dropdown-margin-top !default;
22
+
23
+ // Used for left position
24
+ $f-dropdown-margin-right: $f-dropdown-margin-top !default;
25
+
26
+ // Used for top position
27
+ $f-dropdown-margin-bottom: $f-dropdown-margin-top !default;
28
+
29
+ // We use this to control the background color
30
+ $f-dropdown-bg: #fff !default;
31
+
32
+ // We use this to set the border styles for dropdowns.
33
+ $f-dropdown-border-style: solid !default;
34
+ $f-dropdown-border-width: 1px !default;
35
+ $f-dropdown-border-color: scale-color(#fff, $lightness: -20%) !default;
36
+
37
+ // We use these to style the triangle pip.
38
+ $f-dropdown-triangle-size: 6px !default;
39
+ $f-dropdown-triangle-color: #fff !default;
40
+ $f-dropdown-triangle-side-offset: 10px !default;
41
+
42
+ // We use these to control styles for the list elements.
43
+ $f-dropdown-list-style: none !default;
44
+ $f-dropdown-font-color: #555 !default;
45
+ $f-dropdown-font-size: rem-calc(14) !default;
46
+ $f-dropdown-list-padding: rem-calc(5, 10) !default;
47
+ $f-dropdown-line-height: rem-calc(18) !default;
48
+ $f-dropdown-list-hover-bg: #eeeeee !default;
49
+ $dropdown-mobile-default-float: 0 !default;
50
+
51
+ // We use this to control the styles for when the dropdown has custom content.
52
+ $f-dropdown-content-padding: rem-calc(20) !default;
53
+
54
+ //
55
+ // @mixins
56
+ //
57
+ //
58
+ // NOTE: Make default max-width change between list and content types. Can add more width with classes, maybe .small, .medium, .large, etc.;
59
+ // We use this to style the dropdown container element.
60
+ // $content-list - Sets list-style. Default: list. Options: [list, content]
61
+ // $triangle - Sets if dropdown has triangle. Default:true.
62
+ // $max-width - Default: $f-dropdown-max-width || 200px.
63
+ @mixin dropdown-container($content:list, $triangle:true, $max-width:$f-dropdown-max-width) {
64
+ position: absolute;
65
+ left: -9999px;
66
+ list-style: $f-dropdown-list-style;
67
+ margin-#{$default-float}: 0;
68
+
69
+ > *:first-child { margin-top: 0; }
70
+ > *:last-child { margin-bottom: 0; }
71
+
72
+ @if $content == list {
73
+ width: 100%;
74
+ max-height: $f-dropdown-max-height;
75
+ height: $f-dropdown-height;
76
+ background: $f-dropdown-bg;
77
+ border: $f-dropdown-border-style $f-dropdown-border-width $f-dropdown-border-color;
78
+ font-size: $f-dropdown-font-size;
79
+ z-index: 99;
80
+ }
81
+ @else if $content == content {
82
+ padding: $f-dropdown-content-padding;
83
+ width: 100%;
84
+ height: $f-dropdown-height;
85
+ max-height: $f-dropdown-max-height;
86
+ background: $f-dropdown-bg;
87
+ border: $f-dropdown-border-style $f-dropdown-border-width $f-dropdown-border-color;
88
+ font-size: $f-dropdown-font-size;
89
+ z-index: 99;
90
+ }
91
+
92
+ @if $triangle == bottom {
93
+ margin-top: $f-dropdown-margin-top;
94
+
95
+ &:before {
96
+ @include css-triangle($f-dropdown-triangle-size, $f-dropdown-triangle-color, bottom);
97
+ position: absolute;
98
+ top: -($f-dropdown-triangle-size * 2);
99
+ #{$default-float}: $f-dropdown-triangle-side-offset;
100
+ z-index: 99;
101
+ }
102
+ &:after {
103
+ @include css-triangle($f-dropdown-triangle-size + 1, $f-dropdown-border-color, bottom);
104
+ position: absolute;
105
+ top: -(($f-dropdown-triangle-size + 1) * 2);
106
+ #{$default-float}: $f-dropdown-triangle-side-offset - 1;
107
+ z-index: 98;
108
+ }
109
+
110
+ &.right:before {
111
+ left: auto;
112
+ right: $f-dropdown-triangle-side-offset;
113
+ }
114
+ &.right:after {
115
+ left: auto;
116
+ right: $f-dropdown-triangle-side-offset - 1;
117
+ }
118
+ }
119
+
120
+ @if $triangle == left {
121
+ margin-top: 0;
122
+ margin-left: $f-dropdown-margin-right;
123
+
124
+ &:before {
125
+ @include css-triangle($f-dropdown-triangle-size, $f-dropdown-triangle-color, right);
126
+ position: absolute;
127
+ top: $f-dropdown-triangle-side-offset;
128
+ #{$default-float}: -($f-dropdown-triangle-size * 2);
129
+ z-index: 99;
130
+ }
131
+ &:after {
132
+ @include css-triangle($f-dropdown-triangle-size + 1, $f-dropdown-border-color, right);
133
+ position: absolute;
134
+ top: $f-dropdown-triangle-side-offset - 1;
135
+ #{$default-float}: -($f-dropdown-triangle-size * 2) - 2;
136
+ z-index: 98;
137
+ }
138
+
139
+ }
140
+
141
+ @if $triangle == right {
142
+ margin-top: 0;
143
+ margin-left: -$f-dropdown-margin-right;
144
+
145
+ &:before {
146
+ @include css-triangle($f-dropdown-triangle-size, $f-dropdown-triangle-color, left);
147
+ position: absolute;
148
+ top: $f-dropdown-triangle-side-offset;
149
+ #{$opposite-direction}: -($f-dropdown-triangle-size * 2);
150
+ left: auto;
151
+ z-index: 99;
152
+ }
153
+ &:after {
154
+ @include css-triangle($f-dropdown-triangle-size + 1, $f-dropdown-border-color, left);
155
+ position: absolute;
156
+ top: $f-dropdown-triangle-side-offset - 1;
157
+ #{$opposite-direction}: -($f-dropdown-triangle-size * 2) - 2;
158
+ left: auto;
159
+ z-index: 98;
160
+ }
161
+
162
+ }
163
+
164
+ @if $triangle == top {
165
+ margin-top: -$f-dropdown-margin-bottom;
166
+ margin-left: 0;
167
+
168
+ &:before {
169
+ @include css-triangle($f-dropdown-triangle-size, $f-dropdown-triangle-color, top);
170
+ position: absolute;
171
+ top: auto;
172
+ bottom: -($f-dropdown-triangle-size * 2);
173
+ #{$default-float}: $f-dropdown-triangle-side-offset;
174
+ right: auto;
175
+ z-index: 99;
176
+ }
177
+ &:after {
178
+ @include css-triangle($f-dropdown-triangle-size + 1, $f-dropdown-border-color, top);
179
+ position: absolute;
180
+ top: auto;
181
+ bottom: -($f-dropdown-triangle-size * 2) - 2;
182
+ #{$default-float}: $f-dropdown-triangle-side-offset - 1;
183
+ right: auto;
184
+ z-index: 98;
185
+ }
186
+
187
+ }
188
+
189
+ @if $max-width { max-width: $max-width; }
190
+ @else { max-width: $f-dropdown-max-width; }
191
+
192
+ }
193
+
194
+ // @MIXIN
195
+ //
196
+ // We use this to style the list elements or content inside the dropdown.
197
+
198
+ @mixin dropdown-style {
199
+ font-size: $f-dropdown-font-size;
200
+ cursor: $cursor-pointer-value;
201
+
202
+ line-height: $f-dropdown-line-height;
203
+ margin: 0;
204
+
205
+ &:hover,
206
+ &:focus { background: $f-dropdown-list-hover-bg; }
207
+
208
+ a {
209
+ display: block;
210
+ padding: $f-dropdown-list-padding;
211
+ color: $f-dropdown-font-color;
212
+ }
213
+ }
214
+
215
+ @include exports("dropdown") {
216
+ @if $include-html-dropdown-classes {
217
+
218
+ /* Foundation Dropdowns */
219
+ .f-dropdown {
220
+ @include dropdown-container(list, bottom);
221
+
222
+ &.drop-right {
223
+ @include dropdown-container(list, left);
224
+ }
225
+
226
+ &.drop-left {
227
+ @include dropdown-container(list, right);
228
+ }
229
+
230
+ &.drop-top {
231
+ @include dropdown-container(list, top);
232
+ }
233
+ // max-width: none;
234
+
235
+ li { @include dropdown-style; }
236
+
237
+ // You can also put custom content in these dropdowns
238
+ &.content { @include dropdown-container(content, $triangle:false); }
239
+
240
+ // Sizes
241
+ &.tiny { max-width: 200px; }
242
+ &.small { max-width: 300px; }
243
+ &.medium { max-width: 500px; }
244
+ &.large { max-width: 800px; }
245
+ }
246
+
247
+ }
248
+ }
@@ -0,0 +1,51 @@
1
+ // Foundation by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ @import "global";
6
+
7
+ //
8
+ // @variables
9
+ //
10
+ $include-html-media-classes: $include-html-classes !default;
11
+
12
+ // We use these to control video container padding and margins
13
+ $flex-video-padding-top: rem-calc(25) !default;
14
+ $flex-video-padding-bottom: 67.5% !default;
15
+ $flex-video-margin-bottom: rem-calc(16) !default;
16
+
17
+ // We use this to control widescreen bottom padding
18
+ $flex-video-widescreen-padding-bottom: 56.34% !default;
19
+
20
+ //
21
+ // @mixins
22
+ //
23
+
24
+ @mixin flex-video-container {
25
+ position: relative;
26
+ padding-top: $flex-video-padding-top;
27
+ padding-bottom: $flex-video-padding-bottom;
28
+ height: 0;
29
+ margin-bottom: $flex-video-margin-bottom;
30
+ overflow: hidden;
31
+
32
+ &.widescreen { padding-bottom: $flex-video-widescreen-padding-bottom; }
33
+ &.vimeo { padding-top: 0; }
34
+
35
+ iframe,
36
+ object,
37
+ embed,
38
+ video {
39
+ position: absolute;
40
+ top: 0;
41
+ #{$default-float}: 0;
42
+ width: 100%;
43
+ height: 100%;
44
+ }
45
+ }
46
+
47
+ @include exports("flex-video") {
48
+ @if $include-html-media-classes {
49
+ .flex-video { @include flex-video-container; }
50
+ }
51
+ }
@@ -0,0 +1,496 @@
1
+ // Foundation by ZURB
2
+ // foundation.zurb.com
3
+ // Licensed under MIT Open Source
4
+
5
+ @import "global";
6
+ @import "buttons";
7
+
8
+ //
9
+ // @variables
10
+ //
11
+ $include-html-form-classes: $include-html-classes !default;
12
+
13
+ // We use this to set the base for lots of form spacing and positioning styles
14
+ $form-spacing: rem-calc(16) !default;
15
+
16
+ // We use these to style the labels in different ways
17
+ $form-label-pointer: pointer !default;
18
+ $form-label-font-size: rem-calc(14) !default;
19
+ $form-label-font-weight: normal !default;
20
+ $form-label-line-height: 1.5 !default;
21
+ $form-label-font-color: scale-color(#000, $lightness: 30%) !default;
22
+ $form-label-small-transform: capitalize !default;
23
+ $form-label-bottom-margin: 0 !default;
24
+ $input-font-family: inherit !default;
25
+ $input-font-color: rgba(0,0,0,0.75) !default;
26
+ $input-font-size: rem-calc(14) !default;
27
+ $input-bg-color: #fff !default;
28
+ $input-focus-bg-color: scale-color(#fff, $lightness: -2%) !default;
29
+ $input-border-color: scale-color(#fff, $lightness: -20%) !default;
30
+ $input-focus-border-color: scale-color(#fff, $lightness: -40%) !default;
31
+ $input-border-style: solid !default;
32
+ $input-border-width: 1px !default;
33
+ $input-border-radius: $global-radius !default;
34
+ $input-disabled-bg: #ddd !default;
35
+ $input-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1) !default;
36
+ $input-include-glowing-effect: true !default;
37
+
38
+ // We use these to style the fieldset border and spacing.
39
+ $fieldset-border-style: solid !default;
40
+ $fieldset-border-width: 1px !default;
41
+ $fieldset-border-color: #ddd !default;
42
+ $fieldset-padding: rem-calc(20) !default;
43
+ $fieldset-margin: rem-calc(18 0) !default;
44
+
45
+ // We use these to style the legends when you use them
46
+ $legend-bg: #fff !default;
47
+ $legend-font-weight: bold !default;
48
+ $legend-padding: rem-calc(0 3) !default;
49
+
50
+ // We use these to style the prefix and postfix input elements
51
+ $input-prefix-bg: scale-color(#fff, $lightness: -5%) !default;
52
+ $input-prefix-border-color: scale-color(#fff, $lightness: -20%) !default;
53
+ $input-prefix-border-size: 1px !default;
54
+ $input-prefix-border-type: solid !default;
55
+ $input-prefix-overflow: hidden !default;
56
+ $input-prefix-font-color: #333 !default;
57
+ $input-prefix-font-color-alt: #fff !default;
58
+
59
+ // We use these to style the error states for inputs and labels
60
+ $input-error-message-padding: rem-calc(6 9 9) !default;
61
+ $input-error-message-top: -1px !default;
62
+ $input-error-message-font-size: rem-calc(12) !default;
63
+ $input-error-message-font-weight: normal !default;
64
+ $input-error-message-font-style: italic !default;
65
+ $input-error-message-font-color: #fff !default;
66
+ $input-error-message-font-color-alt: #333 !default;
67
+
68
+ // We use this to style the glowing effect of inputs when focused
69
+ $glowing-effect-fade-time: 0.45s !default;
70
+ $glowing-effect-color: $input-focus-border-color !default;
71
+
72
+ // Select variables
73
+ $select-bg-color: #fafafa !default;
74
+ $select-hover-bg-color: scale-color($select-bg-color, $lightness: -3%) !default;
75
+
76
+ //
77
+ // @MIXINS
78
+ //
79
+
80
+ // We use this mixin to give us form styles for rows inside of forms
81
+ @mixin form-row-base {
82
+ .row { margin: 0 ((-$form-spacing) / 2);
83
+
84
+ .column,
85
+ .columns { padding: 0 $form-spacing / 2; }
86
+
87
+ // Use this to collapse the margins of a form row
88
+ &.collapse { margin: 0;
89
+
90
+ .column,
91
+ .columns { padding: 0; }
92
+ input {
93
+ @include side-radius($opposite-direction, 0);
94
+ }
95
+
96
+ }
97
+ }
98
+ input.column,
99
+ input.columns,
100
+ textarea.column,
101
+ textarea.columns { padding-#{$default-float}: $form-spacing / 2; }
102
+ }
103
+
104
+ // @MIXIN
105
+ //
106
+ // We use this mixin to give all basic form elements their style
107
+ @mixin form-element {
108
+ background-color: $input-bg-color;
109
+ font-family: $input-font-family;
110
+ border: $input-border-width $input-border-style $input-border-color;
111
+ box-shadow: $input-box-shadow;
112
+ color: $input-font-color;
113
+ display: block;
114
+ font-size: $input-font-size;
115
+ margin: 0 0 $form-spacing 0;
116
+ padding: $form-spacing / 2;
117
+ height: ($input-font-size + ($form-spacing * 1.5) - rem-calc(1));
118
+ width: 100%;
119
+ @include box-sizing(border-box);
120
+ @if $input-include-glowing-effect {
121
+ @include block-glowing-effect(focus, $glowing-effect-fade-time, $glowing-effect-color);
122
+ }
123
+ // Basic focus styles
124
+ &:focus {
125
+ background: $input-focus-bg-color;
126
+ border-color: $input-focus-border-color;
127
+ outline: none;
128
+ }
129
+
130
+ // Disabled background input background color
131
+ &[disabled], fieldset[disabled] & { background-color: $input-disabled-bg; }
132
+ }
133
+
134
+ // @MIXIN
135
+ //
136
+ // We use this mixin to create form labels
137
+ //
138
+ // $alignment - Alignment options. Default: false. Options: [right, inline, false]
139
+ // $base-style - Control whether or not the base styles come through. Default: true.
140
+ @mixin form-label($alignment:false, $base-style:true) {
141
+
142
+ // Control whether or not the base styles come through.
143
+ @if $base-style {
144
+ font-size: $form-label-font-size;
145
+ color: $form-label-font-color;
146
+ cursor: $form-label-pointer;
147
+ display: block;
148
+ font-weight: $form-label-font-weight;
149
+ line-height: $form-label-line-height;
150
+ margin-bottom: $form-label-bottom-margin;
151
+ }
152
+
153
+ // Alignment options
154
+ @if $alignment == right {
155
+ float: none;
156
+ text-align: right;
157
+ }
158
+ @else if $alignment == inline {
159
+ margin: 0 0 $form-spacing 0;
160
+ padding: $form-spacing / 2 + rem-calc($input-border-width) 0;
161
+ }
162
+ }
163
+
164
+ // We use this mixin to create postfix/prefix form Labels
165
+ @mixin prefix-postfix-base {
166
+ display: block;
167
+ position: relative;
168
+ z-index: 2;
169
+ text-align: center;
170
+ width: 100%;
171
+ padding-top: 0;
172
+ padding-bottom: 0;
173
+ border-style: $input-prefix-border-type;
174
+ border-width: $input-prefix-border-size;
175
+ overflow: $input-prefix-overflow;
176
+ font-size: $form-label-font-size;
177
+ height: ($input-font-size + ($form-spacing * 1.5) - rem-calc(1));
178
+ line-height: ($input-font-size + ($form-spacing * 1.5) - rem-calc(1));
179
+ }
180
+
181
+ // @MIXIN
182
+ //
183
+ // We use this mixin to create prefix label styles
184
+ // $bg - Default:$input-prefix-bg || scale-color(#fff, $lightness: -5%) !default;
185
+ // $is-button - Toggle position settings if prefix is a button. Default:false
186
+ //
187
+ @mixin prefix($bg:$input-prefix-bg, $border:$input-prefix-border-color, $is-button:false) {
188
+
189
+ @if $bg {
190
+ $bg-lightness: lightness($bg);
191
+ background: $bg;
192
+ border-#{$opposite-direction}: none;
193
+
194
+ // Control the font color based on background brightness
195
+ @if $bg-lightness > 70% or $bg == yellow { color: $input-prefix-font-color; }
196
+ @else { color: $input-prefix-font-color-alt; }
197
+ }
198
+
199
+ @if $border {
200
+ border-color: $border;
201
+ }
202
+
203
+ @if $is-button {
204
+ padding-#{$default-float}: 0;
205
+ padding-#{$opposite-direction}: 0;
206
+ padding-top: 0;
207
+ padding-bottom: 0;
208
+ text-align: center;
209
+ line-height: rem-calc(34);
210
+ border: none;
211
+ }
212
+
213
+ }
214
+
215
+ // @MIXIN
216
+ //
217
+ // We use this mixin to create postfix label styles
218
+ // $bg - Default:$input-prefix-bg || scale-color(#fff, $lightness: -5%) !default;
219
+ // $is-button - Toggle position settings if prefix is a button. Default: false
220
+ @mixin postfix($bg:$input-prefix-bg, $border:$input-prefix-border-color, $is-button:false) {
221
+
222
+ @if $bg {
223
+ $bg-lightness: lightness($bg);
224
+ background: $bg;
225
+ border-#{$default-float}: none;
226
+
227
+ // Control the font color based on background brightness
228
+ @if $bg-lightness > 70% or $bg == yellow { color: $input-prefix-font-color; }
229
+ @else { color: $input-prefix-font-color-alt; }
230
+ }
231
+
232
+ @if $border {
233
+ border-color: $border;
234
+ }
235
+
236
+ @if $is-button {
237
+ padding-#{$default-float}: 0;
238
+ padding-#{$opposite-direction}: 0;
239
+ padding-top: 0;
240
+ padding-bottom: 0;
241
+ text-align: center;
242
+ line-height: rem-calc(34);
243
+ border: none;
244
+ }
245
+
246
+ }
247
+
248
+ // We use this mixin to style fieldsets
249
+ @mixin fieldset {
250
+ border: $fieldset-border-width $fieldset-border-style $fieldset-border-color;
251
+ padding: $fieldset-padding;
252
+ margin: $fieldset-margin;
253
+
254
+ // and legend styles
255
+ legend {
256
+ font-weight: $legend-font-weight;
257
+ background: $legend-bg;
258
+ padding: $legend-padding;
259
+ margin: 0;
260
+ margin-#{$default-float}: rem-calc(-3);
261
+ }
262
+ }
263
+
264
+ // @MIXIN
265
+ //
266
+ // We use this mixin to control border and background color of error inputs
267
+ // $color - Default: $alert-color (found in settings file)
268
+ @mixin form-error-color($color:$alert-color) {
269
+ border-color: $color;
270
+ background-color: rgba($color, 0.1);
271
+
272
+ // Go back to normal on focus
273
+ &:focus {
274
+ background: $input-focus-bg-color;
275
+ border-color: $input-focus-border-color;
276
+ }
277
+ }
278
+
279
+ // @MIXIN
280
+ //
281
+ // We use this simple mixin to style labels for error inputs
282
+ // $color - Default:$alert-color. Found in settings file
283
+ @mixin form-label-error-color($color:$alert-color) { color: $color; }
284
+
285
+ // @MIXIN
286
+ //
287
+ // We use this mixin to create error message styles
288
+ // $bg - Default: $alert-color (Found in settings file)
289
+ @mixin form-error-message($bg:$alert-color) {
290
+ display: block;
291
+ padding: $input-error-message-padding;
292
+ margin-top: $input-error-message-top;
293
+ margin-bottom: $form-spacing;
294
+ font-size: $input-error-message-font-size;
295
+ font-weight: $input-error-message-font-weight;
296
+ font-style: $input-error-message-font-style;
297
+
298
+ // We can control the text color based on the brightness of the background.
299
+ $bg-lightness: lightness($bg);
300
+ background: $bg;
301
+ @if $bg-lightness < 70% or $bg == yellow { color: $input-error-message-font-color; }
302
+ @else { color: $input-error-message-font-color-alt; }
303
+ }
304
+
305
+ // We use this mixin to style select elements
306
+ @mixin form-select {
307
+ -webkit-appearance: none !important;
308
+ background-color: $select-bg-color;
309
+ background-image: url('data:image/svg+xml;base64, PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iM3B4IiB2aWV3Qm94PSIwIDAgNiAzIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA2IDMiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwb2x5Z29uIHBvaW50cz0iNS45OTIsMCAyLjk5MiwzIC0wLjAwOCwwICIvPjwvc3ZnPg==');
310
+ background-repeat: no-repeat;
311
+ background-position: if($text-direction == 'rtl', 3%, 97%) center;
312
+ border: $input-border-width $input-border-style $input-border-color;
313
+ padding: $form-spacing / 2;
314
+ font-size: $input-font-size;
315
+ @include radius(0);
316
+ &.radius { @include radius($global-radius); }
317
+ &:hover {
318
+ background-color: $select-hover-bg-color;
319
+ border-color: $input-focus-border-color;
320
+ }
321
+ }
322
+
323
+ @include exports("form") {
324
+ @if $include-html-form-classes {
325
+ /* Standard Forms */
326
+ form { margin: 0 0 $form-spacing; }
327
+
328
+ /* Using forms within rows, we need to set some defaults */
329
+ form .row { @include form-row-base; }
330
+
331
+ /* Label Styles */
332
+ label { @include form-label;
333
+ &.right { @include form-label(right,false); }
334
+ &.inline { @include form-label(inline,false); }
335
+ /* Styles for required inputs */
336
+ small {
337
+ text-transform: $form-label-small-transform;
338
+ color: scale-color($form-label-font-color, $lightness: 15%);
339
+ }
340
+ }
341
+
342
+ select::-ms-expand {
343
+ display:none;
344
+ }
345
+
346
+ @-moz-document url-prefix() {
347
+ select { background: $select-bg-color; }
348
+ select:hover { background: $select-hover-bg-color }
349
+ }
350
+ /* Attach elements to the beginning or end of an input */
351
+ .prefix,
352
+ .postfix { @include prefix-postfix-base; }
353
+
354
+ /* Adjust padding, alignment and radius if pre/post element is a button */
355
+ .postfix.button { @include button-size(false,false); @include postfix(false, false, true); }
356
+ .prefix.button { @include button-size(false,false); @include prefix(false, false, true); }
357
+
358
+ .prefix.button.radius { @include radius(0); @include side-radius($default-float, $button-radius); }
359
+ .postfix.button.radius { @include radius(0); @include side-radius($opposite-direction, $button-radius); }
360
+ .prefix.button.round { @include radius(0); @include side-radius($default-float, $button-round); }
361
+ .postfix.button.round { @include radius(0); @include side-radius($opposite-direction, $button-round); }
362
+
363
+ /* Separate prefix and postfix styles when on span or label so buttons keep their own */
364
+ span.prefix,label.prefix { @include prefix();
365
+ &.radius { @include radius(0); @include side-radius($default-float, $global-radius); }
366
+ }
367
+ span.postfix,label.postfix { @include postfix();
368
+ &.radius { @include radius(0); @include side-radius($opposite-direction, $global-radius); }
369
+ }
370
+
371
+ /* We use this to get basic styling on all basic form elements */
372
+ input[type="text"],
373
+ input[type="password"],
374
+ input[type="date"],
375
+ input[type="datetime"],
376
+ input[type="datetime-local"],
377
+ input[type="month"],
378
+ input[type="week"],
379
+ input[type="email"],
380
+ input[type="number"],
381
+ input[type="search"],
382
+ input[type="tel"],
383
+ input[type="time"],
384
+ input[type="url"],
385
+ textarea {
386
+ -webkit-appearance: none;
387
+ @include form-element;
388
+ @if $input-include-glowing-effect == false {
389
+ @include single-transition(all, 0.15s, linear);
390
+ }
391
+ &.radius {
392
+ @include radius($input-border-radius);
393
+ }
394
+ }
395
+
396
+ input[type="submit"] {
397
+ -webkit-appearance: none;
398
+ }
399
+
400
+ /* Respect enforced amount of rows for textarea */
401
+ textarea[rows] {
402
+ height: auto;
403
+ }
404
+
405
+ /* Add height value for select elements to match text input height */
406
+ select {
407
+ @include form-select;
408
+ height: ($input-font-size + ($form-spacing * 1.5) - rem-calc(1));
409
+ }
410
+
411
+ /* Adjust margin for form elements below */
412
+ input[type="file"],
413
+ input[type="checkbox"],
414
+ input[type="radio"],
415
+ select {
416
+ margin: 0 0 $form-spacing 0;
417
+ }
418
+
419
+ input[type="checkbox"] + label,
420
+ input[type="radio"] + label {
421
+ display: inline-block;
422
+ margin-#{$default-float}: $form-spacing * .5;
423
+ margin-#{$opposite-direction}: $form-spacing;
424
+ margin-bottom: 0;
425
+ vertical-align: baseline;
426
+ }
427
+
428
+ /* Normalize file input width */
429
+ input[type="file"] {
430
+ width:100%;
431
+ }
432
+
433
+ /* We add basic fieldset styling */
434
+ fieldset {
435
+ @include fieldset;
436
+ }
437
+
438
+ /* Error Handling */
439
+
440
+ #{data('abide')} {
441
+ .error small.error, span.error, small.error {
442
+ @include form-error-message;
443
+ }
444
+ span.error, small.error { display: none; }
445
+ }
446
+
447
+ span.error, small.error {
448
+ @include form-error-message;
449
+ }
450
+
451
+ .error {
452
+ input,
453
+ textarea,
454
+ select {
455
+ margin-bottom: 0;
456
+ }
457
+
458
+ input[type="checkbox"],
459
+ input[type="radio"] {
460
+ margin-bottom: $form-spacing
461
+ }
462
+
463
+ label,
464
+ label.error {
465
+ @include form-label-error-color;
466
+ }
467
+
468
+ small.error {
469
+ @include form-error-message;
470
+ }
471
+
472
+ > label {
473
+ > small {
474
+ color: scale-color($form-label-font-color, $lightness: 15%);
475
+ background: transparent;
476
+ padding: 0;
477
+ text-transform: $form-label-small-transform;
478
+ font-style: normal;
479
+ font-size: 60%;
480
+ margin: 0;
481
+ display: inline;
482
+ }
483
+ }
484
+
485
+ span.error-message {
486
+ display: block;
487
+ }
488
+ }
489
+
490
+ input.error,
491
+ textarea.error {
492
+ margin-bottom: 0;
493
+ }
494
+ label.error { @include form-label-error-color; }
495
+ }
496
+ }