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.

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