ios.css 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. .checkbox-ios {
  2. display: inline-block;
  3. height: 20px;
  4. vertical-align: middle;
  5. width: 35px;
  6. }
  7. .checkbox-ios input[type=checkbox] {
  8. max-height: 0;
  9. max-width: 0;
  10. opacity: 0;
  11. position: absolute;
  12. }
  13. .checkbox-ios input[type=checkbox] + label {
  14. border-radius: 24px;
  15. border: 2px solid #212529;
  16. cursor: pointer;
  17. display: block;
  18. height: 20px;
  19. margin-bottom: 0;
  20. margin-top: 0;
  21. position: relative;
  22. text-indent: -5000px;
  23. width: 35px;
  24. }
  25. .checkbox-ios input[type=checkbox] + label:before {
  26. background: #212529;
  27. border-radius: 24px;
  28. content: "";
  29. display: block;
  30. height: 12px;
  31. left: 2px;
  32. position: absolute;
  33. top: 2px;
  34. transition: .1s ease-in-out;
  35. width: 12px;
  36. }
  37. .checkbox-ios input[type=checkbox]:checked + label {
  38. border-color: #212529;
  39. }
  40. .checkbox-ios input[type=checkbox]:focus + label {
  41. box-shadow: 0 0 0 0.25rem rgb(13 110 253 / 25%);
  42. outline: 0;
  43. }
  44. .checkbox-ios input[type=checkbox]:checked + label:before {
  45. background: #212529;
  46. left: 17px;
  47. }
  48. .checkbox-ios input[type=checkbox] + label:after {
  49. border-color: #212529;
  50. border-style: solid;
  51. border-width: 0px 0px 2px 2px;
  52. content: "";
  53. display: block;
  54. height: 5px;
  55. left: 6px;
  56. opacity: 0;
  57. position: absolute;
  58. top: 7px;
  59. transform: translate3d(-50%, -50%, 0px) rotate(-45deg);
  60. transition: .1s ease-in-out;
  61. width: 7px;
  62. }
  63. .checkbox-ios input[type=checkbox]:checked + label:after {
  64. border-color: #212529;
  65. opacity: 1;
  66. }