_forms.scss 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. @mixin form-control-validation($color) {
  2. // Color the label and help text
  3. .text-help,
  4. .form-control-label,
  5. .radio,
  6. .checkbox,
  7. .radio-inline,
  8. .checkbox-inline,
  9. &.radio label,
  10. &.checkbox label,
  11. &.radio-inline label,
  12. &.checkbox-inline label,
  13. .custom-control {
  14. color: $color;
  15. }
  16. // Set the border and box shadow on specific inputs to match
  17. .form-control {
  18. border-color: $color;
  19. // @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
  20. &:focus {
  21. // border-color: darken($border-color, 10%);
  22. // $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($border-color, 20%);
  23. // @include box-shadow($shadow);
  24. }
  25. }
  26. // Set validation states also for addons
  27. .input-group-addon {
  28. color: $color;
  29. border-color: $color;
  30. background-color: lighten($color, 40%);
  31. }
  32. // Optional feedback icon
  33. .form-control-feedback {
  34. color: $color;
  35. }
  36. }
  37. @mixin form-control-focus() {
  38. &:focus {
  39. border-color: $input-border-focus;
  40. outline: none;
  41. $shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
  42. 0 0 5px $input-box-shadow-focus;
  43. @include box-shadow($shadow);
  44. }
  45. }
  46. // Form control sizing
  47. //
  48. // Relative text size, padding, and border-radii changes for form controls. For
  49. // horizontal sizing, wrap controls in the predefined grid classes. `<select>`
  50. // element gets special love because it's special, and that's a fact!
  51. @mixin input-size($parent, $input-height, $padding-y, $padding-x, $font-size, $line-height, $border-radius) {
  52. #{$parent} {
  53. height: $input-height;
  54. padding: $padding-y $padding-x;
  55. font-size: $font-size;
  56. line-height: $line-height;
  57. @include border-radius($border-radius);
  58. }
  59. select#{$parent} {
  60. height: $input-height;
  61. line-height: $input-height;
  62. }
  63. textarea#{$parent},
  64. select[multiple]#{$parent} {
  65. height: auto;
  66. }
  67. }