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.

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