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.

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