You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

390 lines
7.3 KiB

  1. /*
  2. * # Semantic - Checkbox
  3. * http://github.com/jlukic/semantic-ui/
  4. *
  5. *
  6. * Copyright 2013 Contributors
  7. * Released under the MIT license
  8. * http://opensource.org/licenses/MIT
  9. *
  10. */
  11. /*******************************
  12. Checkbox
  13. *******************************/
  14. /*--------------
  15. Standard
  16. ---------------*/
  17. /*--- Content ---*/
  18. .ui.checkbox {
  19. position: relative;
  20. display: inline-block;
  21. outline: none;
  22. margin-left: 0.5em;
  23. vertical-align: middle;
  24. }
  25. .ui.checkbox input {
  26. opacity: 0;
  27. outline: none;
  28. }
  29. /*--- Box ---*/
  30. .ui.checkbox .box,
  31. .ui.checkbox label {
  32. outline: none;
  33. cursor: pointer;
  34. position: absolute;
  35. line-height: 1;
  36. width: 1em;
  37. height: 1em;
  38. bottom: 0em;
  39. right: 0em;
  40. border-radius: 4px;
  41. -webkit-box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.2);
  42. -moz-box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.2);
  43. box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.2);
  44. background: #FFFFFF;
  45. -webkit-transition:
  46. background-color 0.1s ease-out,
  47. box-shadow 0.1s ease-out
  48. ;
  49. -moz-transition:
  50. background-color 0.1s ease-out,
  51. box-shadow 0.1s ease-out
  52. ;
  53. -o-transition:
  54. background-color 0.1s ease-out,
  55. box-shadow 0.1s ease-out
  56. ;
  57. -ms-transition:
  58. background-color 0.1s ease-out,
  59. box-shadow 0.1s ease-out
  60. ;
  61. transition:
  62. background-color 0.1s ease-out,
  63. box-shadow 0.1s ease-out
  64. ;
  65. }
  66. /*--- Checkbox ---*/
  67. .ui.checkbox .box:after,
  68. .ui.checkbox label:after {
  69. -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  70. filter: alpha(opacity=0);
  71. opacity: 0;
  72. content: '';
  73. position: absolute;
  74. background: transparent;
  75. border: 0.2em solid #333333;
  76. border-top: none;
  77. border-left: none;
  78. -webkit-transform: rotate(-45deg);
  79. -moz-transform: rotate(-45deg);
  80. -o-transform: rotate(-45deg);
  81. -ms-transform: rotate(-45deg);
  82. transform: rotate(-45deg);
  83. }
  84. .ui.checkbox .box:after,
  85. .ui.checkbox label:after {
  86. top: 0.3em;
  87. right: 0.2em;
  88. width: 0.45em;
  89. height: 0.15em;
  90. }
  91. /*--- Label ---*/
  92. .ui.checkbox + label {
  93. cursor: pointer;
  94. opacity: 0.85;
  95. vertical-align: middle;
  96. }
  97. .ui.checkbox + label:hover {
  98. opacity: 1;
  99. }
  100. /*******************************
  101. States
  102. *******************************/
  103. /*--- Hover ---*/
  104. .ui.checkbox .box:hover,
  105. .ui.checkbox label:hover {
  106. background-color: #FAFAFA;
  107. -webkit-box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.3);
  108. -moz-box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.3);
  109. box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.3);
  110. }
  111. /*--- Down ---*/
  112. .ui.checkbox .box:active,
  113. .ui.checkbox label:active {
  114. background-color: #F5F5F5;
  115. }
  116. /*--- Active ---*/
  117. .ui.checkbox input:checked + .box:after,
  118. .ui.checkbox input:checked + label:after {
  119. -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
  120. filter: alpha(opacity=100);
  121. opacity: 1;
  122. }
  123. /*--- Disabled ---*/
  124. .ui.disabled.checkbox + .box:after,
  125. .ui.checkbox input[disabled] + .box:after,
  126. .ui.disabled.checkbox label,
  127. .ui.checkbox input[disabled] + label {
  128. opacity: 0.4;
  129. }
  130. /*******************************
  131. Variations
  132. *******************************/
  133. /*--------------
  134. Radio
  135. ---------------*/
  136. .ui.radio.checkbox {
  137. width: 14px;
  138. height: 16px;
  139. }
  140. .ui.radio.checkbox .box,
  141. .ui.radio.checkbox label {
  142. width: 14px;
  143. height: 14px;
  144. -webkit-border-radius: 500px;
  145. -moz-border-radius: 500px;
  146. border-radius: 500px;
  147. }
  148. .ui.radio.checkbox .box:after,
  149. .ui.radio.checkbox label:after {
  150. top: 3px;
  151. right: 3px;
  152. border: none;
  153. width: 8px;
  154. height: 8px;
  155. background-color: #555555;
  156. -webkit-border-radius: 500px;
  157. -moz-border-radius: 500px;
  158. border-radius: 500px;
  159. }
  160. /*--------------
  161. Slider
  162. ---------------*/
  163. .ui.slider.checkbox {
  164. cursor: pointer;
  165. width: 3em;
  166. height: 2em;
  167. }
  168. /* Line */
  169. .ui.slider.checkbox:after {
  170. position: absolute;
  171. top: 1em;
  172. right: 0em;
  173. content: '';
  174. width: 100%;
  175. height: 2px;
  176. background-color: rgba(0, 0, 0, 0.1);
  177. }
  178. /* Button */
  179. .ui.slider.checkbox .box,
  180. .ui.slider.checkbox label {
  181. cursor: pointer;
  182. display: block;
  183. position: absolute;
  184. top: 0.25em;
  185. right: 0;
  186. z-index: 1;
  187. width: 1.5em;
  188. height: 1.5em;
  189. -webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  190. -moz-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  191. box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  192. border-radius: 50rem;
  193. -webkit-transition: right 0.3s ease 0s;
  194. -moz-transition: right 0.3s ease 0s;
  195. -o-transition: right 0.3s ease 0s;
  196. -ms-transition: right 0.3s ease 0s;
  197. transition: right 0.3s ease 0s;
  198. }
  199. /* Button Activation Light */
  200. .ui.slider.checkbox .box:after,
  201. .ui.slider.checkbox label:after {
  202. opacity: 1;
  203. position: absolute;
  204. content: '';
  205. top: 0.375em;
  206. right: 0.375em;
  207. border: none;
  208. width: 0.75em;
  209. height: 0.75em;
  210. background-color: #D95C5C;
  211. border-radius: 50rem;
  212. -webkit-transition: background 0.3s ease 0s;
  213. -moz-transition: background 0.3s ease 0s;
  214. -o-transition: background 0.3s ease 0s;
  215. -ms-transition: background 0.3s ease 0s;
  216. transition: background 0.3s ease 0s;
  217. }
  218. /* Active Slider Toggle */
  219. .ui.slider.checkbox input:checked + .box,
  220. .ui.slider.checkbox input:checked + label {
  221. right: 1.75em;
  222. }
  223. .ui.slider.checkbox input:checked + .box:after,
  224. .ui.slider.checkbox input:checked + label:after {
  225. background-color: #89B84C;
  226. }
  227. /*--------------
  228. Toggle
  229. ---------------*/
  230. .ui.toggle.checkbox {
  231. cursor: pointer;
  232. width: 3em;
  233. height: 2em;
  234. }
  235. /* Line */
  236. .ui.toggle.checkbox:after {
  237. cursor: pointer;
  238. display: block;
  239. position: absolute;
  240. content: '';
  241. top: 0.25em;
  242. right: 0em;
  243. z-index: 1;
  244. background-color: #FFFFFF;
  245. width: 100%;
  246. height: 1.5em;
  247. -webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  248. -moz-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  249. box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  250. border-radius: 50rem;
  251. }
  252. .ui.toggle.checkbox .box,
  253. .ui.toggle.checkbox label {
  254. position: absolute;
  255. top: 0.65em;
  256. right: 0.5em;
  257. -webkit-transition: right 0.3s ease 0s;
  258. -moz-transition: right 0.3s ease 0s;
  259. -o-transition: right 0.3s ease 0s;
  260. -ms-transition: right 0.3s ease 0s;
  261. transition: right 0.3s ease 0s;
  262. background-color: transparent;
  263. -webkit-box-shadow: none;
  264. -moz-box-shadow: none;
  265. box-shadow: none;
  266. }
  267. /* Button Activation Light */
  268. .ui.toggle.checkbox .box:after,
  269. .ui.toggle.checkbox label:after {
  270. opacity: 1;
  271. content: '';
  272. position: absolute;
  273. top: 0px;
  274. right: 0px;
  275. z-index: 2;
  276. border: none;
  277. width: 0.75em;
  278. height: 0.75em;
  279. background-color: #D95C5C;
  280. border-radius: 50rem;
  281. -webkit-transition: background 0.3s ease 0s;
  282. -moz-transition: background 0.3s ease 0s;
  283. -o-transition: background 0.3s ease 0s;
  284. -ms-transition: background 0.3s ease 0s;
  285. transition: background 0.3s ease 0s;
  286. }
  287. /* Active toggle Toggle */
  288. .ui.toggle.checkbox input:checked + .box,
  289. .ui.toggle.checkbox input:checked + label {
  290. right: 1.75em;
  291. }
  292. .ui.toggle.checkbox input:checked + .box:after,
  293. .ui.toggle.checkbox input:checked + label:after {
  294. background-color: #89B84C;
  295. }
  296. /*--------------
  297. Sizes
  298. ---------------*/
  299. .ui.checkbox {
  300. width: 1em;
  301. height: 1em;
  302. }
  303. .ui.checkbox,
  304. .ui.checkbox .box,
  305. .ui.checkbox label {
  306. font-size: 1em;
  307. }
  308. .ui.large.checkbox {
  309. width: 1.25em;
  310. height: 1.25em;
  311. }
  312. .ui.large.checkbox,
  313. .ui.large.checkbox .box,
  314. .ui.large.checkbox label {
  315. font-size: 1.25em;
  316. }
  317. .ui.huge.checkbox {
  318. width: 1.5em;
  319. height: 1.5em;
  320. }
  321. .ui.huge.checkbox,
  322. .ui.huge.checkbox .box,
  323. .ui.huge.checkbox label {
  324. font-size: 1.5em;
  325. }