foundation-rails 5.0.1.0

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