You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_forms.scss 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // Form validation states
  2. //
  3. // Used in _forms.scss to generate the form validation CSS for warnings, errors,
  4. // and successes.
  5. @mixin form-control-validation($color) {
  6. // Color the label and help text
  7. .text-help,
  8. .form-control-label,
  9. .radio,
  10. .checkbox,
  11. .radio-inline,
  12. .checkbox-inline,
  13. &.radio label,
  14. &.checkbox label,
  15. &.radio-inline label,
  16. &.checkbox-inline label {
  17. color: $color;
  18. }
  19. // Set the border and box shadow on specific inputs to match
  20. .form-control {
  21. border-color: $color;
  22. // @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
  23. &:focus {
  24. // border-color: darken($border-color, 10%);
  25. // $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($border-color, 20%);
  26. // @include box-shadow($shadow);
  27. }
  28. }
  29. // Set validation states also for addons
  30. .input-group-addon {
  31. color: $color;
  32. border-color: $color;
  33. background-color: lighten($color, 40%);
  34. }
  35. // Optional feedback icon
  36. .form-control-feedback {
  37. color: $color;
  38. }
  39. }
  40. // Form control focus state
  41. //
  42. // Generate a customized focus state and for any input with the specified color,
  43. // which defaults to the `@input-border-focus` variable.
  44. //
  45. // We highly encourage you to not customize the default value, but instead use
  46. // this to tweak colors on an as-needed basis. This aesthetic change is based on
  47. // WebKit's default styles, but applicable to a wider range of browsers. Its
  48. // usability and accessibility should be taken into account with any change.
  49. //
  50. // Example usage: change the default blue border and shadow to white for better
  51. // contrast against a dark gray background.
  52. @mixin form-control-focus() {
  53. &:focus {
  54. border-color: $input-border-focus;
  55. outline: none;
  56. $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px $input-box-shadow-focus;
  57. @include box-shadow($shadow);
  58. }
  59. }
  60. // Form control sizing
  61. //
  62. // Relative text size, padding, and border-radii changes for form controls. For
  63. // horizontal sizing, wrap controls in the predefined grid classes. `<select>`
  64. // element gets special love because it's special, and that's a fact!
  65. @mixin input-size($parent, $input-height, $padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
  66. #{$parent} {
  67. height: $input-height;
  68. padding: $padding-vertical $padding-horizontal;
  69. font-size: $font-size;
  70. line-height: $line-height;
  71. @include border-radius($border-radius);
  72. }
  73. select#{$parent} {
  74. height: $input-height;
  75. line-height: $input-height;
  76. }
  77. textarea#{$parent},
  78. select[multiple]#{$parent} {
  79. height: auto;
  80. }
  81. }