_switch.scss 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. $switch-border-radius: 1rem;
  2. $switch-width: 3.5rem;
  3. $switch-height: 1.5rem;
  4. /* ============================================================
  5. SWITCH 3 - YES NO
  6. ============================================================ */
  7. .gf-form-switch {
  8. position: relative;
  9. max-width: 4.5rem;
  10. flex-grow: 1;
  11. min-width: 4.0rem;
  12. input {
  13. position: absolute;
  14. margin-left: -9999px;
  15. visibility: hidden;
  16. display: none;
  17. }
  18. input + label {
  19. display: block;
  20. position: relative;
  21. cursor: pointer;
  22. outline: none;
  23. user-select: none;
  24. width: 100%;
  25. height: 2.65rem;
  26. background-color: $page-bg;
  27. }
  28. input + label:before, input + label:after {
  29. display: block;
  30. position: absolute;
  31. top: 0;
  32. left: 0;
  33. bottom: 0;
  34. right: 0;
  35. color: #fff;
  36. font-size: $font-size-sm;
  37. text-align: center;
  38. line-height: 2.8rem;
  39. font-size: 150%;
  40. }
  41. input + label:before {
  42. @include buttonBackground($input-bg, lighten($input-bg, 5%));
  43. //content: attr(data-off);
  44. font-family: 'FontAwesome';
  45. //content: "\f00c";
  46. //content: "\f096"; // square-o
  47. content: "\f046"; // check-square-o
  48. color: darken($text-color-weak, 17%);
  49. transition: transform 0.4s;
  50. backface-visibility: hidden;
  51. text-shadow: 0px 0px 5px rgb(45, 45, 45);
  52. }
  53. input + label:after {
  54. @include buttonBackground($input-bg, lighten($input-bg, 5%));
  55. //@include buttonBackground($btn-secondary-bg, $btn-secondary-bg-hl);
  56. //content: attr(data-on);
  57. //content: "\f00c";
  58. content: "\f046"; // check-square-o
  59. color: #FF8600;
  60. text-shadow: 0px 0px 5px rgb(45, 45, 45);
  61. font-family: 'FontAwesome';
  62. transition: transform 0.4s;
  63. transform: rotateY(180deg);
  64. backface-visibility: hidden;
  65. }
  66. input:checked + label:before {
  67. transform: rotateY(180deg);
  68. }
  69. input:checked + label:after {
  70. transform: rotateY(0);
  71. }
  72. }