_form.sass 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. // *************************************
  2. //
  3. // Form
  4. // -> Fields, selects, & such
  5. //
  6. // -------------------------------------
  7. // Template (Haml)
  8. // -------------------------------------
  9. //
  10. // %form.form
  11. // %fieldset.form-field
  12. // %label.form-label(for="email") Email
  13. // %input.form-input(type="email" id="email")
  14. //
  15. // *************************************
  16. // -------------------------------------
  17. // Variables
  18. // -------------------------------------
  19. // ----- Colors ----- //
  20. $form-input-background: #fff !default
  21. $form-input-borderColor: #ddd !default
  22. $form-input-focus-borderColor: #4e4e5b !default
  23. // ----- Borders ----- //
  24. $form-borderRadius: 2px !default
  25. $form-input-border: 2px solid $form-input-borderColor !default
  26. // ----- Typography ----- //
  27. $form-fontSize-m: 90% !default
  28. // ----- Sizing ----- //
  29. $form-space: 1.25em !default
  30. $form-space-xs: 0.2 * $form-space !default
  31. $form-space-s: 0.5 * $form-space !default
  32. // -------------------------------------
  33. // Base
  34. // -------------------------------------
  35. .form
  36. margin-bottom: $form-space
  37. // -------------------------------------
  38. // Modifiers
  39. // -------------------------------------
  40. // ----- Condensed ----- //
  41. .form--condensed
  42. .form-field
  43. margin-bottom: $form-space-s
  44. .form-input-search
  45. margin-right: $b-space
  46. background: #2C3438
  47. border-radius: $b-borderRadius
  48. border: none
  49. display: inline-block
  50. float: right
  51. padding: $form-space-xs
  52. // -------------------------------------
  53. // Scaffolding
  54. // -------------------------------------
  55. // ----- Field ----- //
  56. .form-field
  57. border: 0
  58. margin-bottom: $form-space
  59. padding: 0
  60. // Inline
  61. .form-field--inline
  62. .form-btn
  63. display: block
  64. line-height: 2.9
  65. min-width: 100%
  66. // ----- Input ----- //
  67. .form-input
  68. background: $form-input-background
  69. border: $form-input-border
  70. box-sizing: border-box
  71. font-size: 100%
  72. padding: $form-space-s
  73. position: relative
  74. transition: border-color 0.2s ease-in-out
  75. width: 100%
  76. &:focus
  77. border-color: $form-input-focus-borderColor
  78. outline: none
  79. // ----- Label ----- //
  80. .form-label
  81. display: block
  82. font-size: $form-fontSize-m
  83. font-weight: bold
  84. margin-bottom: $form-space-xs
  85. // ----- Select ----- //
  86. .form-select
  87. min-width: 12.5em // ~200px