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.

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