renalware-core 2.0.151 → 2.0.157

Sign up to get free protection for your applications and to get access to all the features.
Files changed (291) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/renalware/components/navigation.js +0 -7
  3. data/app/assets/javascripts/renalware/components/sortable.js +3 -0
  4. data/app/assets/javascripts/renalware/core.js.erb +0 -2
  5. data/app/assets/javascripts/renalware/rollup_compiled.css +69147 -50289
  6. data/app/assets/javascripts/renalware/rollup_compiled.js +10 -14
  7. data/app/assets/stylesheets/renalware/base/_variables.scss +1 -0
  8. data/app/assets/stylesheets/renalware/lib/_foundation_and_overrides.scss +1 -620
  9. data/app/assets/stylesheets/renalware/lib/_select2-foundation5-overrides.scss +1 -1
  10. data/app/assets/stylesheets/renalware/modules/_medications.scss +9 -9
  11. data/app/assets/stylesheets/renalware/modules/_patients.scss +4 -0
  12. data/app/assets/stylesheets/renalware/modules/_users.scss +2 -1
  13. data/app/assets/stylesheets/renalware/partials/_forms.scss +11 -0
  14. data/app/assets/stylesheets/renalware/partials/_navigation.scss +15 -12
  15. data/app/assets/stylesheets/renalware/partials/_simple_form.scss +1 -1
  16. data/app/assets/stylesheets/renalware/partials/_tables.scss +15 -8
  17. data/app/assets/stylesheets/renalware/partials/_toggle.scss +0 -66
  18. data/app/assets/stylesheets/renalware/partials/_toggling.scss +18 -0
  19. data/app/assets/stylesheets/renalware/partials/_trix.scss +12 -0
  20. data/app/components/renalware/admissions/active_consult_alert_component.html.slim +4 -0
  21. data/app/components/renalware/admissions/active_consult_alert_component.rb +25 -0
  22. data/app/components/renalware/article_component.html.slim +5 -0
  23. data/app/components/renalware/article_component.rb +12 -0
  24. data/app/components/renalware/events/event_list_component.rb +6 -1
  25. data/app/components/renalware/medications/tabbed_prescriptions_list_component.html.slim +41 -0
  26. data/app/components/renalware/medications/tabbed_prescriptions_list_component.rb +47 -0
  27. data/app/components/renalware/patients/messages_component.html.slim +45 -0
  28. data/app/components/renalware/patients/messages_component.rb +52 -0
  29. data/app/components/renalware/pd/adequacy_results_component.html.slim +3 -5
  30. data/app/components/renalware/system/admin_menu_component.html.slim +3 -1
  31. data/app/components/renalware/users/last_signin_component.html.slim +3 -0
  32. data/app/components/renalware/users/last_signin_component.rb +23 -0
  33. data/app/controllers/renalware/admin/playgrounds_controller.rb +1 -1
  34. data/app/controllers/renalware/admin/users_controller.rb +1 -0
  35. data/app/controllers/renalware/drugs/drugs_controller.rb +4 -0
  36. data/app/controllers/renalware/hd/historical_profiles_controller.rb +1 -1
  37. data/app/controllers/renalware/medications/prescriptions_controller.rb +5 -2
  38. data/app/controllers/renalware/messaging/internal/messages_controller.rb +14 -5
  39. data/app/controllers/renalware/pathology/observation_descriptions_controller.rb +58 -0
  40. data/app/controllers/renalware/patients/mdms_controller.rb +104 -0
  41. data/app/controllers/renalware/system/view_metadata_controller.rb +61 -0
  42. data/app/controllers/renalware/users_controller.rb +25 -0
  43. data/app/helpers/renalware/application_helper.rb +2 -1
  44. data/app/helpers/renalware/drugs_helper.rb +6 -0
  45. data/app/helpers/renalware/layout_helper.rb +1 -1
  46. data/app/models/concerns/renalware/sortable.rb +49 -0
  47. data/app/models/renalware/accesses/patient.rb +2 -2
  48. data/app/models/renalware/accesses/plan.rb +1 -1
  49. data/app/models/renalware/admissions/request.rb +1 -0
  50. data/app/models/renalware/clinical/body_composition.rb +1 -1
  51. data/app/models/renalware/clinical/dry_weight.rb +1 -1
  52. data/app/models/renalware/clinics/clinic_visit.rb +5 -4
  53. data/app/models/renalware/feeds/files/create_feed_file.rb +1 -1
  54. data/app/models/renalware/hd/patient.rb +1 -1
  55. data/app/models/renalware/hd/preference_set.rb +1 -1
  56. data/app/models/renalware/hd/profile.rb +4 -4
  57. data/app/models/renalware/hd/schedule_definition.rb +1 -1
  58. data/app/models/renalware/hd/session.rb +2 -2
  59. data/app/models/renalware/hd/session_forms/batch_compile_pdfs.rb +1 -1
  60. data/app/models/renalware/hd/station.rb +2 -1
  61. data/app/models/renalware/letters/description.rb +2 -0
  62. data/app/models/renalware/letters/letter.rb +1 -1
  63. data/app/models/renalware/letters/part/prescriptions.rb +12 -3
  64. data/app/models/renalware/letters/pdf_letter_cache.rb +1 -1
  65. data/app/models/renalware/letters/printing/batch_compile_pdfs.rb +1 -1
  66. data/app/models/renalware/letters/recipient_params_processor.rb +1 -1
  67. data/app/models/renalware/medications/prescription.rb +0 -4
  68. data/app/models/renalware/messaging/internal/message_form.rb +1 -0
  69. data/app/models/renalware/messaging/internal/message_form_builder.rb +2 -1
  70. data/app/models/renalware/pathology/current_observations_for_descriptions_query.rb +3 -3
  71. data/app/models/renalware/pathology/measurement_unit.rb +13 -0
  72. data/app/models/renalware/pathology/observation_description.rb +23 -5
  73. data/app/models/renalware/pathology/observation_descriptions_by_code_query.rb +1 -1
  74. data/app/models/renalware/pathology/observation_requests_attributes_builder.rb +45 -5
  75. data/app/models/renalware/pathology/observations_within_date_range_query.rb +1 -1
  76. data/app/models/renalware/patient.rb +2 -2
  77. data/app/models/renalware/patients/bookmark.rb +2 -2
  78. data/app/models/renalware/patients/mdm_menu.rb +41 -0
  79. data/app/models/renalware/patients/mdm_patients_query.rb +1 -1
  80. data/app/models/renalware/patients/search_query.rb +1 -1
  81. data/app/models/renalware/patients/worry.rb +0 -1
  82. data/app/models/renalware/pd/mdm_patients_query.rb +1 -1
  83. data/app/models/renalware/problems/problem.rb +2 -1
  84. data/app/models/renalware/snippets/snippet_query.rb +1 -1
  85. data/app/models/renalware/surveys/question.rb +1 -2
  86. data/app/models/renalware/system/column_definition.rb +43 -0
  87. data/app/models/renalware/system/filter_definition.rb +29 -0
  88. data/app/models/renalware/system/update_user.rb +5 -0
  89. data/app/models/renalware/system/version.rb +11 -0
  90. data/app/models/renalware/system/view_metadata.rb +25 -0
  91. data/app/models/renalware/transplants/donation.rb +1 -1
  92. data/app/models/renalware/transplants/donor_followup.rb +0 -1
  93. data/app/models/renalware/transplants/failure_cause_description.rb +1 -1
  94. data/app/models/renalware/transplants/mdm_patients_query.rb +2 -2
  95. data/app/models/renalware/transplants/patient.rb +1 -1
  96. data/app/models/renalware/transplants/recipient_followup.rb +1 -3
  97. data/app/models/renalware/transplants/registration.rb +1 -3
  98. data/app/models/renalware/transplants/registrations/wait_list_query.rb +4 -4
  99. data/app/models/renalware/ukrdc/measurement_unit.rb +21 -0
  100. data/app/models/renalware/ukrdc/outgoing/rendering/lab_order.rb +30 -2
  101. data/app/models/renalware/ukrdc/paths.rb +1 -1
  102. data/app/models/renalware/ukrdc/treatment_timeline/prepare_tables.rb +1 -1
  103. data/app/models/renalware/ukrdc/treatment_timeline/remap_model_table_names_to_their_prepared_equivalents.rb +1 -1
  104. data/app/policies/application_policy.rb +1 -1
  105. data/app/policies/renalware/medications/prescription_policy.rb +35 -0
  106. data/app/policies/renalware/system/view_metadata_policy.rb +17 -0
  107. data/app/presenters/concerns/renalware/accountable_presentation.rb +33 -0
  108. data/app/presenters/renalware/clinics/visit_presenter.rb +11 -0
  109. data/app/presenters/renalware/events/event_presenter.rb +11 -0
  110. data/app/presenters/renalware/mdm_presenter.rb +11 -0
  111. data/app/presenters/renalware/pathology/results_presenter.rb +1 -2
  112. data/app/presenters/renalware/renal/clinical_summary_presenter.rb +9 -6
  113. data/app/views/renalware/admin/playgrounds/show.html.slim +2 -6
  114. data/app/views/renalware/admin/users/edit.html.slim +9 -0
  115. data/app/views/renalware/admin/users/index.html.slim +6 -0
  116. data/app/views/renalware/admissions/admissions/_filters.html.slim +8 -16
  117. data/app/views/renalware/clinical/allergies/_list.html.slim +3 -1
  118. data/app/views/renalware/dashboard/dashboards/show.html.slim +1 -0
  119. data/app/views/renalware/hd/protocols/_virology.html.slim +4 -5
  120. data/app/views/renalware/letters/letters/_form.html.slim +1 -1
  121. data/app/views/renalware/letters/parts/_prescriptions.html.slim +4 -0
  122. data/app/views/renalware/mdm/_prescriptions.html.slim +4 -13
  123. data/app/views/renalware/mdm/prescriptions/_table.html.slim +3 -1
  124. data/app/views/renalware/medications/prescriptions/_current_hd.html.slim +13 -0
  125. data/app/views/renalware/medications/prescriptions/_filter_form.html.slim +26 -13
  126. data/app/views/renalware/medications/prescriptions/_form.html.slim +3 -2
  127. data/app/views/renalware/medications/prescriptions/_options.html.slim +3 -3
  128. data/app/views/renalware/medications/prescriptions/_table.html.slim +5 -4
  129. data/app/views/renalware/medications/prescriptions/_tables.html.slim +13 -16
  130. data/app/views/renalware/medications/prescriptions/index.html.slim +5 -4
  131. data/app/views/renalware/messaging/internal/messages/_form.html.slim +3 -0
  132. data/app/views/renalware/messaging/internal/messages/index.html.slim +36 -0
  133. data/app/views/renalware/navigation/_mdms.html.slim +5 -0
  134. data/app/views/renalware/navigation/_renal.html.slim +1 -0
  135. data/app/views/renalware/navigation/{_super_admin.html.slim → _super_admin.html.slim.dead} +0 -0
  136. data/app/views/renalware/pathology/code_groups/edit.html.slim +5 -5
  137. data/app/views/renalware/pathology/code_groups/index.html.slim +4 -5
  138. data/app/views/renalware/pathology/code_groups/show.html.slim +25 -26
  139. data/app/views/renalware/pathology/observation_descriptions/_filters.html.slim +14 -0
  140. data/app/views/renalware/pathology/observation_descriptions/edit.html.slim +21 -0
  141. data/app/views/renalware/pathology/observation_descriptions/index.html.slim +38 -0
  142. data/app/views/renalware/pathology/requests/requests/request_form/_crs_form.html.slim +1 -1
  143. data/app/views/renalware/patients/alerts/_list.html.slim +1 -0
  144. data/app/views/renalware/patients/mdms/_filters.html.slim +38 -0
  145. data/app/views/renalware/patients/mdms/_table.html.slim +72 -0
  146. data/app/views/renalware/patients/mdms/show.html.slim +18 -0
  147. data/app/views/renalware/patients/side_menu/_general.html.slim +4 -0
  148. data/app/views/renalware/patients/worryboard/_filters.html.slim +18 -13
  149. data/app/views/renalware/pd/_peritonitis_episodes.html.slim +13 -13
  150. data/app/views/renalware/pd/adequacy_results/_form_fields.html.slim +1 -1
  151. data/app/views/renalware/pd/adequacy_results/_table.html.slim +2 -2
  152. data/app/views/renalware/pd/dashboards/show.html.slim +3 -3
  153. data/app/views/renalware/pd/dashboards/show/_page_actions.html.slim +9 -16
  154. data/app/views/renalware/pd/dashboards/show/_pet_adequacies.html.slim +1 -1
  155. data/app/views/renalware/pd/peritonitis_episodes/show.html.slim +8 -6
  156. data/app/views/renalware/shared/_fieldset.html.slim +1 -2
  157. data/app/views/renalware/shared/_magellan_block.html.slim +1 -2
  158. data/app/views/renalware/system/view_metadata/_columns_table.html.slim +44 -0
  159. data/app/views/renalware/system/view_metadata/_filters_form.html.slim +19 -0
  160. data/app/views/renalware/system/view_metadata/_versions.html.slim +23 -0
  161. data/app/views/renalware/system/view_metadata/edit.html.slim +66 -0
  162. data/app/views/renalware/transplants/mdm/_prescriptions.html.slim +6 -22
  163. data/app/views/renalware/users/_filters.html.slim +11 -0
  164. data/app/views/renalware/users/index.html.slim +24 -0
  165. data/config/initializers/core_extensions.rb +2 -2
  166. data/config/initializers/delayed_job.rb +1 -1
  167. data/config/initializers/inflections.rb +1 -0
  168. data/config/initializers/pagy.rb +5 -0
  169. data/config/locales/renalware/clinical/allergies.en.yml +1 -0
  170. data/config/locales/renalware/medications/tabbed_prescriptions_list_component.yml +15 -0
  171. data/config/locales/renalware/navigation/renal.en.yml +1 -0
  172. data/config/locales/renalware/patients/side_menu.en.yml +1 -0
  173. data/config/permissions.yml +1 -0
  174. data/config/routes.rb +1 -0
  175. data/config/routes/messaging.rb +9 -1
  176. data/config/routes/pathology.rb +1 -0
  177. data/config/routes/patients.rb +1 -0
  178. data/config/routes/system.rb +3 -0
  179. data/config/routes/users.rb +3 -0
  180. data/db/functions/convert_to_float_with_explicit_return_v01.sql +18 -0
  181. data/db/functions/update_current_observation_set_from_trigger_v05.sql +92 -0
  182. data/db/functions/update_pathology_observations_nresult_from_trigger_v01.sql +13 -0
  183. data/db/migrate/20200122182018_update_patient_current_modalities.rb +7 -0
  184. data/db/migrate/20200122182036_create_transplant_mdm_patients.rb +7 -0
  185. data/db/migrate/20200122190909_create_view_metadata.rb +44 -0
  186. data/db/migrate/20200131133223_create_hd_mdm_patients.rb +7 -0
  187. data/db/migrate/20200205185151_add_columns_to_system_view_metadata.rb +13 -0
  188. data/db/migrate/20200219113324_create_supportive_care_mdm_patients_view.rb +7 -0
  189. data/db/migrate/20200226145010_add_unique_indexes.rb +12 -11
  190. data/db/migrate/20200622120232_add_limits_to_path_obs_descriptions.rb +18 -0
  191. data/db/migrate/20200626081248_overload_convert_to_float_function.rb +13 -0
  192. data/db/migrate/20200626090256_add_nresult_to_pathology_observations.rb +29 -0
  193. data/db/migrate/20200628094228_add_prescriber_to_users.rb +14 -0
  194. data/db/migrate/20200812074223_add_public_flag_to_messages.rb +18 -0
  195. data/db/migrate/20200815150303_create_system_versions.rb +16 -0
  196. data/db/migrate/20200817085618_create_pd_mdm_patients.rb +7 -0
  197. data/db/migrate/20200817103930_create_low_clearance_mdm_patients.rb +7 -0
  198. data/db/migrate/20201001144512_update_fn_update_current_obs_set_triggerv05.rb +13 -0
  199. data/db/migrate/20201001145452_add_position_to_letter_descriptions.rb +5 -0
  200. data/db/migrate/20201009090959_make_drug_types_unique.rb +8 -0
  201. data/db/migrate/20201012160414_add_suggested_measurement_unit_to_pathology_observation_descriptions.rb +18 -0
  202. data/db/migrate/20201012171428_create_ukrdc_measurement_units.rb +18 -0
  203. data/db/migrate/20201015160542_add_position_to_drug_types.rb +31 -0
  204. data/db/migrate/20201020155510_add_bmi_to_clinic_visits.rb +31 -0
  205. data/db/migrate/20201020164524_update_pd_mdm_patients_view.rb +7 -0
  206. data/db/migrate/20201020170921_update_hd_mdm_patients_view.rb +7 -0
  207. data/db/migrate/20201020171139_update_low_clearance_mdm_patients_view.rb +7 -0
  208. data/db/migrate/20201021153832_update_supportive_care_mdm_patients_view.rb +7 -0
  209. data/db/migrate/20201021154809_update_transplant_mdm_patients_view.rb +7 -0
  210. data/db/migrate/20201023092859_remove_unused_indexes.rb +20 -0
  211. data/db/seeds/default/system/seeds.rb +1 -0
  212. data/db/seeds/default/system/view_metadata.rb +91 -0
  213. data/db/seeds/default/ukrdc/measurement_units.csv +12 -0
  214. data/db/seeds/default/ukrdc/measurement_units.rb +15 -0
  215. data/db/seeds/default/ukrdc/seeds.rb +1 -0
  216. data/db/triggers/update_pathology_observations_nresult_trigger_v01.sql +11 -0
  217. data/db/views/hd_mdm_patients_v01.sql +69 -0
  218. data/db/views/hd_mdm_patients_v02.sql +70 -0
  219. data/db/views/low_clearance_mdm_patients_v01.sql +38 -0
  220. data/db/views/low_clearance_mdm_patients_v02.sql +39 -0
  221. data/db/views/patient_current_modalities_v02.sql +18 -0
  222. data/db/views/pd_mdm_patients_v01.sql +42 -0
  223. data/db/views/pd_mdm_patients_v02.sql +43 -0
  224. data/db/views/supportive_care_mdm_patients_v01.sql +28 -0
  225. data/db/views/supportive_care_mdm_patients_v02.sql +29 -0
  226. data/db/views/transplant_mdm_patients_v01.sql +46 -0
  227. data/db/views/transplant_mdm_patients_v02.sql +47 -0
  228. data/lib/renalware/configuration.rb +2 -0
  229. data/lib/renalware/engine.rb +2 -2
  230. data/lib/renalware/version_number.rb +1 -2
  231. data/lib/tasks/db.rake +9 -0
  232. data/lib/tasks/pd.rake +28 -0
  233. data/spec/factories/drugs/drug_types.rb +5 -1
  234. data/spec/factories/messaging/internal/messages.rb +1 -0
  235. data/spec/factories/patients/practices.rb +1 -1
  236. data/spec/factories/patients/primary_care_physicians.rb +1 -1
  237. data/spec/factories/system/users.rb +1 -0
  238. data/spec/factories/system/view_metadata.rb +20 -0
  239. data/spec/support/capybara_helper.rb +2 -4
  240. data/spec/support/letters_spec_helper.rb +1 -1
  241. data/spec/support/matchers/validate_timeliness_of.rb +1 -1
  242. data/spec/support/pathology_spec_helper.rb +1 -2
  243. data/spec/support/policy_spec_helper.rb +12 -0
  244. data/vendor/assets/javascripts/foundation/foundation.alert.js +43 -0
  245. data/vendor/assets/javascripts/foundation/foundation.dropdown.js +468 -0
  246. data/vendor/assets/javascripts/foundation/foundation.js +727 -0
  247. data/vendor/assets/javascripts/foundation/foundation.reveal.js +522 -0
  248. data/vendor/assets/javascripts/foundation/foundation.tab.js +247 -0
  249. data/vendor/assets/javascripts/foundation/foundation.tooltip.js +348 -0
  250. data/vendor/assets/javascripts/foundation/foundation.topbar.js +458 -0
  251. data/vendor/assets/stylesheets/foundation/_functions.scss +156 -0
  252. data/vendor/assets/stylesheets/foundation/components/_alert-boxes.scss +128 -0
  253. data/vendor/assets/stylesheets/foundation/components/_buttons.scss +261 -0
  254. data/vendor/assets/stylesheets/foundation/components/_dropdown-buttons.scss +130 -0
  255. data/vendor/assets/stylesheets/foundation/components/_dropdown.scss +269 -0
  256. data/vendor/assets/stylesheets/foundation/components/_forms.scss +601 -0
  257. data/vendor/assets/stylesheets/foundation/components/_global.scss +566 -0
  258. data/vendor/assets/stylesheets/foundation/components/_grid.scss +292 -0
  259. data/vendor/assets/stylesheets/foundation/components/_labels.scss +106 -0
  260. data/vendor/assets/stylesheets/foundation/components/_pagination.scss +163 -0
  261. data/vendor/assets/stylesheets/foundation/components/_panels.scss +107 -0
  262. data/vendor/assets/stylesheets/foundation/components/_reveal.scss +212 -0
  263. data/vendor/assets/stylesheets/foundation/components/_side-nav.scss +120 -0
  264. data/vendor/assets/stylesheets/foundation/components/_split-buttons.scss +203 -0
  265. data/vendor/assets/stylesheets/foundation/components/_sub-nav.scss +125 -0
  266. data/vendor/assets/stylesheets/foundation/components/_tables.scss +135 -0
  267. data/vendor/assets/stylesheets/foundation/components/_tabs.scss +142 -0
  268. data/vendor/assets/stylesheets/foundation/components/_tooltips.scss +142 -0
  269. data/vendor/assets/stylesheets/foundation/components/_top-bar.scss +745 -0
  270. data/vendor/assets/stylesheets/foundation/components/_type.scss +525 -0
  271. data/vendor/assets/stylesheets/foundation/components/_visibility.scss +425 -0
  272. metadata +162 -64
  273. data/app/views/renalware/pd/infection_organisms/_edit.html.slim.obsolete +0 -16
  274. data/app/views/renalware/transplants/donor_operations/_sections_nav.html.slim +0 -11
  275. data/app/views/renalware/transplants/donor_workups/_sections_nav.html.slim +0 -15
  276. data/app/views/renalware/transplants/recipient_operations/_sections_nav.html.slim +0 -14
  277. data/app/views/renalware/transplants/recipient_workups/_sections_nav.html.slim +0 -15
  278. data/lib/core_extensions/active_record/sort.rb +0 -52
  279. data/spec/support/pages/accesses/procedure_page.rb +0 -53
  280. data/spec/support/pages/accesses/profile_page.rb +0 -45
  281. data/spec/support/pages/admissions/consults_page.rb +0 -26
  282. data/spec/support/pages/clinical/allergy_page.rb +0 -74
  283. data/spec/support/pages/clinical/profile_page.rb +0 -28
  284. data/spec/support/pages/hd/prescription_administration_dialog.rb +0 -132
  285. data/spec/support/pages/letters/form.rb +0 -63
  286. data/spec/support/pages/letters/mailshots/form.rb +0 -58
  287. data/spec/support/pages/letters/patient_letters.rb +0 -20
  288. data/spec/support/pages/low_clearance/profile_page.rb +0 -70
  289. data/spec/support/pages/medications/home_delivery_dialog.rb +0 -77
  290. data/spec/support/pages/medications/prescription_fom.rb +0 -62
  291. data/spec/support/pages/page_object.rb +0 -10
@@ -0,0 +1,130 @@
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: $white !default;
14
+ $dropdown-button-pip-color-alt: $oil !default;
15
+
16
+ // We use these to set the size of the pip in dropdown buttons
17
+ $button-pip-tny: rem-calc(6) !default;
18
+ $button-pip-sml: rem-calc(7) !default;
19
+ $button-pip-med: rem-calc(9) !default;
20
+ $button-pip-lrg: rem-calc(11) !default;
21
+
22
+ // We use these to style tiny dropdown buttons
23
+ $dropdown-button-padding-tny: $button-pip-tny * 7 !default;
24
+ $dropdown-button-pip-size-tny: $button-pip-tny !default;
25
+ $dropdown-button-pip-opposite-tny: $button-pip-tny * 3 !default;
26
+ $dropdown-button-pip-top-tny: (-$button-pip-tny / 2) + rem-calc(1) !default;
27
+
28
+ // We use these to style small dropdown buttons
29
+ $dropdown-button-padding-sml: $button-pip-sml * 7 !default;
30
+ $dropdown-button-pip-size-sml: $button-pip-sml !default;
31
+ $dropdown-button-pip-opposite-sml: $button-pip-sml * 3 !default;
32
+ $dropdown-button-pip-top-sml: (-$button-pip-sml / 2) + rem-calc(1) !default;
33
+
34
+ // We use these to style medium dropdown buttons
35
+ $dropdown-button-padding-med: $button-pip-med * 6 + rem-calc(3) !default;
36
+ $dropdown-button-pip-size-med: $button-pip-med - rem-calc(3) !default;
37
+ $dropdown-button-pip-opposite-med: $button-pip-med * 2.5 !default;
38
+ $dropdown-button-pip-top-med: (-$button-pip-med / 2) + rem-calc(2) !default;
39
+
40
+ // We use these to style large dropdown buttons
41
+ $dropdown-button-padding-lrg: $button-pip-lrg * 5 + rem-calc(3) !default;
42
+ $dropdown-button-pip-size-lrg: $button-pip-lrg - rem-calc(6) !default;
43
+ $dropdown-button-pip-opposite-lrg: $button-pip-lrg * 2.5 !default;
44
+ $dropdown-button-pip-top-lrg: (-$button-pip-lrg / 2) + rem-calc(3) !default;
45
+
46
+ // @mixins
47
+ //
48
+ // Dropdown Button Mixin
49
+ //
50
+ // We use this mixin to build off of the button mixin and add dropdown button styles
51
+ //
52
+ // $padding - Determines the size of button you're working with. Default: medium. Options [tiny, small, medium, large]
53
+ // $pip-color - Color of the little triangle that points to the dropdown. Default: $white.
54
+ // $base-style - Add in base-styles. This can be set to false. Default:true
55
+
56
+ @mixin dropdown-button($padding:medium, $pip-color:$dropdown-button-pip-color, $base-style:true) {
57
+
58
+ // We add in base styles, but they can be negated by setting to 'false'.
59
+ @if $base-style {
60
+ position: relative;
61
+
62
+ // This creates the base styles for the triangle pip
63
+ &::after {
64
+ border-color: $dropdown-button-pip-color transparent transparent transparent;
65
+ border-style: solid;
66
+ content: "";
67
+ display: block;
68
+ height: 0;
69
+ position: absolute;
70
+ top: 50%;
71
+ width: 0;
72
+ }
73
+ }
74
+
75
+ // If we're dealing with tiny buttons, use these styles
76
+ @if $padding == tiny {
77
+ padding-#{$opposite-direction}: $dropdown-button-padding-tny;
78
+ &:after {
79
+ border-width: $dropdown-button-pip-size-tny;
80
+ #{$opposite-direction}: $dropdown-button-pip-opposite-tny;
81
+ margin-top: $dropdown-button-pip-top-tny;
82
+ }
83
+ }
84
+
85
+ // If we're dealing with small buttons, use these styles
86
+ @if $padding == small {
87
+ padding-#{$opposite-direction}: $dropdown-button-padding-sml;
88
+ &::after {
89
+ border-width: $dropdown-button-pip-size-sml;
90
+ #{$opposite-direction}: $dropdown-button-pip-opposite-sml;
91
+ margin-top: $dropdown-button-pip-top-sml;
92
+ }
93
+ }
94
+
95
+ // If we're dealing with default (medium) buttons, use these styles
96
+ @if $padding == medium {
97
+ padding-#{$opposite-direction}: $dropdown-button-padding-med;
98
+ &::after {
99
+ border-width: $dropdown-button-pip-size-med;
100
+ #{$opposite-direction}: $dropdown-button-pip-opposite-med;
101
+ margin-top: $dropdown-button-pip-top-med;
102
+ }
103
+ }
104
+
105
+ // If we're dealing with large buttons, use these styles
106
+ @if $padding == large {
107
+ padding-#{$opposite-direction}: $dropdown-button-padding-lrg;
108
+ &::after {
109
+ border-width: $dropdown-button-pip-size-lrg;
110
+ #{$opposite-direction}: $dropdown-button-pip-opposite-lrg;
111
+ margin-top: $dropdown-button-pip-top-lrg;
112
+ }
113
+ }
114
+
115
+ // We can control the pip color. We didn't use logic in this case, just set it and forget it.
116
+ @if $pip-color {
117
+ &::after { border-color: $pip-color transparent transparent transparent; }
118
+ }
119
+ }
120
+
121
+ @include exports("dropdown-button") {
122
+ @if $include-html-button-classes {
123
+ .dropdown.button, button.dropdown { @include dropdown-button;
124
+ &.tiny { @include dropdown-button(tiny, $base-style:false); }
125
+ &.small { @include dropdown-button(small, $base-style:false); }
126
+ &.large { @include dropdown-button(large, $base-style:false); }
127
+ &.secondary:after { border-color: $dropdown-button-pip-color-alt transparent transparent transparent; }
128
+ }
129
+ }
130
+ }
@@ -0,0 +1,269 @@
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: $white !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($white, $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: $white !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: $charcoal !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: $smoke !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
+ // Default radius for dropdown.
55
+ $f-dropdown-radius: $global-radius !default;
56
+
57
+ //
58
+ // @mixins
59
+ //
60
+ //
61
+ // NOTE: Make default max-width change between list and content types. Can add more width with classes, maybe .small, .medium, .large, etc.;
62
+ // We use this to style the dropdown container element.
63
+ // $content-list - Sets list-style. Default: list. Options: [list, content]
64
+ // $triangle - Sets if dropdown has triangle. Default:true.
65
+ // $max-width - Default: $f-dropdown-max-width || 200px.
66
+ @mixin dropdown-container($content:list, $triangle:true, $max-width:$f-dropdown-max-width) {
67
+ display: none;
68
+ left: -9999px;
69
+ list-style: $f-dropdown-list-style;
70
+ margin-#{$default-float}: 0;
71
+ position: absolute;
72
+
73
+ &.open {
74
+ display: block;
75
+ }
76
+
77
+ > *:first-child { margin-top: 0; }
78
+ > *:last-child { margin-bottom: 0; }
79
+
80
+ @if $content == list {
81
+ background: $f-dropdown-bg;
82
+ border: $f-dropdown-border-style $f-dropdown-border-width $f-dropdown-border-color;
83
+ font-size: $f-dropdown-font-size;
84
+ height: $f-dropdown-height;
85
+ max-height: $f-dropdown-max-height;
86
+ width: 100%;
87
+ z-index: 89;
88
+ }
89
+ @else if $content == content {
90
+ background: $f-dropdown-bg;
91
+ border: $f-dropdown-border-style $f-dropdown-border-width $f-dropdown-border-color;
92
+ font-size: $f-dropdown-font-size;
93
+ height: $f-dropdown-height;
94
+ max-height: $f-dropdown-max-height;
95
+ padding: $f-dropdown-content-padding;
96
+ width: 100%;
97
+ z-index: 89;
98
+ }
99
+
100
+ @if $triangle == bottom {
101
+ margin-top: $f-dropdown-margin-top;
102
+
103
+ @if $f-dropdown-triangle-size != 0px {
104
+
105
+ &:before {
106
+ @include css-triangle($f-dropdown-triangle-size, $f-dropdown-triangle-color, bottom);
107
+ position: absolute;
108
+ top: -($f-dropdown-triangle-size * 2);
109
+ #{$default-float}: $f-dropdown-triangle-side-offset;
110
+ z-index: 89;
111
+ }
112
+ &:after {
113
+ @include css-triangle($f-dropdown-triangle-size + 1, $f-dropdown-border-color, bottom);
114
+ position: absolute;
115
+ top: -(($f-dropdown-triangle-size + 1) * 2);
116
+ #{$default-float}: $f-dropdown-triangle-side-offset - 1;
117
+ z-index: 88;
118
+ }
119
+
120
+ &.right:before {
121
+ #{$default-float}: auto;
122
+ #{$opposite-direction}: $f-dropdown-triangle-side-offset;
123
+ }
124
+ &.right:after {
125
+ #{$default-float}: auto;
126
+ #{$opposite-direction}: $f-dropdown-triangle-side-offset - 1;
127
+ }
128
+ }
129
+ }
130
+
131
+ @if $triangle == $default-float {
132
+ margin-top: 0;
133
+ margin-#{$default-float}: $f-dropdown-margin-right;
134
+
135
+ &:before {
136
+ @include css-triangle($f-dropdown-triangle-size, $f-dropdown-triangle-color, #{$opposite-direction});
137
+ position: absolute;
138
+ top: $f-dropdown-triangle-side-offset;
139
+ #{$default-float}: -($f-dropdown-triangle-size * 2);
140
+ z-index: 89;
141
+ }
142
+ &:after {
143
+ @include css-triangle($f-dropdown-triangle-size + 1, $f-dropdown-border-color, #{$opposite-direction});
144
+ position: absolute;
145
+ top: $f-dropdown-triangle-side-offset - 1;
146
+ #{$default-float}: -($f-dropdown-triangle-size * 2) - 2;
147
+ z-index: 88;
148
+ }
149
+
150
+ }
151
+
152
+ @if $triangle == $opposite-direction {
153
+ margin-top: 0;
154
+ margin-#{$default-float}: -$f-dropdown-margin-right;
155
+
156
+ &:before {
157
+ @include css-triangle($f-dropdown-triangle-size, $f-dropdown-triangle-color, #{$default-float});
158
+ position: absolute;
159
+ top: $f-dropdown-triangle-side-offset;
160
+ #{$opposite-direction}: -($f-dropdown-triangle-size * 2);
161
+ #{$default-float}: auto;
162
+ z-index: 89;
163
+ }
164
+ &:after {
165
+ @include css-triangle($f-dropdown-triangle-size + 1, $f-dropdown-border-color, #{$default-float});
166
+ position: absolute;
167
+ top: $f-dropdown-triangle-side-offset - 1;
168
+ #{$opposite-direction}: -($f-dropdown-triangle-size * 2) - 2;
169
+ #{$default-float}: auto;
170
+ z-index: 88;
171
+ }
172
+
173
+ }
174
+
175
+ @if $triangle == top {
176
+ margin-left: 0;
177
+ margin-top: -$f-dropdown-margin-bottom;
178
+
179
+ &:before {
180
+ @include css-triangle($f-dropdown-triangle-size, $f-dropdown-triangle-color, top);
181
+ bottom: -($f-dropdown-triangle-size * 2);
182
+ position: absolute;
183
+ top: auto;
184
+ #{$default-float}: $f-dropdown-triangle-side-offset;
185
+ #{$opposite-direction}: auto;
186
+ z-index: 89;
187
+ }
188
+ &:after {
189
+ @include css-triangle($f-dropdown-triangle-size + 1, $f-dropdown-border-color, top);
190
+ bottom: -($f-dropdown-triangle-size * 2) - 2;
191
+ position: absolute;
192
+ top: auto;
193
+ #{$default-float}: $f-dropdown-triangle-side-offset - 1;
194
+ #{$opposite-direction}: auto;
195
+ z-index: 88;
196
+ }
197
+
198
+ }
199
+
200
+ @if $max-width { max-width: $max-width; }
201
+ @else { max-width: $f-dropdown-max-width; }
202
+
203
+ }
204
+
205
+ // @MIXIN
206
+ //
207
+ // We use this to style the list elements or content inside the dropdown.
208
+
209
+ @mixin dropdown-style {
210
+ cursor: $cursor-pointer-value;
211
+ font-size: $f-dropdown-font-size;
212
+ line-height: $f-dropdown-line-height;
213
+ margin: 0;
214
+
215
+ &:hover,
216
+ &:focus { background: $f-dropdown-list-hover-bg; }
217
+
218
+ a {
219
+ display: block;
220
+ padding: $f-dropdown-list-padding;
221
+ color: $f-dropdown-font-color;
222
+ }
223
+ }
224
+
225
+ @include exports("dropdown") {
226
+ @if $include-html-dropdown-classes {
227
+
228
+ /* Foundation Dropdowns */
229
+ .f-dropdown {
230
+ @include dropdown-container(list, bottom);
231
+
232
+ &.drop-#{$opposite-direction} {
233
+ @include dropdown-container(list, #{$default-float});
234
+ }
235
+
236
+ &.drop-#{$default-float} {
237
+ @include dropdown-container(list, #{$opposite-direction});
238
+ }
239
+
240
+ &.drop-top {
241
+ @include dropdown-container(list, top);
242
+ }
243
+ // max-width: none;
244
+
245
+ li { @include dropdown-style; }
246
+
247
+ // You can also put custom content in these dropdowns
248
+ &.content { @include dropdown-container(content, $triangle:false); }
249
+
250
+ // Radius of Dropdown
251
+ &.radius { @include radius($f-dropdown-radius); }
252
+
253
+ // Sizes
254
+ &.tiny { max-width: 200px; }
255
+ &.small { max-width: 300px; }
256
+ &.medium { max-width: 500px; }
257
+ &.large { max-width: 800px; }
258
+ &.mega {
259
+ width:100%!important;
260
+ max-width:100%!important;
261
+
262
+ &.open{
263
+ left:0!important;
264
+ }
265
+ }
266
+ }
267
+
268
+ }
269
+ }
@@ -0,0 +1,601 @@
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: $font-weight-normal !default;
20
+ $form-label-line-height: 1.5 !default;
21
+ $form-label-font-color: scale-color($black, $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-placeholder-font-color: $steel !default;
27
+ $input-font-size: rem-calc(14) !default;
28
+ $input-bg-color: $white !default;
29
+ $input-focus-bg-color: scale-color($white, $lightness: -2%) !default;
30
+ $input-border-color: scale-color($white, $lightness: -20%) !default;
31
+ $input-focus-border-color: scale-color($white, $lightness: -40%) !default;
32
+ $input-border-style: solid !default;
33
+ $input-border-width: 1px !default;
34
+ $input-border-radius: $global-radius !default;
35
+ $input-disabled-bg: $gainsboro !default;
36
+ $input-disabled-cursor: $cursor-default-value !default;
37
+ $input-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1) !default;
38
+ $input-include-glowing-effect: false !default;
39
+
40
+ // We use these to style the fieldset border and spacing.
41
+ $fieldset-border-style: solid !default;
42
+ $fieldset-border-width: 1px !default;
43
+ $fieldset-border-color: $gainsboro !default;
44
+ $fieldset-padding: rem-calc(20) !default;
45
+ $fieldset-margin: rem-calc(18 0) !default;
46
+
47
+ // We use these to style the legends when you use them
48
+ $legend-font-weight: $font-weight-bold !default;
49
+ $legend-padding: rem-calc(0 3) !default;
50
+
51
+ // We use these to style the prefix and postfix input elements
52
+ $input-prefix-bg: scale-color($white, $lightness: -5%) !default;
53
+ $input-prefix-border-color: scale-color($white, $lightness: -20%) !default;
54
+ $input-prefix-border-size: 1px !default;
55
+ $input-prefix-border-type: solid !default;
56
+ $input-prefix-overflow: visible !default;
57
+ $input-prefix-font-color: $oil !default;
58
+ $input-prefix-font-color-alt: $white !default;
59
+
60
+ // We use this setting to turn on/off HTML5 number spinners (the up/down arrows)
61
+ $input-number-spinners: true !default;
62
+
63
+ // We use these to style the error states for inputs and labels
64
+ $input-error-message-padding: rem-calc(6 9 9) !default;
65
+ $input-error-message-top: -1px !default;
66
+ $input-error-message-font-size: rem-calc(12) !default;
67
+ $input-error-message-font-weight: $font-weight-normal !default;
68
+ $input-error-message-font-style: italic !default;
69
+ $input-error-message-font-color: $white !default;
70
+ $input-error-message-bg-color: $alert-color !default;
71
+ $input-error-message-font-color-alt: $oil !default;
72
+
73
+ // We use this to style the glowing effect of inputs when focused
74
+ $glowing-effect-fade-time: .45s !default;
75
+ $glowing-effect-color: $input-focus-border-color !default;
76
+
77
+ // We use this to style the transition when inputs are focused and when the glowing effect is disabled.
78
+ $input-transition-fade-time: 0.15s !default;
79
+ $input-transition-fade-timing-function: linear !default;
80
+
81
+ // Select variables
82
+ $select-bg-color: $ghost !default;
83
+ $select-hover-bg-color: scale-color($select-bg-color, $lightness: -3%) !default;
84
+
85
+ //
86
+ // @MIXINS
87
+ //
88
+
89
+ // We use this mixin to give us form styles for rows inside of forms
90
+ @mixin form-row-base {
91
+ .row { margin: 0 ((-$form-spacing) / 2);
92
+
93
+ .column,
94
+ .columns { padding: 0 ($form-spacing / 2); }
95
+
96
+ // Use this to collapse the margins of a form row
97
+ &.collapse { margin: 0;
98
+
99
+ .column,
100
+ .columns { padding: 0; }
101
+ input {
102
+ @include side-radius($opposite-direction, 0);
103
+ }
104
+
105
+ }
106
+ }
107
+ input.column,
108
+ input.columns,
109
+ textarea.column,
110
+ textarea.columns { padding-#{$default-float}: ($form-spacing / 2); }
111
+ }
112
+
113
+ // @MIXIN
114
+ //
115
+ // We use this mixin to give all basic form elements their style
116
+ @mixin form-element {
117
+ background-color: $input-bg-color;
118
+ border: {
119
+ style: $input-border-style;
120
+ width: $input-border-width;
121
+ color: $input-border-color;
122
+ }
123
+ box-shadow: $input-box-shadow;
124
+ color: $input-font-color;
125
+ display: block;
126
+ font-family: $input-font-family;
127
+ font-size: $input-font-size;
128
+ height: ($input-font-size + ($form-spacing * 1.5) - rem-calc(1));
129
+ margin: 0 0 $form-spacing 0;
130
+ padding: $form-spacing / 2;
131
+ width: 100%;
132
+ @include box-sizing(border-box);
133
+ @if $input-include-glowing-effect {
134
+ @include block-glowing-effect(focus, $glowing-effect-fade-time, $glowing-effect-color);
135
+ }
136
+ // Basic focus styles
137
+ &:focus {
138
+ background: $input-focus-bg-color;
139
+ border-color: $input-focus-border-color;
140
+ outline: none;
141
+ }
142
+ // Disabled Styles
143
+ &:disabled {
144
+ background-color: $input-disabled-bg;
145
+ cursor: $input-disabled-cursor;
146
+ }
147
+
148
+ // Disabled background input background color
149
+ &[disabled],
150
+ &[readonly],
151
+ fieldset[disabled] & {
152
+ background-color: $input-disabled-bg;
153
+ cursor: $input-disabled-cursor;
154
+ }
155
+ }
156
+
157
+ // @MIXIN
158
+ //
159
+ // We use this mixin to create form labels
160
+ //
161
+ // $alignment - Alignment options. Default: false. Options: [right, inline, false]
162
+ // $base-style - Control whether or not the base styles come through. Default: true.
163
+ @mixin form-label($alignment:false, $base-style:true) {
164
+
165
+ // Control whether or not the base styles come through.
166
+ @if $base-style {
167
+ color: $form-label-font-color;
168
+ cursor: $form-label-pointer;
169
+ display: block;
170
+ font-size: $form-label-font-size;
171
+ font-weight: $form-label-font-weight;
172
+ line-height: $form-label-line-height;
173
+ margin-bottom: $form-label-bottom-margin;
174
+ }
175
+
176
+ // Alignment options
177
+ @if $alignment == right {
178
+ float: none !important;
179
+ text-align: right;
180
+ }
181
+ @else if $alignment == inline {
182
+ margin: 0 0 $form-spacing 0;
183
+ padding: $form-spacing / 2 + rem-calc($input-border-width) 0;
184
+ }
185
+ }
186
+
187
+ // We use this mixin to create postfix/prefix form Labels
188
+ @mixin prefix-postfix-base {
189
+ border-style: $input-prefix-border-type;
190
+ border-width: $input-prefix-border-size;
191
+ display: block;
192
+ font-size: $form-label-font-size;
193
+ height: ($input-font-size + ($form-spacing * 1.5) - rem-calc(1));
194
+ line-height: ($input-font-size + ($form-spacing * 1.5) - rem-calc(1));
195
+ overflow: $input-prefix-overflow;
196
+ padding-bottom: 0;
197
+ padding-top: 0;
198
+ position: relative;
199
+ text-align: center;
200
+ width: 100%;
201
+ z-index: 2;
202
+ }
203
+
204
+ // @MIXIN
205
+ //
206
+ // We use this mixin to create prefix label styles
207
+ // $bg - Default:$input-prefix-bg || scale-color($white, $lightness: -5%) !default;
208
+ // $is-button - Toggle position settings if prefix is a button. Default:false
209
+ //
210
+ @mixin prefix($bg:$input-prefix-bg, $border:$input-prefix-border-color, $is-button:false) {
211
+
212
+ @if $bg {
213
+ $bg-lightness: lightness($bg);
214
+ background: $bg;
215
+ border-#{$opposite-direction}: none;
216
+
217
+ // Control the font color based on background brightness
218
+ @if $bg-lightness > 70% or $bg == yellow { color: $input-prefix-font-color; }
219
+ @else { color: $input-prefix-font-color-alt; }
220
+ }
221
+
222
+ @if $border {
223
+ border-color: $border;
224
+ }
225
+
226
+ @if $is-button {
227
+ border: none;
228
+ padding-#{$default-float}: 0;
229
+ padding-#{$opposite-direction}: 0;
230
+ padding-bottom: 0;
231
+ padding-top: 0;
232
+ text-align: center;
233
+ }
234
+
235
+ }
236
+
237
+ // @MIXIN
238
+ //
239
+ // We use this mixin to create postfix label styles
240
+ // $bg - Default:$input-prefix-bg || scale-color($white, $lightness: -5%) !default;
241
+ // $is-button - Toggle position settings if prefix is a button. Default: false
242
+ @mixin postfix($bg:$input-prefix-bg, $border-left-hidden:true, $border:$input-prefix-border-color, $is-button:false) {
243
+
244
+ @if $bg {
245
+ $bg-lightness: lightness($bg);
246
+ background: $bg;
247
+ @if $border-left-hidden {
248
+ border-#{$default-float}: none;
249
+ }
250
+
251
+ // Control the font color based on background brightness
252
+ @if $bg-lightness > 70% or $bg == yellow { color: $input-prefix-font-color; }
253
+ @else { color: $input-prefix-font-color-alt; }
254
+ }
255
+
256
+ @if $border {
257
+ border-color: $border;
258
+ }
259
+
260
+ @if $is-button {
261
+ border: none;
262
+ padding-#{$default-float}: 0;
263
+ padding-#{$opposite-direction}: 0;
264
+ padding-bottom: 0;
265
+ padding-top: 0;
266
+ text-align: center;
267
+ }
268
+
269
+ }
270
+
271
+ // We use this mixin to style fieldsets
272
+ @mixin fieldset {
273
+ border: $fieldset-border-width $fieldset-border-style $fieldset-border-color;
274
+ margin: $fieldset-margin;
275
+ padding: $fieldset-padding;
276
+
277
+ // and legend styles
278
+ legend {
279
+ font-weight: $legend-font-weight;
280
+ margin: 0;
281
+ margin-#{$default-float}: rem-calc(-3);
282
+ padding: $legend-padding;
283
+ }
284
+ }
285
+
286
+ // @MIXIN
287
+ //
288
+ // We use this mixin to control border and background color of error inputs
289
+ // $color - Default: $alert-color (found in settings file)
290
+ @mixin form-error-color($color:$alert-color) {
291
+ background-color: rgba($color, .1);
292
+ border-color: $color;
293
+
294
+ // Go back to normal on focus
295
+ &:focus {
296
+ background: $input-focus-bg-color;
297
+ border-color: $input-focus-border-color;
298
+ }
299
+ }
300
+
301
+ // @MIXIN
302
+ //
303
+ // We use this simple mixin to style labels for error inputs
304
+ // $color - Default:$alert-color. Found in settings file
305
+ @mixin form-label-error-color($color:$alert-color) { color: $color; }
306
+
307
+ // @MIXIN
308
+ //
309
+ // We use this mixin to create error message styles
310
+ // $bg - Default: $alert-color (Found in settings file)
311
+ @mixin form-error-message($bg:$input-error-message-bg-color) {
312
+ display: block;
313
+ font-size: $input-error-message-font-size;
314
+ font-style: $input-error-message-font-style;
315
+ font-weight: $input-error-message-font-weight;
316
+ margin-bottom: $form-spacing;
317
+ margin-top: $input-error-message-top;
318
+ padding: $input-error-message-padding;
319
+
320
+ // We can control the text color based on the brightness of the background.
321
+ $bg-lightness: lightness($bg);
322
+ background: $bg;
323
+ @if $bg-lightness < 70% or $bg == yellow { color: $input-error-message-font-color; }
324
+ @else { color: $input-error-message-font-color-alt; }
325
+ }
326
+
327
+ // We use this mixin to style select elements
328
+ @mixin form-select {
329
+ -webkit-appearance: none !important;
330
+ -moz-appearance: none !important;
331
+ background-color: $select-bg-color;
332
+ border-radius: 0;
333
+
334
+ // Hide the dropdown arrow shown in newer IE versions
335
+ &::-ms-expand {
336
+ display: none;
337
+ }
338
+
339
+ // The custom arrow has some fake horizontal padding so we can align it
340
+ // from the right side of the element without relying on CSS3
341
+ background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMTJweCIgeT0iMHB4IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIzcHgiIHZpZXdCb3g9IjAgMCA2IDMiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDYgMyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBvbHlnb24gcG9pbnRzPSI1Ljk5MiwwIDIuOTkyLDMgLTAuMDA4LDAgIi8+PC9zdmc+');
342
+
343
+ // We can safely use leftmost and rightmost now
344
+ background-position: if($text-direction == 'rtl', 0%, 100%) center;
345
+
346
+ background-repeat: no-repeat;
347
+ border: {
348
+ style: $input-border-style;
349
+ width: $input-border-width;
350
+ color: $input-border-color;
351
+ }
352
+ color: $input-font-color;
353
+ font-family: $input-font-family;
354
+ font-size: $input-font-size;
355
+ line-height: normal;
356
+ padding: ($form-spacing / 2);
357
+ @include radius(0);
358
+ &.radius { @include radius($global-radius); }
359
+ &:focus {
360
+ background-color: $select-hover-bg-color;
361
+ border-color: $input-focus-border-color;
362
+ }
363
+ // Disabled Styles
364
+ &:disabled {
365
+ background-color: $input-disabled-bg;
366
+ cursor: $input-disabled-cursor;
367
+ }
368
+ }
369
+
370
+ // We use this mixin to turn on/off HTML5 number spinners
371
+ @mixin html5number($browser, $on: true) {
372
+ @if $on == false {
373
+ @if $browser == webkit {
374
+ -webkit-appearance: none;
375
+ margin: 0;
376
+ } @else if $browser == moz {
377
+ -moz-appearance: textfield;
378
+ }
379
+ }
380
+ }
381
+
382
+ @include exports("form") {
383
+ @if $include-html-form-classes {
384
+ /* Standard Forms */
385
+ form { margin: 0 0 $form-spacing; }
386
+
387
+ /* Using forms within rows, we need to set some defaults */
388
+ form .row { @include form-row-base; }
389
+
390
+ /* Label Styles */
391
+ label { @include form-label;
392
+ &.right { @include form-label(right, false); }
393
+ &.inline { @include form-label(inline, false); }
394
+ /* Styles for required inputs */
395
+ small {
396
+ text-transform: $form-label-small-transform;
397
+ color: scale-color($form-label-font-color, $lightness: 15%);
398
+ }
399
+ }
400
+
401
+ /* Attach elements to the beginning or end of an input */
402
+ .prefix,
403
+ .postfix { @include prefix-postfix-base; }
404
+
405
+ /* Adjust padding, alignment and radius if pre/post element is a button */
406
+ .postfix.button { @include button-size(false, false); @include postfix(false, false, false, true); }
407
+ .prefix.button { @include button-size(false, false); @include prefix(false, false, true); }
408
+
409
+ .prefix.button.radius { @include radius(0); @include side-radius($default-float, $button-radius); }
410
+ .postfix.button.radius { @include radius(0); @include side-radius($opposite-direction, $button-radius); }
411
+ .prefix.button.round { @include radius(0); @include side-radius($default-float, $button-round); }
412
+ .postfix.button.round { @include radius(0); @include side-radius($opposite-direction, $button-round); }
413
+
414
+ /* Separate prefix and postfix styles when on span or label so buttons keep their own */
415
+ span.prefix, label.prefix { @include prefix(); }
416
+ span.postfix, label.postfix { @include postfix(); }
417
+
418
+ /* We use this to get basic styling on all basic form elements */
419
+ input:not([type]), #{text-inputs(all, 'input')} {
420
+ -webkit-appearance: none;
421
+ -moz-appearance: none;
422
+ border-radius: 0;
423
+ @include form-element;
424
+ @if $input-include-glowing-effect == false {
425
+ -webkit-transition: border-color $input-transition-fade-time $input-transition-fade-timing-function, background $input-transition-fade-time $input-transition-fade-timing-function;
426
+ -moz-transition: border-color $input-transition-fade-time $input-transition-fade-timing-function, background $input-transition-fade-time $input-transition-fade-timing-function;
427
+ -ms-transition: border-color $input-transition-fade-time $input-transition-fade-timing-function, background $input-transition-fade-time $input-transition-fade-timing-function;
428
+ -o-transition: border-color $input-transition-fade-time $input-transition-fade-timing-function, background $input-transition-fade-time $input-transition-fade-timing-function;
429
+ transition: border-color $input-transition-fade-time $input-transition-fade-timing-function, background $input-transition-fade-time $input-transition-fade-timing-function;
430
+ }
431
+ &.radius {
432
+ @include radius($input-border-radius);
433
+ }
434
+ }
435
+
436
+ form {
437
+ .row {
438
+ .prefix-radius.row.collapse {
439
+ input,
440
+ textarea,
441
+ select,
442
+ button { @include radius(0); @include side-radius($opposite-direction, $button-radius); }
443
+ .prefix { @include radius(0); @include side-radius($default-float, $button-radius); }
444
+ }
445
+ .postfix-radius.row.collapse {
446
+ input,
447
+ textarea,
448
+ select,
449
+ button { @include radius(0); @include side-radius($default-float, $button-radius); }
450
+ .postfix { @include radius(0); @include side-radius($opposite-direction, $button-radius); }
451
+ }
452
+ .prefix-round.row.collapse {
453
+ input,
454
+ textarea,
455
+ select,
456
+ button { @include radius(0); @include side-radius($opposite-direction, $button-round); }
457
+ .prefix { @include radius(0); @include side-radius($default-float, $button-round); }
458
+ }
459
+ .postfix-round.row.collapse {
460
+ input,
461
+ textarea,
462
+ select,
463
+ button { @include radius(0); @include side-radius($default-float, $button-round); }
464
+ .postfix { @include radius(0); @include side-radius($opposite-direction, $button-round); }
465
+ }
466
+ }
467
+ }
468
+
469
+ input[type="submit"] {
470
+ -webkit-appearance: none;
471
+ -moz-appearance: none;
472
+ border-radius: 0;
473
+ }
474
+
475
+ /* Respect enforced amount of rows for textarea */
476
+ textarea[rows] {
477
+ height: auto;
478
+ }
479
+
480
+ /* Not allow resize out of parent */
481
+ textarea {
482
+ max-width: 100%;
483
+ }
484
+
485
+ // style placeholder text cross browser
486
+ ::-webkit-input-placeholder {
487
+ color: $input-placeholder-font-color;
488
+ }
489
+
490
+ :-moz-placeholder { /* Firefox 18- */
491
+ color: $input-placeholder-font-color;
492
+ }
493
+
494
+ ::-moz-placeholder { /* Firefox 19+ */
495
+ color: $input-placeholder-font-color;
496
+ }
497
+
498
+ :-ms-input-placeholder {
499
+ color: $input-placeholder-font-color;
500
+ }
501
+
502
+
503
+ /* Add height value for select elements to match text input height */
504
+ select {
505
+ @include form-select;
506
+ height: ($input-font-size + ($form-spacing * 1.5) - rem-calc(1));
507
+ &[multiple] {
508
+ height: auto;
509
+ }
510
+ }
511
+
512
+ /* Adjust margin for form elements below */
513
+ input[type="file"],
514
+ input[type="checkbox"],
515
+ input[type="radio"],
516
+ select {
517
+ margin: 0 0 $form-spacing 0;
518
+ }
519
+
520
+ input[type="checkbox"] + label,
521
+ input[type="radio"] + label {
522
+ display: inline-block;
523
+ margin-#{$default-float}: $form-spacing * .5;
524
+ margin-#{$opposite-direction}: $form-spacing;
525
+ margin-bottom: 0;
526
+ vertical-align: baseline;
527
+ }
528
+
529
+ /* Normalize file input width */
530
+ input[type="file"] {
531
+ width:100%;
532
+ }
533
+
534
+ /* HTML5 Number spinners settings */
535
+ input[type=number] {
536
+ @include html5number(moz, $input-number-spinners)
537
+ }
538
+ input[type="number"]::-webkit-inner-spin-button,
539
+ input[type="number"]::-webkit-outer-spin-button {
540
+ @include html5number(webkit, $input-number-spinners);
541
+ }
542
+
543
+ /* We add basic fieldset styling */
544
+ fieldset {
545
+ @include fieldset;
546
+ }
547
+
548
+ /* Error Handling */
549
+
550
+
551
+ span.error, small.error {
552
+ @include form-error-message;
553
+ }
554
+
555
+ .error {
556
+ input,
557
+ textarea,
558
+ select {
559
+ margin-bottom: 0;
560
+ }
561
+
562
+ input[type="checkbox"],
563
+ input[type="radio"] {
564
+ margin-bottom: $form-spacing
565
+ }
566
+
567
+ label,
568
+ label.error {
569
+ @include form-label-error-color;
570
+ }
571
+
572
+ small.error {
573
+ @include form-error-message;
574
+ }
575
+
576
+ > label {
577
+ > small {
578
+ background: transparent;
579
+ color: scale-color($form-label-font-color, $lightness: 15%);
580
+ display: inline;
581
+ font-size: 60%;
582
+ font-style: normal;
583
+ margin: 0;
584
+ padding: 0;
585
+ text-transform: $form-label-small-transform;
586
+ }
587
+ }
588
+
589
+ span.error-message {
590
+ display: block;
591
+ }
592
+ }
593
+
594
+ input.error,
595
+ textarea.error,
596
+ select.error {
597
+ margin-bottom: 0;
598
+ }
599
+ label.error { @include form-label-error-color; }
600
+ }
601
+ }