ios.css 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. .checkbox-ios {
  2. box-sizing: border-box;
  3. display: inline-block;
  4. height: 20px;
  5. vertical-align: middle;
  6. width: 35px;
  7. }
  8. .checkbox-ios input[type=checkbox] {
  9. box-sizing: border-box;
  10. max-height: 0;
  11. max-width: 0;
  12. opacity: 0;
  13. position: absolute;
  14. }
  15. .checkbox-ios input[type=checkbox] + label {
  16. border-radius: 24px;
  17. border: 2px solid #212529;
  18. box-sizing: border-box;
  19. cursor: pointer;
  20. display: block;
  21. height: 20px;
  22. margin-bottom: 0;
  23. margin-top: 0;
  24. position: relative;
  25. text-indent: -5000px;
  26. width: 35px;
  27. }
  28. .checkbox-ios input[type=checkbox] + label:before {
  29. background: #212529;
  30. border-radius: 24px;
  31. box-sizing: border-box;
  32. content: "";
  33. display: block;
  34. height: 12px;
  35. left: 2px;
  36. position: absolute;
  37. top: 2px;
  38. transition: .1s ease-in-out;
  39. width: 12px;
  40. }
  41. .checkbox-ios input[type=checkbox]:checked + label {
  42. border-color: #212529;
  43. box-sizing: border-box;
  44. }
  45. .checkbox-ios input[type=checkbox]:checked + label:before {
  46. background: #212529;
  47. box-sizing: border-box;
  48. left: 17px;
  49. }
  50. .checkbox-ios input[type=checkbox] + label:after {
  51. border-color: #212529;
  52. border-style: solid;
  53. border-width: 0px 0px 2px 2px;
  54. box-sizing: border-box;
  55. content: "";
  56. display: block;
  57. height: 5px;
  58. left: 6px;
  59. opacity: 0;
  60. position: absolute;
  61. top: 7px;
  62. transform: translate3d(-50%, -50%, 0px) rotate(-45deg);
  63. transition: .1s ease-in-out;
  64. width: 7px;
  65. }
  66. .checkbox-ios input[type=checkbox]:checked + label:after {
  67. border-color: #212529;
  68. box-sizing: border-box;
  69. opacity: 1;
  70. }
  71. /* Blue */
  72. .checkbox-ios.blue input[type=checkbox]:checked + label {
  73. border-color: #007bff;
  74. }
  75. .checkbox-ios.blue input[type=checkbox]:checked + label:before {
  76. background: #007bff;
  77. }
  78. .checkbox-ios.blue input[type=checkbox]:checked + label:after {
  79. border-color: #007bff;
  80. }
  81. /* Green */
  82. .checkbox-ios.green input[type=checkbox]:checked + label {
  83. border-color: #28a745;
  84. }
  85. .checkbox-ios.green input[type=checkbox]:checked + label:before {
  86. background: #28a745;
  87. }
  88. .checkbox-ios.green input[type=checkbox]:checked + label:after {
  89. border-color: #28a745;
  90. }
  91. /* Red */
  92. .checkbox-ios.red input[type=checkbox]:checked + label {
  93. border-color: #dc3545;
  94. }
  95. .checkbox-ios.red input[type=checkbox]:checked + label:before {
  96. background: #dc3545;
  97. }
  98. .checkbox-ios.red input[type=checkbox]:checked + label:after {
  99. border-color: #dc3545;
  100. }
  101. /* White */
  102. .checkbox-ios.white input[type=checkbox]:checked + label {
  103. border-color: #fff;
  104. }
  105. .checkbox-ios.white input[type=checkbox]:checked + label:before {
  106. background: #fff;
  107. }
  108. .checkbox-ios.white input[type=checkbox]:checked + label:after {
  109. border-color: #fff;
  110. }