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.

480 lines
8.8 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. vertical-align: middle;
  23. }
  24. .ui.checkbox input {
  25. position: absolute;
  26. top: 0px;
  27. right: 0px;
  28. opacity: 0;
  29. outline: none;
  30. }
  31. /*--- Box ---*/
  32. .ui.checkbox .box,
  33. .ui.checkbox label {
  34. cursor: pointer;
  35. position: relative;
  36. min-width: 1em;
  37. height: 1em;
  38. padding-right: 2em;
  39. outline: none;
  40. white-space: nowrap;
  41. }
  42. .ui.checkbox .box:before,
  43. .ui.checkbox label:before {
  44. position: absolute;
  45. top: 0.25em;
  46. right: 0em;
  47. line-height: 1;
  48. width: 1em;
  49. height: 1em;
  50. right: 0em;
  51. content: '';
  52. border-radius: 4px;
  53. background: #FFFFFF;
  54. -webkit-transition:
  55. background-color 0.3s ease,
  56. box-shadow 0.3s ease
  57. ;
  58. -moz-transition:
  59. background-color 0.3s ease,
  60. box-shadow 0.3s ease
  61. ;
  62. -o-transition:
  63. background-color 0.3s ease,
  64. box-shadow 0.3s ease
  65. ;
  66. -ms-transition:
  67. background-color 0.3s ease,
  68. box-shadow 0.3s ease
  69. ;
  70. transition:
  71. background-color 0.3s ease,
  72. box-shadow 0.3s ease
  73. ;
  74. -webkit-box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.2);
  75. -moz-box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.2);
  76. box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.2);
  77. }
  78. /*--- Checkbox ---*/
  79. .ui.checkbox .box:after,
  80. .ui.checkbox label:after {
  81. -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  82. filter: alpha(opacity=0);
  83. opacity: 0;
  84. content: '';
  85. position: absolute;
  86. background: transparent;
  87. border: 0.2em solid #333333;
  88. border-top: none;
  89. border-left: none;
  90. -webkit-transform: rotate(-45deg);
  91. -moz-transform: rotate(-45deg);
  92. -o-transform: rotate(-45deg);
  93. -ms-transform: rotate(-45deg);
  94. transform: rotate(-45deg);
  95. }
  96. .ui.checkbox .box:after,
  97. .ui.checkbox label:after {
  98. top: 0.54em;
  99. right: 0.2em;
  100. width: 0.45em;
  101. height: 0.15em;
  102. }
  103. /*--- Inside Label ---*/
  104. .ui.checkbox label {
  105. color: rgba(0, 0, 0, 0.6);
  106. -webkit-transition: color 0.2s ease;
  107. -moz-transition: color 0.2s ease;
  108. -o-transition: color 0.2s ease;
  109. -ms-transition: color 0.2s ease;
  110. transition: color 0.2s ease;
  111. }
  112. .ui.checkbox label:hover {
  113. color: rgba(0, 0, 0, 0.8);
  114. }
  115. .ui.checkbox input:focus + label {
  116. color: rgba(0, 0, 0, 0.8);
  117. }
  118. /*--- Outside Label ---*/
  119. .ui.checkbox + label {
  120. cursor: pointer;
  121. opacity: 0.85;
  122. vertical-align: middle;
  123. }
  124. .ui.checkbox + label:hover {
  125. opacity: 1;
  126. }
  127. /*******************************
  128. States
  129. *******************************/
  130. /*--- Hover ---*/
  131. .ui.checkbox .box:hover::before,
  132. .ui.checkbox label:hover::before {
  133. -webkit-box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.3);
  134. -moz-box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.3);
  135. box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.3);
  136. }
  137. /*--- Down ---*/
  138. .ui.checkbox .box:active::before,
  139. .ui.checkbox label:active::before {
  140. background-color: #F5F5F5;
  141. }
  142. /*--- Focus ---*/
  143. .ui.checkbox input:focus + .box:before,
  144. .ui.checkbox input:focus + label:before {
  145. -webkit-box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.3);
  146. -moz-box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.3);
  147. box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.3);
  148. }
  149. /*--- Active ---*/
  150. .ui.checkbox input:checked + .box:after,
  151. .ui.checkbox input:checked + label:after {
  152. -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
  153. filter: alpha(opacity=100);
  154. opacity: 1;
  155. }
  156. /*--- Disabled ---*/
  157. .ui.disabled.checkbox + .box:after,
  158. .ui.checkbox input[disabled] + .box:after,
  159. .ui.disabled.checkbox label,
  160. .ui.checkbox input[disabled] + label {
  161. opacity: 0.4;
  162. color: rgba(0, 0, 0, 0.3);
  163. }
  164. /*******************************
  165. Variations
  166. *******************************/
  167. /*--------------
  168. Radio
  169. ---------------*/
  170. .ui.radio.checkbox .box:before,
  171. .ui.radio.checkbox label:before {
  172. width: 1em;
  173. height: 1em;
  174. -webkit-border-radius: 500px;
  175. -moz-border-radius: 500px;
  176. border-radius: 500px;
  177. }
  178. .ui.radio.checkbox .box:after,
  179. .ui.radio.checkbox label:after {
  180. border: none;
  181. top: 0.45em;
  182. right: 0.2em;
  183. width: 0.6em;
  184. height: 0.6em;
  185. background-color: #555555;
  186. -webkit-border-radius: 500px;
  187. -moz-border-radius: 500px;
  188. border-radius: 500px;
  189. }
  190. /*--------------
  191. Slider
  192. ---------------*/
  193. .ui.slider.checkbox {
  194. cursor: pointer;
  195. min-width: 3em;
  196. height: 2em;
  197. }
  198. /* Line */
  199. .ui.slider.checkbox:after {
  200. position: absolute;
  201. top: 0.8em;
  202. right: 0em;
  203. content: '';
  204. width: 3em;
  205. height: 2px;
  206. background-color: rgba(0, 0, 0, 0.1);
  207. }
  208. /* Button */
  209. .ui.slider.checkbox .box,
  210. .ui.slider.checkbox label {
  211. padding-right: 4em;
  212. }
  213. .ui.slider.checkbox .box:before,
  214. .ui.slider.checkbox label:before {
  215. cursor: pointer;
  216. display: block;
  217. position: absolute;
  218. top: 0em;
  219. right: 0;
  220. z-index: 1;
  221. width: 1.5em;
  222. height: 1.5em;
  223. -webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  224. -moz-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  225. box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  226. border-radius: 50rem;
  227. -webkit-transition: right 0.3s ease 0s;
  228. -moz-transition: right 0.3s ease 0s;
  229. -o-transition: right 0.3s ease 0s;
  230. -ms-transition: right 0.3s ease 0s;
  231. transition: right 0.3s ease 0s;
  232. }
  233. /* Button Activation Light */
  234. .ui.slider.checkbox .box:after,
  235. .ui.slider.checkbox label:after {
  236. opacity: 1;
  237. position: absolute;
  238. content: '';
  239. top: 0.375em;
  240. right: 0em;
  241. z-index: 2;
  242. margin-right: 0.375em;
  243. border: none;
  244. width: 0.75em;
  245. height: 0.75em;
  246. border-radius: 50rem;
  247. -webkit-transition:
  248. background 0.3s ease 0s,
  249. right 0.3s ease 0s
  250. ;
  251. -moz-transition:
  252. background 0.3s ease 0s,
  253. right 0.3s ease 0s
  254. ;
  255. -o-transition:
  256. background 0.3s ease 0s,
  257. right 0.3s ease 0s
  258. ;
  259. -ms-transition:
  260. background 0.3s ease 0s,
  261. right 0.3s ease 0s
  262. ;
  263. transition:
  264. background 0.3s ease 0s,
  265. right 0.3s ease 0s
  266. ;
  267. }
  268. /* Selected Slider Toggle */
  269. .ui.slider.checkbox input:checked + .box:before,
  270. .ui.slider.checkbox input:checked + label:before,
  271. .ui.slider.checkbox input:checked + .box:after,
  272. .ui.slider.checkbox input:checked + label:after {
  273. right: 1.75em;
  274. }
  275. /* Off Color */
  276. // .ui.slider.checkbox .box,
  277. // .ui.slider.checkbox label {
  278. // color: #D95C5C !important;
  279. // }
  280. .ui.slider.checkbox .box:after,
  281. .ui.slider.checkbox label:after {
  282. background-color: #D95C5C;
  283. }
  284. /* On Color */
  285. // .ui.slider.checkbox input:checked + .box,
  286. // .ui.slider.checkbox input:checked + label {
  287. // color: #89B84C !important;
  288. // }
  289. .ui.slider.checkbox input:checked + .box:after,
  290. .ui.slider.checkbox input:checked + label:after {
  291. background-color: #89B84C;
  292. }
  293. /*--------------
  294. Toggle
  295. ---------------*/
  296. .ui.toggle.checkbox {
  297. cursor: pointer;
  298. height: 2em;
  299. }
  300. .ui.toggle.checkbox .box,
  301. .ui.toggle.checkbox label {
  302. padding-right: 4em;
  303. }
  304. /* Switch */
  305. .ui.toggle.checkbox .box:before,
  306. .ui.toggle.checkbox label:before {
  307. cursor: pointer;
  308. display: block;
  309. position: absolute;
  310. content: '';
  311. top: 0em;
  312. right: 0em;
  313. z-index: 1;
  314. background-color: #FFFFFF;
  315. width: 3em;
  316. height: 1.5em;
  317. -webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  318. -moz-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  319. box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  320. border-radius: 50rem;
  321. }
  322. /* Activation Light */
  323. .ui.toggle.checkbox .box:after,
  324. .ui.toggle.checkbox label:after {
  325. opacity: 1;
  326. background-color: transparent;
  327. -webkit-box-shadow: none;
  328. -moz-box-shadow: none;
  329. box-shadow: none;
  330. content: '';
  331. position: absolute;
  332. top: 0.35em;
  333. right: 0.5em;
  334. z-index: 2;
  335. border: none;
  336. width: 0.75em;
  337. height: 0.75em;
  338. background-color: #D95C5C;
  339. border-radius: 50rem;
  340. -webkit-transition:
  341. background 0.3s ease 0s,
  342. right 0.3s ease 0s
  343. ;
  344. -moz-transition:
  345. background 0.3s ease 0s,
  346. right 0.3s ease 0s
  347. ;
  348. -o-transition:
  349. background 0.3s ease 0s,
  350. right 0.3s ease 0s
  351. ;
  352. -ms-transition:
  353. background 0.3s ease 0s,
  354. right 0.3s ease 0s
  355. ;
  356. transition:
  357. background 0.3s ease 0s,
  358. right 0.3s ease 0s
  359. ;
  360. }
  361. /* Active */
  362. .ui.toggle.checkbox:active .box:before,
  363. .ui.toggle.checkbox:active label:before {
  364. background-color: #F5F5F5;
  365. }
  366. /* Active */
  367. .ui.toggle.checkbox input:checked + .box:after,
  368. .ui.toggle.checkbox input:checked + label:after {
  369. right: 1.75em;
  370. background-color: #89B84C;
  371. }
  372. /*--------------
  373. Sizes
  374. ---------------*/
  375. .ui.checkbox {
  376. width: 1em;
  377. height: 1em;
  378. }
  379. .ui.checkbox,
  380. .ui.checkbox .box,
  381. .ui.checkbox label {
  382. font-size: 1em;
  383. }
  384. .ui.large.checkbox {
  385. width: 1.25em;
  386. height: 1.25em;
  387. }
  388. .ui.large.checkbox,
  389. .ui.large.checkbox .box,
  390. .ui.large.checkbox label {
  391. font-size: 1.25em;
  392. }
  393. .ui.huge.checkbox {
  394. width: 1.5em;
  395. height: 1.5em;
  396. }
  397. .ui.huge.checkbox,
  398. .ui.huge.checkbox .box,
  399. .ui.huge.checkbox label {
  400. font-size: 1.5em;
  401. }