ios.css 1.2 KB

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