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.

310 lines
7.2 KiB

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