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.

337 lines
7.5 KiB

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