forms.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. //
  2. // Forms
  3. // --------------------------------------------------
  4. // Force form elements to inherit font styles
  5. input,
  6. textarea,
  7. button,
  8. select {
  9. font-family: $font-family-default;
  10. font-size: $font-size-default;
  11. }
  12. // Stretch inputs/textareas to full width and add height to maintain a consistent baseline
  13. select,
  14. textarea,
  15. input[type="text"],
  16. input[type="search"],
  17. input[type="password"],
  18. input[type="datetime"],
  19. input[type="datetime-local"],
  20. input[type="date"],
  21. input[type="month"],
  22. input[type="time"],
  23. input[type="week"],
  24. input[type="number"],
  25. input[type="email"],
  26. input[type="url"],
  27. input[type="tel"],
  28. input[type="color"] {
  29. width: 100%;
  30. height: 35px;
  31. -webkit-appearance: none;
  32. padding: 0 15px;
  33. margin-bottom: 15px;
  34. line-height: $line-height-default;
  35. background-color: #fff;
  36. border: $border-default;
  37. border-radius: 3px;
  38. outline: none;
  39. }
  40. // Rounded search input
  41. input[type="search"] {
  42. padding: 0 10px;
  43. font-size: 16px;
  44. border-radius: 20px;
  45. // Override content-box in normalize
  46. -webkit-box-sizing: border-box;
  47. -moz-box-sizing: border-box;
  48. box-sizing: border-box;
  49. }
  50. input[type="search"]:focus {
  51. text-align: left;
  52. }
  53. // Allow text area's height to grow larger than a normal input
  54. textarea {
  55. height: auto;
  56. }
  57. // Style select button to look like part of the Ratchet's style
  58. select {
  59. height: auto;
  60. font-size: 14px;
  61. background-color: #f8f8f8;
  62. @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, .1));
  63. }
  64. // Input groups (cluster multiple inputs together into a single group)
  65. // -------------------------------------------------------------------
  66. // Remove spacing, borders, shadows and rounding since it all belongs on the .input-group not the input
  67. .input-group {
  68. background-color: #fff;
  69. }
  70. .input-group input,
  71. .input-group textarea {
  72. margin-bottom: 0;
  73. background-color: transparent;
  74. border-top: 0;
  75. border-right: 0;
  76. border-left: 0;
  77. border-radius: 0;
  78. @include box-shadow(none);
  79. }
  80. // Input groups with labels
  81. // --------------------------------------------------
  82. // To use labels with input groups, wrap a label and an input in an .input-row
  83. .input-row {
  84. overflow: hidden;
  85. height: 35px; // Matches the height of inputs.
  86. border-bottom: $border-default;
  87. }
  88. // Labels get floated left with a set percentage width
  89. .input-row label {
  90. float: left;
  91. width: 35%;
  92. padding: 8px 15px;
  93. font-family: $font-family-default;
  94. line-height: 1.1; // Put the text on the baseline.
  95. }
  96. // Actual inputs float to right of labels and also have a set percentage
  97. .input-row input {
  98. float: right;
  99. width: 65%;
  100. padding-left: 0;
  101. margin-bottom: 0;
  102. border: 0;
  103. }