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.

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