ios.css 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. }
  67. /* Blue */
  68. .checkbox-ios.blue input[type=checkbox]:checked + label {
  69. border-color: #007bff;
  70. }
  71. .checkbox-ios.blue input[type=checkbox]:focus + label {
  72. box-shadow: 0 0 0 0.25rem rgb(49 132 253 / 50%);
  73. }
  74. .checkbox-ios.blue input[type=checkbox]:checked + label:before {
  75. background: #007bff;
  76. }
  77. .checkbox-ios.blue input[type=checkbox]:checked + label:after {
  78. border-color: #007bff;
  79. }
  80. /* Green */
  81. .checkbox-ios.green input[type=checkbox]:checked + label {
  82. border-color: #28a745;
  83. }
  84. .checkbox-ios.green input[type=checkbox]:focus + label {
  85. box-shadow: 0 0 0 0.25rem rgb(60 153 110 / 50%);
  86. }
  87. .checkbox-ios.green input[type=checkbox]:checked + label:before {
  88. background: #28a745;
  89. }
  90. .checkbox-ios.green input[type=checkbox]:checked + label:after {
  91. border-color: #28a745;
  92. }
  93. /* Red */
  94. .checkbox-ios.red input[type=checkbox]:checked + label {
  95. border-color: #dc3545;
  96. }
  97. .checkbox-ios.red input[type=checkbox]:focus + label {
  98. box-shadow: 0 0 0 0.25rem rgb(225 83 97 / 50%);
  99. }
  100. .checkbox-ios.red input[type=checkbox]:checked + label:before {
  101. background: #dc3545;
  102. }
  103. .checkbox-ios.red input[type=checkbox]:checked + label:after {
  104. border-color: #dc3545;
  105. }
  106. /* White */
  107. .checkbox-ios.white input[type=checkbox]:checked + label {
  108. border-color: #fff;
  109. }
  110. .checkbox-ios.white input[type=checkbox]:focus + label {
  111. box-shadow: 0 0 0 0.25rem rgb(211 212 213 / 50%);
  112. }
  113. .checkbox-ios.white input[type=checkbox]:checked + label:before {
  114. background: #fff;
  115. }
  116. .checkbox-ios.white input[type=checkbox]:checked + label:after {
  117. border-color: #fff;
  118. }