No Description
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.

_custom-toggle.scss 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // Custom toggle
  3. //
  4. .custom-toggle {
  5. position: relative;
  6. display: inline-block;
  7. width: $custom-toggle-width;
  8. height: 1.5rem;
  9. input {
  10. display: none;
  11. &:checked {
  12. + .custom-toggle-slider {
  13. border: $custom-control-indicator-border-width solid $custom-control-indicator-checked-border-color;
  14. &:before {
  15. background: $custom-toggle-checked-bg;
  16. transform: translateX(1.625rem);
  17. }
  18. }
  19. }
  20. &:disabled {
  21. + .custom-toggle-slider {
  22. border: $custom-control-indicator-border-width solid $custom-control-indicator-disabled-bg;
  23. }
  24. &:checked {
  25. + .custom-toggle-slider {
  26. border: $custom-control-indicator-border-width solid $custom-control-indicator-disabled-bg;
  27. &:before {
  28. background-color: lighten($custom-control-indicator-checked-bg, 10%);
  29. }
  30. }
  31. }
  32. }
  33. }
  34. }
  35. .custom-toggle-slider {
  36. position: absolute;
  37. cursor: pointer;
  38. top: 0;
  39. left: 0;
  40. right: 0;
  41. bottom: 0;
  42. border: $custom-control-indicator-border-width solid $input-border-color;
  43. border-radius: 34px !important;
  44. background-color: transparent;
  45. &:before {
  46. position: absolute;
  47. content: "";
  48. height: 18px;
  49. width: 18px;
  50. left: 2px;
  51. bottom: 2px;
  52. border-radius: 50% !important;
  53. background-color: $custom-toggle-slider-bg;
  54. transition: $input-transition;
  55. }
  56. }