awesome-bootstrap-checkbox.css 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. .checkbox {
  2. padding-left: 20px;
  3. }
  4. .checkbox label {
  5. display: inline-block;
  6. vertical-align: middle;
  7. position: relative;
  8. padding-left: 5px;
  9. }
  10. .checkbox label::before {
  11. content: "";
  12. display: inline-block;
  13. position: absolute;
  14. width: 17px;
  15. height: 17px;
  16. left: 0;
  17. margin-left: -20px;
  18. border: 1px solid #cccccc;
  19. border-radius: 3px;
  20. background-color: #fff;
  21. -webkit-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
  22. -o-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
  23. transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
  24. }
  25. .checkbox label::after {
  26. display: inline-block;
  27. position: absolute;
  28. width: 16px;
  29. height: 16px;
  30. left: 0;
  31. top: 0;
  32. margin-left: -20px;
  33. padding-left: 3px;
  34. padding-top: 1px;
  35. font-size: 11px;
  36. color: #555555;
  37. }
  38. .checkbox input[type="checkbox"],
  39. .checkbox input[type="radio"] {
  40. opacity: 0;
  41. z-index: 1;
  42. }
  43. .checkbox input[type="checkbox"]:focus + label::before,
  44. .checkbox input[type="radio"]:focus + label::before {
  45. outline: thin dotted;
  46. outline: 5px auto -webkit-focus-ring-color;
  47. outline-offset: -2px;
  48. }
  49. .checkbox input[type="checkbox"]:checked + label::after,
  50. .checkbox input[type="radio"]:checked + label::after {
  51. font-family: "FontAwesome";
  52. content: "\f00c";
  53. }
  54. .checkbox input[type="checkbox"]:disabled + label,
  55. .checkbox input[type="radio"]:disabled + label {
  56. opacity: 0.65;
  57. }
  58. .checkbox input[type="checkbox"]:disabled + label::before,
  59. .checkbox input[type="radio"]:disabled + label::before {
  60. background-color: #eeeeee;
  61. cursor: not-allowed;
  62. }
  63. .checkbox.checkbox-circle label::before {
  64. border-radius: 50%;
  65. }
  66. .checkbox.checkbox-inline {
  67. margin-top: 0;
  68. }
  69. .checkbox-primary input[type="checkbox"]:checked + label::before,
  70. .checkbox-primary input[type="radio"]:checked + label::before {
  71. background-color: #337ab7;
  72. border-color: #337ab7;
  73. }
  74. .checkbox-primary input[type="checkbox"]:checked + label::after,
  75. .checkbox-primary input[type="radio"]:checked + label::after {
  76. color: #fff;
  77. }
  78. .checkbox-danger input[type="checkbox"]:checked + label::before,
  79. .checkbox-danger input[type="radio"]:checked + label::before {
  80. background-color: #d9534f;
  81. border-color: #d9534f;
  82. }
  83. .checkbox-danger input[type="checkbox"]:checked + label::after,
  84. .checkbox-danger input[type="radio"]:checked + label::after {
  85. color: #fff;
  86. }
  87. .checkbox-info input[type="checkbox"]:checked + label::before,
  88. .checkbox-info input[type="radio"]:checked + label::before {
  89. background-color: #5bc0de;
  90. border-color: #5bc0de;
  91. }
  92. .checkbox-info input[type="checkbox"]:checked + label::after,
  93. .checkbox-info input[type="radio"]:checked + label::after {
  94. color: #fff;
  95. }
  96. .checkbox-warning input[type="checkbox"]:checked + label::before,
  97. .checkbox-warning input[type="radio"]:checked + label::before {
  98. background-color: #f0ad4e;
  99. border-color: #f0ad4e;
  100. }
  101. .checkbox-warning input[type="checkbox"]:checked + label::after,
  102. .checkbox-warning input[type="radio"]:checked + label::after {
  103. color: #fff;
  104. }
  105. .checkbox-success input[type="checkbox"]:checked + label::before,
  106. .checkbox-success input[type="radio"]:checked + label::before {
  107. background-color: #5cb85c;
  108. border-color: #5cb85c;
  109. }
  110. .checkbox-success input[type="checkbox"]:checked + label::after,
  111. .checkbox-success input[type="radio"]:checked + label::after {
  112. color: #fff;
  113. }
  114. .radio {
  115. padding-left: 20px;
  116. }
  117. .radio label {
  118. display: inline-block;
  119. vertical-align: middle;
  120. position: relative;
  121. padding-left: 5px;
  122. }
  123. .radio label::before {
  124. content: "";
  125. display: inline-block;
  126. position: absolute;
  127. width: 17px;
  128. height: 17px;
  129. left: 0;
  130. margin-left: -20px;
  131. border: 1px solid #cccccc;
  132. border-radius: 50%;
  133. background-color: #fff;
  134. -webkit-transition: border 0.15s ease-in-out;
  135. -o-transition: border 0.15s ease-in-out;
  136. transition: border 0.15s ease-in-out;
  137. }
  138. .radio label::after {
  139. display: inline-block;
  140. position: absolute;
  141. content: " ";
  142. width: 11px;
  143. height: 11px;
  144. left: 3px;
  145. top: 3px;
  146. margin-left: -20px;
  147. border-radius: 50%;
  148. background-color: #555555;
  149. -webkit-transform: scale(0, 0);
  150. -ms-transform: scale(0, 0);
  151. -o-transform: scale(0, 0);
  152. transform: scale(0, 0);
  153. -webkit-transition: -webkit-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
  154. -moz-transition: -moz-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
  155. -o-transition: -o-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
  156. transition: transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
  157. }
  158. .radio input[type="radio"] {
  159. opacity: 0;
  160. z-index: 1;
  161. }
  162. .radio input[type="radio"]:focus + label::before {
  163. outline: thin dotted;
  164. outline: 5px auto -webkit-focus-ring-color;
  165. outline-offset: -2px;
  166. }
  167. .radio input[type="radio"]:checked + label::after {
  168. -webkit-transform: scale(1, 1);
  169. -ms-transform: scale(1, 1);
  170. -o-transform: scale(1, 1);
  171. transform: scale(1, 1);
  172. }
  173. .radio input[type="radio"]:disabled + label {
  174. opacity: 0.65;
  175. }
  176. .radio input[type="radio"]:disabled + label::before {
  177. cursor: not-allowed;
  178. }
  179. .radio.radio-inline {
  180. margin-top: 0;
  181. }
  182. .radio-primary input[type="radio"] + label::after {
  183. background-color: #337ab7;
  184. }
  185. .radio-primary input[type="radio"]:checked + label::before {
  186. border-color: #337ab7;
  187. }
  188. .radio-primary input[type="radio"]:checked + label::after {
  189. background-color: #337ab7;
  190. }
  191. .radio-danger input[type="radio"] + label::after {
  192. background-color: #d9534f;
  193. }
  194. .radio-danger input[type="radio"]:checked + label::before {
  195. border-color: #d9534f;
  196. }
  197. .radio-danger input[type="radio"]:checked + label::after {
  198. background-color: #d9534f;
  199. }
  200. .radio-info input[type="radio"] + label::after {
  201. background-color: #5bc0de;
  202. }
  203. .radio-info input[type="radio"]:checked + label::before {
  204. border-color: #5bc0de;
  205. }
  206. .radio-info input[type="radio"]:checked + label::after {
  207. background-color: #5bc0de;
  208. }
  209. .radio-warning input[type="radio"] + label::after {
  210. background-color: #f0ad4e;
  211. }
  212. .radio-warning input[type="radio"]:checked + label::before {
  213. border-color: #f0ad4e;
  214. }
  215. .radio-warning input[type="radio"]:checked + label::after {
  216. background-color: #f0ad4e;
  217. }
  218. .radio-success input[type="radio"] + label::after {
  219. background-color: #5cb85c;
  220. }
  221. .radio-success input[type="radio"]:checked + label::before {
  222. border-color: #5cb85c;
  223. }
  224. .radio-success input[type="radio"]:checked + label::after {
  225. background-color: #5cb85c;
  226. }
  227. input[type="checkbox"].styled:checked + label:after,
  228. input[type="radio"].styled:checked + label:after {
  229. font-family: 'FontAwesome';
  230. content: "\f00c";
  231. }
  232. input[type="checkbox"] .styled:checked + label::before,
  233. input[type="radio"] .styled:checked + label::before {
  234. color: #fff;
  235. }
  236. input[type="checkbox"] .styled:checked + label::after,
  237. input[type="radio"] .styled:checked + label::after {
  238. color: #fff;
  239. }