_forms.scss 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. .form-control {
  17. border-color: $color;
  18. }
  19. // Set validation states also for addons
  20. .input-group-addon {
  21. color: $color;
  22. border-color: $color;
  23. background-color: lighten($color, 40%);
  24. }
  25. // Optional feedback icon
  26. .form-control-feedback {
  27. color: $color;
  28. }
  29. }
  30. @mixin form-control-focus() {
  31. &:focus {
  32. border-color: $input-border-focus;
  33. outline: none;
  34. }
  35. }
  36. // Form control sizing
  37. //
  38. // Relative text size, padding, and border-radii changes for form controls. For
  39. // horizontal sizing, wrap controls in the predefined grid classes. `<select>`
  40. // element gets special love because it's special, and that's a fact!
  41. @mixin input-size($parent, $input-height, $padding-y, $padding-x, $font-size, $line-height, $border-radius) {
  42. #{$parent} {
  43. height: $input-height;
  44. padding: $padding-y $padding-x;
  45. font-size: $font-size;
  46. line-height: $line-height;
  47. @include border-radius($border-radius);
  48. }
  49. select#{$parent} {
  50. height: $input-height;
  51. line-height: $input-height;
  52. }
  53. textarea#{$parent},
  54. select[multiple]#{$parent} {
  55. height: auto;
  56. }
  57. }