zurb-foundation 3.2.5 → 4.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -2
- data/CHANGELOG.md +1 -26
- data/CONTRIBUTING.md +18 -0
- data/Gemfile.lock +19 -0
- data/Gruntfile.js +27 -0
- data/README.md +5 -6
- data/{Capfile → docs/Capfile} +0 -1
- data/docs/Gemfile +8 -0
- data/docs/Gemfile.lock +43 -0
- data/docs/Procfile +2 -0
- data/docs/README.md +1 -0
- data/docs/_sidebar-components.html.erb +109 -0
- data/docs/_sidebar.html.erb +109 -0
- data/docs/_zurb-jobs.html.erb +5 -0
- data/docs/changelog.html.erb +185 -0
- data/docs/compile.rb +43 -0
- data/docs/components/alert-boxes.html.erb +202 -0
- data/docs/components/block-grid.html.erb +118 -0
- data/docs/components/breadcrumbs.html.erb +146 -0
- data/docs/components/button-groups.html.erb +174 -0
- data/docs/components/buttons.html.erb +220 -0
- data/docs/components/clearing.html.erb +152 -0
- data/docs/components/custom-forms.html.erb +306 -0
- data/docs/components/dropdown-buttons.html.erb +233 -0
- data/docs/components/dropdown.html.erb +186 -0
- data/docs/components/flex-video.html.erb +93 -0
- data/docs/components/forms.html.erb +468 -0
- data/docs/components/grid.html.erb +355 -0
- data/docs/components/inline-lists.html.erb +89 -0
- data/docs/components/joyride.html.erb +178 -0
- data/docs/components/keystrokes.html.erb +74 -0
- data/docs/components/labels.html.erb +98 -0
- data/docs/components/magellan.html.erb +84 -0
- data/docs/components/orbit.html.erb +262 -0
- data/docs/components/pagination.html.erb +181 -0
- data/docs/components/panels.html.erb +121 -0
- data/docs/components/pricing-tables.html.erb +154 -0
- data/docs/components/progress-bars.html.erb +120 -0
- data/docs/components/reveal.html.erb +147 -0
- data/docs/components/section.html.erb +156 -0
- data/docs/components/side-nav.html.erb +122 -0
- data/docs/components/split-buttons.html.erb +218 -0
- data/docs/components/sub-nav.html.erb +120 -0
- data/docs/components/switch.html.erb +288 -0
- data/docs/components/tables.html.erb +123 -0
- data/docs/components/thumbnails.html.erb +87 -0
- data/docs/components/tooltips.html.erb +73 -0
- data/docs/components/top-bar.html.erb +219 -0
- data/docs/components/type.html.erb +359 -0
- data/docs/components/visibility.html.erb +102 -0
- data/docs/config.ru +12 -0
- data/docs/config/deploy.rb +33 -0
- data/docs/controller.rb +43 -0
- data/docs/css/_coderay.scss +116 -0
- data/docs/css/_settings.scss +1 -0
- data/docs/css/docs.scss +174 -0
- data/docs/css/normalize.scss +396 -0
- data/docs/css/qunit-composite.css +13 -0
- data/docs/css/qunit.css +235 -0
- data/docs/faq.html.erb +61 -0
- data/docs/img/demos/demo1-th.png +0 -0
- data/docs/img/demos/demo1.png +0 -0
- data/docs/img/demos/demo2-th.png +0 -0
- data/docs/img/demos/demo2.png +0 -0
- data/docs/img/demos/demo3-th.png +0 -0
- data/docs/img/demos/demo3.png +0 -0
- data/docs/img/demos/demo4-th.png +0 -0
- data/docs/img/demos/demo4.png +0 -0
- data/docs/img/demos/demo5-th.png +0 -0
- data/docs/img/demos/demo5.png +0 -0
- data/docs/index.html.erb +299 -0
- data/docs/javascript.html.erb +133 -0
- data/docs/js/docs.js +3 -0
- data/docs/js/qunit-composite.js +105 -0
- data/docs/js/qunit.js +1977 -0
- data/docs/js/tests/tabs/simple_tabs.html +57 -0
- data/docs/js/tests/tabs/simple_tabs.js +54 -0
- data/docs/js/tests/tooltips/tooltips.html +39 -0
- data/docs/js/tests/tooltips/tooltips.js +11 -0
- data/docs/layout.html.erb +99 -0
- data/docs/rails.html.erb +66 -0
- data/docs/sass.html.erb +299 -0
- data/docs/support.html.erb +134 -0
- data/foundation.gemspec +2 -4
- data/index.html +3 -23
- data/js/foundation/foundation.alerts.js +50 -0
- data/js/foundation/foundation.clearing.js +478 -0
- data/{vendor/assets/javascripts/foundation/jquery.cookie.js → js/foundation/foundation.cookie.js} +3 -1
- data/js/foundation/foundation.dropdown.js +122 -0
- data/js/foundation/foundation.forms.js +403 -0
- data/js/foundation/foundation.joyride.js +613 -0
- data/js/foundation/foundation.js +331 -0
- data/js/foundation/foundation.magellan.js +130 -0
- data/js/foundation/foundation.orbit.js +355 -0
- data/{vendor/assets/javascripts/foundation/jquery.placeholder.js → js/foundation/foundation.placeholder.js} +4 -2
- data/js/foundation/foundation.reveal.js +264 -0
- data/js/foundation/foundation.section.js +180 -0
- data/js/foundation/foundation.tooltips.js +195 -0
- data/js/foundation/foundation.topbar.js +187 -0
- data/js/foundation/index.js +16 -0
- data/{vendor/assets/javascripts/foundation/modernizr.foundation.js → js/vendor/custom.modernizr.js} +0 -0
- data/js/vendor/jquery.js +9597 -0
- data/js/vendor/zepto.js +1782 -0
- data/lib/foundation/engine.rb +8 -1
- data/lib/foundation/generators/install_generator.rb +24 -1
- data/lib/foundation/generators/templates/application.html.erb +20 -6
- data/lib/foundation/generators/templates/application.html.haml +2 -6
- data/lib/foundation/generators/templates/application.html.slim +2 -5
- data/lib/foundation/version.rb +1 -1
- data/lib/zurb-foundation.rb +7 -9
- data/package.json +9 -0
- data/scss/foundation.scss +42 -15
- data/scss/foundation/_foundation-global.scss +226 -0
- data/scss/foundation/components/_alert-boxes.scss +106 -0
- data/scss/foundation/components/_block-grid.scss +63 -0
- data/scss/foundation/components/_breadcrumbs.scss +117 -0
- data/scss/foundation/components/_button-groups.scss +59 -0
- data/scss/foundation/components/_buttons.scss +217 -0
- data/scss/foundation/components/_clearing.scss +209 -0
- data/scss/foundation/components/_custom-forms.scss +232 -0
- data/scss/foundation/components/_dropdown-buttons.scss +114 -0
- data/scss/foundation/components/_dropdown.scss +137 -0
- data/scss/foundation/components/_flex-video.scss +45 -0
- data/scss/foundation/components/_forms.scss +309 -0
- data/scss/foundation/components/_grid.scss +149 -71
- data/scss/foundation/components/_inline-lists.scss +47 -0
- data/scss/foundation/components/_joyride.scss +193 -0
- data/scss/foundation/components/_keystrokes.scss +56 -0
- data/scss/foundation/components/_labels.scss +81 -0
- data/scss/foundation/components/_magellan.scss +15 -0
- data/scss/foundation/components/_orbit.scss +193 -0
- data/scss/foundation/components/_pagination.scss +99 -0
- data/scss/foundation/components/_panels.scss +76 -0
- data/scss/foundation/components/_pricing-tables.scss +130 -0
- data/scss/foundation/components/_progress-bars.scss +68 -0
- data/scss/foundation/components/_reveal.scss +131 -0
- data/scss/foundation/components/_section.scss +194 -0
- data/scss/foundation/components/_side-nav.scss +68 -0
- data/scss/foundation/components/_split-buttons.scss +159 -0
- data/scss/foundation/components/_sub-nav.scss +67 -0
- data/scss/foundation/components/_switch.scss +242 -0
- data/scss/foundation/components/_tables.scss +80 -0
- data/scss/foundation/components/_thumbs.scss +45 -0
- data/scss/foundation/components/_tooltips.scss +113 -0
- data/scss/foundation/components/_top-bar.scss +443 -0
- data/scss/foundation/components/_type.scss +411 -0
- data/scss/foundation/components/_visibility.scss +117 -0
- data/scss/normalize.scss +396 -0
- data/templates/project/config.rb +26 -0
- data/templates/project/index.html +28 -43
- data/templates/project/manifest.rb +21 -28
- data/templates/project/scss/_settings.scss +4 -243
- data/templates/project/scss/app.scss +37 -44
- data/templates/project/scss/normalize.scss +396 -0
- data/test/stylesheets/styles.css +955 -0
- metadata +144 -153
- data/config/deploy.rb +0 -42
- data/lib/foundation/generators/layout_generator.rb +0 -28
- data/scss/foundation/_settings.scss +0 -281
- data/scss/foundation/common/_base.scss +0 -4
- data/scss/foundation/common/_forms.scss +0 -117
- data/scss/foundation/common/_globals.scss +0 -35
- data/scss/foundation/common/_ratios.scss +0 -19
- data/scss/foundation/common/_typography.scss +0 -104
- data/scss/foundation/components/modules/_all.scss +0 -10
- data/scss/foundation/components/modules/_buttons.scss +0 -178
- data/scss/foundation/components/modules/_clearing.scss +0 -61
- data/scss/foundation/components/modules/_joyride.scss +0 -33
- data/scss/foundation/components/modules/_mqueries.scss +0 -458
- data/scss/foundation/components/modules/_navbar.scss +0 -74
- data/scss/foundation/components/modules/_offcanvas.scss +0 -55
- data/scss/foundation/components/modules/_orbit.scss +0 -90
- data/scss/foundation/components/modules/_reveal.scss +0 -34
- data/scss/foundation/components/modules/_tabs.scss +0 -67
- data/scss/foundation/components/modules/_topbar.scss +0 -167
- data/scss/foundation/components/modules/_ui.scss +0 -292
- data/scss/foundation/functions/_all.scss +0 -2
- data/scss/foundation/functions/_convert-number-to-word.scss +0 -10
- data/scss/foundation/functions/_grid-calc.scss +0 -5
- data/scss/foundation/functions/modular-scale.scss +0 -3
- data/scss/foundation/mixins/_all.scss +0 -5
- data/scss/foundation/mixins/_clearfix.scss +0 -13
- data/scss/foundation/mixins/_css-triangle.scss +0 -22
- data/scss/foundation/mixins/_font-size.scss +0 -13
- data/scss/foundation/mixins/_respond-to.scss +0 -11
- data/scss/foundation/mixins/_semantic-grid.scss +0 -66
- data/test/buttons.html +0 -189
- data/test/clearing.html +0 -85
- data/test/config.rb +0 -11
- data/test/elements.html +0 -490
- data/test/forms.html +0 -371
- data/test/grid.html +0 -543
- data/test/images/orbit-demo/demo1.jpeg +0 -0
- data/test/images/orbit-demo/demo2.jpeg +0 -0
- data/test/images/orbit-demo/demo3.jpeg +0 -0
- data/test/images/orbit-demo/slider-background.jpeg +0 -0
- data/test/index.html +0 -83
- data/test/joyride.html +0 -127
- data/test/magellan.html +0 -112
- data/test/navigation.html +0 -269
- data/test/orbit.html +0 -112
- data/test/reveal.html +0 -91
- data/test/scss/_settings.scss +0 -245
- data/test/scss/styles.scss +0 -50
- data/test/tabs.html +0 -197
- data/test/template.html +0 -52
- data/test/topbar-login.html +0 -194
- data/test/topbar.html +0 -139
- data/test/type.html +0 -188
- data/vendor/assets/images/foundation/orbit/bullets.jpg +0 -0
- data/vendor/assets/images/foundation/orbit/left-arrow-small.png +0 -0
- data/vendor/assets/images/foundation/orbit/left-arrow.png +0 -0
- data/vendor/assets/images/foundation/orbit/loading.gif +0 -0
- data/vendor/assets/images/foundation/orbit/mask-black.png +0 -0
- data/vendor/assets/images/foundation/orbit/pause-black.png +0 -0
- data/vendor/assets/images/foundation/orbit/right-arrow-small.png +0 -0
- data/vendor/assets/images/foundation/orbit/right-arrow.png +0 -0
- data/vendor/assets/images/foundation/orbit/rotator-black.png +0 -0
- data/vendor/assets/images/foundation/orbit/timer-black.png +0 -0
- data/vendor/assets/javascripts/foundation/app.js +0 -41
- data/vendor/assets/javascripts/foundation/index.js +0 -19
- data/vendor/assets/javascripts/foundation/jquery.event.move.js +0 -580
- data/vendor/assets/javascripts/foundation/jquery.event.swipe.js +0 -130
- data/vendor/assets/javascripts/foundation/jquery.foundation.accordion.js +0 -47
- data/vendor/assets/javascripts/foundation/jquery.foundation.alerts.js +0 -20
- data/vendor/assets/javascripts/foundation/jquery.foundation.buttons.js +0 -83
- data/vendor/assets/javascripts/foundation/jquery.foundation.clearing.js +0 -413
- data/vendor/assets/javascripts/foundation/jquery.foundation.forms.js +0 -502
- data/vendor/assets/javascripts/foundation/jquery.foundation.joyride.js +0 -639
- data/vendor/assets/javascripts/foundation/jquery.foundation.magellan.js +0 -96
- data/vendor/assets/javascripts/foundation/jquery.foundation.mediaQueryToggle.js +0 -27
- data/vendor/assets/javascripts/foundation/jquery.foundation.navigation.js +0 -55
- data/vendor/assets/javascripts/foundation/jquery.foundation.orbit.js +0 -919
- data/vendor/assets/javascripts/foundation/jquery.foundation.reveal.js +0 -794
- data/vendor/assets/javascripts/foundation/jquery.foundation.tabs.js +0 -66
- data/vendor/assets/javascripts/foundation/jquery.foundation.tooltips.js +0 -211
- data/vendor/assets/javascripts/foundation/jquery.foundation.topbar.js +0 -174
- data/vendor/assets/javascripts/foundation/jquery.js +0 -9555
- data/vendor/assets/javascripts/foundation/jquery.offcanvas.js +0 -50
@@ -0,0 +1,137 @@
|
|
1
|
+
//
|
2
|
+
// Dropdown Variables
|
3
|
+
//
|
4
|
+
|
5
|
+
// We use these to controls height and width styles.
|
6
|
+
$f-dropdown-max-width: 200px !default;
|
7
|
+
$f-dropdown-height: auto !default;
|
8
|
+
$f-dropdown-max-height: none !default;
|
9
|
+
$f-dropdown-margin-top: 2px !default;
|
10
|
+
|
11
|
+
// We use this to control the background color
|
12
|
+
$f-dropdown-bg: #fff !default;
|
13
|
+
|
14
|
+
// We use this to set the border styles for dropdowns.
|
15
|
+
$f-dropdown-border-style: solid !default;
|
16
|
+
$f-dropdown-border-width: 1px !default;
|
17
|
+
$f-dropdown-border-color: darken(#fff, 20%) !default;
|
18
|
+
|
19
|
+
// We use these to style the triangle pip.
|
20
|
+
$f-dropdown-triangle-size: 6px !default;
|
21
|
+
$f-dropdown-triangle-color: #fff !default;
|
22
|
+
$f-dropdown-triangle-side-offset: 10px !default;
|
23
|
+
|
24
|
+
// We use these to control styles for the list elements.
|
25
|
+
$f-dropdown-list-style: none !default;
|
26
|
+
$f-dropdown-font-color: #555 !default;
|
27
|
+
$f-dropdown-font-size: emCalc(14px) !default;
|
28
|
+
$f-dropdown-list-padding: emCalc(5px) emCalc(10px) !default;
|
29
|
+
$f-dropdown-line-height: emCalc(18px) !default;
|
30
|
+
$f-dropdown-list-hover-bg: #eeeeee !default;
|
31
|
+
$dropdown-mobile-left: 0 !default;
|
32
|
+
|
33
|
+
// We use this to control the styles for when the dropdown has custom content.
|
34
|
+
$f-dropdown-content-padding: emCalc(20px) !default;
|
35
|
+
|
36
|
+
//
|
37
|
+
// Dropdown Mixins
|
38
|
+
//
|
39
|
+
|
40
|
+
// NOTE: Make default max-width change between list and content types. Can add more width with classes, maybe .small, .medium, .large, etc.;
|
41
|
+
|
42
|
+
// We use this to style the dropdown container element.
|
43
|
+
@mixin dropdown-container($content:list, $triangle:true, $max-width:$f-dropdown-max-width) {
|
44
|
+
position: absolute;
|
45
|
+
left: -9999px;
|
46
|
+
top: -9999px;
|
47
|
+
list-style: $f-dropdown-list-style;
|
48
|
+
|
49
|
+
*:first-child { margin-top: 0; }
|
50
|
+
*:last-child { margin-bottom: 0; }
|
51
|
+
|
52
|
+
@if $content == list {
|
53
|
+
width: 100%;
|
54
|
+
max-height: $f-dropdown-max-height;
|
55
|
+
height: $f-dropdown-height;
|
56
|
+
background: $f-dropdown-bg;
|
57
|
+
border: $f-dropdown-border-style $f-dropdown-border-width $f-dropdown-border-color;
|
58
|
+
font-size: $em-base;
|
59
|
+
z-index: 99;
|
60
|
+
}
|
61
|
+
@else if $content == content {
|
62
|
+
padding: $f-dropdown-content-padding;
|
63
|
+
width: 100%;
|
64
|
+
height: $f-dropdown-height;
|
65
|
+
max-height: $f-dropdown-max-height;
|
66
|
+
background: $f-dropdown-bg;
|
67
|
+
border: $f-dropdown-border-style $f-dropdown-border-width $f-dropdown-border-color;
|
68
|
+
font-size: $em-base;
|
69
|
+
z-index: 99;
|
70
|
+
}
|
71
|
+
|
72
|
+
@if $triangle {
|
73
|
+
margin-top: $f-dropdown-margin-top;
|
74
|
+
|
75
|
+
&:before {
|
76
|
+
@include css-triangle($f-dropdown-triangle-size, $f-dropdown-triangle-color, bottom);
|
77
|
+
position: absolute;
|
78
|
+
top: -($f-dropdown-triangle-size * 2);
|
79
|
+
left: $f-dropdown-triangle-side-offset;
|
80
|
+
z-index: 99;
|
81
|
+
}
|
82
|
+
&:after {
|
83
|
+
@include css-triangle($f-dropdown-triangle-size + 1,$f-dropdown-border-color,bottom);
|
84
|
+
position: absolute;
|
85
|
+
top: -(($f-dropdown-triangle-size + 1) * 2);
|
86
|
+
left: $f-dropdown-triangle-side-offset - 1;
|
87
|
+
z-index: 98;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
@if $max-width { max-width: $max-width; }
|
92
|
+
@else { max-width: $f-dropdown-max-width; }
|
93
|
+
|
94
|
+
}
|
95
|
+
|
96
|
+
// We use this to style the list elements or content inside the dropdown.
|
97
|
+
@mixin dropdown-style {
|
98
|
+
font-size: $f-dropdown-font-size;
|
99
|
+
cursor: pointer;
|
100
|
+
padding: $f-dropdown-list-padding;
|
101
|
+
line-height: $f-dropdown-line-height;
|
102
|
+
margin: 0;
|
103
|
+
|
104
|
+
&:hover,
|
105
|
+
&:focus { background: $f-dropdown-list-hover-bg; }
|
106
|
+
|
107
|
+
a { color: $f-dropdown-font-color; }
|
108
|
+
}
|
109
|
+
|
110
|
+
|
111
|
+
@if $include-html-classes {
|
112
|
+
|
113
|
+
@media only screen and (max-width: 767px) {
|
114
|
+
.f-dropdown {
|
115
|
+
max-width: 100%;
|
116
|
+
left: $dropdown-mobile-left;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
/* Foundation Dropdowns */
|
121
|
+
.f-dropdown {
|
122
|
+
@include dropdown-container;
|
123
|
+
// max-width: none;
|
124
|
+
|
125
|
+
li { @include dropdown-style; }
|
126
|
+
|
127
|
+
// You can also put custom content in these dropdowns
|
128
|
+
&.content { @include dropdown-container(content, $triangle:false); }
|
129
|
+
|
130
|
+
// Sizes
|
131
|
+
&.tiny { max-width: 200px; }
|
132
|
+
&.small { max-width: 300px; }
|
133
|
+
&.medium { max-width: 500px; }
|
134
|
+
&.large { max-width: 800px; }
|
135
|
+
}
|
136
|
+
|
137
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
//
|
2
|
+
// Flex Video Variables
|
3
|
+
//
|
4
|
+
|
5
|
+
// We use these to control video container padding and margins
|
6
|
+
$flex-video-padding-top: emCalc(25px) !default;
|
7
|
+
$flex-video-padding-bottom: 67.5% !default;
|
8
|
+
$flex-video-margin-bottom: emCalc(16px) !default;
|
9
|
+
|
10
|
+
// We use this to control widescreen bottom padding
|
11
|
+
$flex-video-widescreen-padding-bottom: 57.25% !default;
|
12
|
+
|
13
|
+
//
|
14
|
+
// Flex Video Mixins
|
15
|
+
//
|
16
|
+
|
17
|
+
@mixin flex-video-container {
|
18
|
+
position: relative;
|
19
|
+
padding-top: $flex-video-padding-top;
|
20
|
+
padding-bottom: $flex-video-padding-bottom;
|
21
|
+
height: 0;
|
22
|
+
margin-bottom: $flex-video-margin-bottom;
|
23
|
+
overflow: hidden;
|
24
|
+
|
25
|
+
&.widescreen { padding-bottom: $flex-video-widescreen-padding-bottom; }
|
26
|
+
&.vimeo { padding-top: 0; }
|
27
|
+
|
28
|
+
iframe,
|
29
|
+
object,
|
30
|
+
embed,
|
31
|
+
video {
|
32
|
+
position: absolute;
|
33
|
+
top: 0;
|
34
|
+
#{$default-float}: 0;
|
35
|
+
width: 100%;
|
36
|
+
height: 100%;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
@if $include-html-classes {
|
41
|
+
|
42
|
+
/* Flex Video */
|
43
|
+
.flex-video { @include flex-video-container; }
|
44
|
+
|
45
|
+
}
|
@@ -0,0 +1,309 @@
|
|
1
|
+
//
|
2
|
+
// Form Variables
|
3
|
+
//
|
4
|
+
|
5
|
+
// We use this to set the base for lots of form spacing and positioning styles
|
6
|
+
$form-spacing: emCalc(16px) !default;
|
7
|
+
|
8
|
+
// We use these to style the labels in different ways
|
9
|
+
$label-pointer: pointer !default;
|
10
|
+
$label-font-size: emCalc(14px) !default;
|
11
|
+
$label-font-weight: 500 !default;
|
12
|
+
$label-font-color: lighten(#000, 30%) !default;
|
13
|
+
$label-bottom-margin: emCalc(3px) !default;
|
14
|
+
$input-font-color: rgba(0,0,0,0.75) !default;
|
15
|
+
$input-font-size: emCalc(14px) !default;
|
16
|
+
$input-bg-color: #fff !default;
|
17
|
+
$input-focus-bg-color: darken(#fff, 2%) !default;
|
18
|
+
$input-border-color: darken(#fff, 20%) !default;
|
19
|
+
$input-focus-border-color: darken(#fff, 40%) !default;
|
20
|
+
$input-border-style: solid !default;
|
21
|
+
$input-border-width: 1px !default;
|
22
|
+
$input-disabled-bg: #ddd !default;
|
23
|
+
$input-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1) !default;
|
24
|
+
|
25
|
+
// We use these to style the fieldset border and spacing.
|
26
|
+
$fieldset-border-style: solid !default;
|
27
|
+
$fieldset-border-width: 1px !default;
|
28
|
+
$fieldset-border-color: #ddd !default;
|
29
|
+
$fieldset-padding: emCalc(20px) !default;
|
30
|
+
$fieldset-margin: emCalc(18px) 0 !default;
|
31
|
+
|
32
|
+
// We use these to style the legends when you use them
|
33
|
+
$legend-bg: #fff !default;
|
34
|
+
$legend-font-weight: bold !default;
|
35
|
+
$legend-padding: 0 emCalc(3px) !default;
|
36
|
+
|
37
|
+
// We use these to style the prefix and postfix input elements
|
38
|
+
$input-prefix-bg: darken(#fff, 5%) !default;
|
39
|
+
$input-prefix-border-color: darken(#fff, 20%) !default;
|
40
|
+
$input-prefix-border-size: 1px !default;
|
41
|
+
$input-prefix-border-type: solid !default;
|
42
|
+
$input-prefix-overflow: hidden !default;
|
43
|
+
$input-prefix-font-color: #333 !default;
|
44
|
+
$input-prefix-font-color-alt: #fff !default;
|
45
|
+
|
46
|
+
// We use these to style the error states for inputs and labels
|
47
|
+
$input-error-message-padding: emCalc(6px) emCalc(4px) !default;
|
48
|
+
$input-error-message-top: -($form-spacing) - emCalc(5px) !default;
|
49
|
+
$input-error-message-font-size: emCalc(12px) !default;
|
50
|
+
$input-error-message-font-weight: bold !default;
|
51
|
+
$input-error-message-font-color: #fff !default;
|
52
|
+
$input-error-message-font-color-alt: #333 !default;
|
53
|
+
|
54
|
+
|
55
|
+
//
|
56
|
+
// Form Mixins
|
57
|
+
//
|
58
|
+
|
59
|
+
// We use this mixin to give us form styles for rows inside of forms
|
60
|
+
@mixin form-row-base {
|
61
|
+
.row { margin: 0 -$form-spacing / 2;
|
62
|
+
|
63
|
+
.column,
|
64
|
+
.columns { padding: 0 $form-spacing / 2; }
|
65
|
+
|
66
|
+
// Use this to collapse the margins of a form row
|
67
|
+
&.collapse { margin: 0;
|
68
|
+
|
69
|
+
.column,
|
70
|
+
.columns { padding: 0; }
|
71
|
+
|
72
|
+
}
|
73
|
+
}
|
74
|
+
input.column,
|
75
|
+
input.columns { padding-left: $form-spacing / 2; }
|
76
|
+
}
|
77
|
+
|
78
|
+
// We use this mixin to give all basic form elements their style
|
79
|
+
@mixin form-element() {
|
80
|
+
background-color: $input-bg-color;
|
81
|
+
font-family: inherit;
|
82
|
+
border: $input-border-width $input-border-style $input-border-color;
|
83
|
+
-webkit-box-shadow: $input-box-shadow;
|
84
|
+
box-shadow: $input-box-shadow;
|
85
|
+
color: $input-font-color;
|
86
|
+
display: block;
|
87
|
+
font-size: $input-font-size;
|
88
|
+
margin: 0 0 $form-spacing 0;
|
89
|
+
padding: $form-spacing / 2;
|
90
|
+
height: emCalc(13px) + ($form-spacing * 1.5);
|
91
|
+
width: 100%;
|
92
|
+
@include box-sizing(border-box);
|
93
|
+
|
94
|
+
// Basic focus styles
|
95
|
+
&:focus {
|
96
|
+
background: $input-focus-bg-color;
|
97
|
+
border-color: $input-focus-border-color;
|
98
|
+
outline: none;
|
99
|
+
}
|
100
|
+
|
101
|
+
// Disabled background input background color
|
102
|
+
&[disabled] { background-color: $input-disabled-bg; }
|
103
|
+
}
|
104
|
+
|
105
|
+
// We use this mixin to create form labels
|
106
|
+
@mixin form-label($alignment:false, $base-style:true) {
|
107
|
+
|
108
|
+
// Control whether or not the base styles come through.
|
109
|
+
@if $base-style {
|
110
|
+
font-size: $label-font-size;
|
111
|
+
color: $label-font-color;
|
112
|
+
cursor: $label-pointer;
|
113
|
+
display: block;
|
114
|
+
font-weight: $label-font-weight;
|
115
|
+
margin-bottom: $label-bottom-margin;
|
116
|
+
}
|
117
|
+
|
118
|
+
// Alignment options
|
119
|
+
@if $alignment == right {
|
120
|
+
float: none;
|
121
|
+
text-align: right;
|
122
|
+
}
|
123
|
+
@else if $alignment == inline {
|
124
|
+
margin: 0 0 $form-spacing 0;
|
125
|
+
padding: $form-spacing / 2 + emCalc($input-border-width * 2) 0;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
// We use this mixin to create postfix/prefix form Labels
|
130
|
+
@mixin prefix-postfix-base {
|
131
|
+
display: block;
|
132
|
+
position: relative;
|
133
|
+
z-index: 2;
|
134
|
+
text-align: center;
|
135
|
+
width: 100%;
|
136
|
+
padding-top: 0;
|
137
|
+
padding-bottom: 0;
|
138
|
+
border-style: $input-prefix-border-type;
|
139
|
+
border-width: $input-prefix-border-size;
|
140
|
+
overflow: $input-prefix-overflow;
|
141
|
+
font-size: $label-font-size;
|
142
|
+
height: ($label-font-size + ($form-spacing * 1.5) - emCalc(1px));
|
143
|
+
line-height: ($label-font-size + ($form-spacing * 1.5) - emCalc(1px));
|
144
|
+
}
|
145
|
+
|
146
|
+
// We use this mixin to create prefix label styles
|
147
|
+
@mixin prefix($bg:$input-prefix-bg,$is-button:false) {
|
148
|
+
|
149
|
+
@if $bg {
|
150
|
+
$bg-lightness: lightness($bg);
|
151
|
+
background: $bg;
|
152
|
+
border-color: darken($bg, 10%);
|
153
|
+
border-right: none;
|
154
|
+
|
155
|
+
// Control the font color based on background brightness
|
156
|
+
@if $bg-lightness > 70% or $bg == yellow { color: $input-prefix-font-color; }
|
157
|
+
@else { color: $input-prefix-font-color-alt; }
|
158
|
+
}
|
159
|
+
|
160
|
+
@if $is-button {
|
161
|
+
padding-#{$default-float}: 0;
|
162
|
+
padding-#{$default-opposite}: 0;
|
163
|
+
text-align: center;
|
164
|
+
line-height: emCalc(34px);
|
165
|
+
}
|
166
|
+
|
167
|
+
}
|
168
|
+
|
169
|
+
// We use this mixin to create postfix label styles
|
170
|
+
@mixin postfix($bg:$input-prefix-bg, $is-button:false) {
|
171
|
+
|
172
|
+
@if $bg {
|
173
|
+
$bg-lightness: lightness($bg);
|
174
|
+
background: $bg;
|
175
|
+
border-color: darken($bg, 15%);
|
176
|
+
border-left: none;
|
177
|
+
|
178
|
+
// Control the font color based on background brightness
|
179
|
+
@if $bg-lightness > 70% or $bg == yellow { color: $input-prefix-font-color; }
|
180
|
+
@else { color: $input-prefix-font-color-alt; }
|
181
|
+
}
|
182
|
+
|
183
|
+
@if $is-button {
|
184
|
+
padding-#{$default-float}: 0;
|
185
|
+
padding-#{$default-opposite}: 0;
|
186
|
+
text-align: center;
|
187
|
+
line-height: emCalc(34px);
|
188
|
+
}
|
189
|
+
|
190
|
+
}
|
191
|
+
|
192
|
+
// We use this mixin to style fieldsets
|
193
|
+
@mixin fieldset {
|
194
|
+
border: $fieldset-border-style $fieldset-border-width $fieldset-border-color;
|
195
|
+
padding: $fieldset-padding;
|
196
|
+
margin: $fieldset-margin;
|
197
|
+
|
198
|
+
// and legend styles
|
199
|
+
legend {
|
200
|
+
font-weight: $legend-font-weight;
|
201
|
+
background: $legend-bg;
|
202
|
+
padding: $legend-padding;
|
203
|
+
margin: 0;
|
204
|
+
margin-#{$default-float}: emCalc(-3px);
|
205
|
+
}
|
206
|
+
}
|
207
|
+
|
208
|
+
// We use this mixin to control border and background color of error inputs
|
209
|
+
@mixin form-error-color($color:$alert-color) {
|
210
|
+
border-color: $color;
|
211
|
+
background-color: rgba($color, 0.1);
|
212
|
+
|
213
|
+
// Go back to normal on focus
|
214
|
+
&:focus {
|
215
|
+
background: $input-focus-bg-color;
|
216
|
+
border-color: $input-focus-border-color;
|
217
|
+
}
|
218
|
+
}
|
219
|
+
|
220
|
+
// We use this simple mixin to style labels for error inputs
|
221
|
+
@mixin form-label-error-color($color:$alert-color) { color: $color; }
|
222
|
+
|
223
|
+
// We use this mixin to create error message styles
|
224
|
+
@mixin form-error-message($bg:$alert-color) {
|
225
|
+
display: block;
|
226
|
+
padding: $input-error-message-padding;
|
227
|
+
margin-top: $input-error-message-top;
|
228
|
+
margin-bottom: $form-spacing;
|
229
|
+
font-size: $input-error-message-font-size;
|
230
|
+
font-weight: $input-error-message-font-weight;
|
231
|
+
|
232
|
+
// We can control the text color based on the brightness of the background.
|
233
|
+
$bg-lightness: lightness($bg);
|
234
|
+
background: $bg;
|
235
|
+
@if $bg-lightness < 70% or $bg == yellow { color: $input-error-message-font-color; }
|
236
|
+
@else { color: $input-error-message-font-color-alt; }
|
237
|
+
}
|
238
|
+
|
239
|
+
|
240
|
+
/* Standard Forms */
|
241
|
+
form { margin: 0 0 $form-spacing; }
|
242
|
+
|
243
|
+
/* Using forms within rows, we need to set some defaults */
|
244
|
+
form .row { @include form-row-base; }
|
245
|
+
form .row .row { margin: 0; }
|
246
|
+
|
247
|
+
/* Label Styles */
|
248
|
+
label { @include form-label;
|
249
|
+
&.right { @include form-label(right,false); }
|
250
|
+
&.inline { @include form-label(inline,false); }
|
251
|
+
}
|
252
|
+
|
253
|
+
/* Attach elements to the beginning or end of an input */
|
254
|
+
.prefix,
|
255
|
+
.postfix { @include prefix-postfix-base; }
|
256
|
+
|
257
|
+
/* Adjust padding, alignment and radius if pre/post element is a button */
|
258
|
+
.postfix.button { @include button-size(false,false,false); @include postfix(false,true); }
|
259
|
+
.prefix.button { @include button-size(false,false,false); @include prefix(false,true); }
|
260
|
+
.prefix.button.radius { @include side-radius(left, $global-radius); }
|
261
|
+
.postfix.button.radius { @include side-radius(right, $global-radius); }
|
262
|
+
|
263
|
+
/* Separate prefix and postfix styles when on span so buttons keep their own */
|
264
|
+
span.prefix { @include prefix();
|
265
|
+
&.radius { @include side-radius(left, $global-radius); }
|
266
|
+
}
|
267
|
+
span.postfix { @include postfix();
|
268
|
+
&.radius { @include side-radius(right, $global-radius); }
|
269
|
+
}
|
270
|
+
|
271
|
+
/* We use this to get basic styling on all basic form elements */
|
272
|
+
input[type="text"],
|
273
|
+
input[type="password"],
|
274
|
+
input[type="date"],
|
275
|
+
input[type="datetime"],
|
276
|
+
input[type="datetime-local"],
|
277
|
+
input[type="month"],
|
278
|
+
input[type="week"],
|
279
|
+
input[type="email"],
|
280
|
+
input[type="number"],
|
281
|
+
input[type="search"],
|
282
|
+
input[type="tel"],
|
283
|
+
input[type="time"],
|
284
|
+
input[type="url"],
|
285
|
+
textarea {
|
286
|
+
@include form-element;
|
287
|
+
@include single-transition(all, 0.15s, linear);
|
288
|
+
}
|
289
|
+
|
290
|
+
/* We add basic fieldset styling */
|
291
|
+
fieldset {
|
292
|
+
@include fieldset;
|
293
|
+
}
|
294
|
+
|
295
|
+
/* Error Handling */
|
296
|
+
.error input,
|
297
|
+
input.error,
|
298
|
+
.error textarea,
|
299
|
+
textarea.error {
|
300
|
+
@include form-error-color;
|
301
|
+
}
|
302
|
+
|
303
|
+
.error label,
|
304
|
+
label.error { @include form-label-error-color; }
|
305
|
+
|
306
|
+
.error small,
|
307
|
+
small.error {
|
308
|
+
@include form-error-message;
|
309
|
+
}
|