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.

338 lines
7.7 KiB

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