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.

383 lines
7.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. 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. left: 0em;
  46. line-height: 1;
  47. width: 1em;
  48. height: 1em;
  49. left: 0em;
  50. content: '';
  51. border-radius: 4px;
  52. background: #FFFFFF;
  53. -webkit-transition: background-color 0.3s ease,
  54. -webkit-box-shadow 0.3s ease;
  55. transition: background-color 0.3s ease,
  56. box-shadow 0.3s ease;
  57. -webkit-box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.2);
  58. box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.2);
  59. }
  60. /*--- Checkbox ---*/
  61. .ui.checkbox .box:after,
  62. .ui.checkbox label:after {
  63. -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  64. filter: alpha(opacity=0);
  65. opacity: 0;
  66. content: '';
  67. position: absolute;
  68. background: transparent;
  69. border: 0.2em solid #333333;
  70. border-top: none;
  71. border-right: none;
  72. -webkit-transform: rotate(-45deg);
  73. -ms-transform: rotate(-45deg);
  74. transform: rotate(-45deg);
  75. }
  76. .ui.checkbox .box:after,
  77. .ui.checkbox label:after {
  78. top: 0.275em;
  79. left: 0.2em;
  80. width: 0.45em;
  81. height: 0.15em;
  82. }
  83. /*--- Inside Label ---*/
  84. .ui.checkbox label {
  85. color: rgba(0, 0, 0, 0.6);
  86. -webkit-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. -ms-transform: none;
  152. transform: none;
  153. }
  154. .ui.radio.checkbox .box:after,
  155. .ui.radio.checkbox label:after {
  156. border: none;
  157. top: 0.2em;
  158. left: 0.2em;
  159. width: 0.6em;
  160. height: 0.6em;
  161. background-color: #555555;
  162. -webkit-transform: none;
  163. -ms-transform: none;
  164. transform: none;
  165. border-radius: 500px;
  166. }
  167. /*--------------
  168. Slider
  169. ---------------*/
  170. .ui.slider.checkbox {
  171. cursor: pointer;
  172. min-width: 3em;
  173. }
  174. /* Line */
  175. .ui.slider.checkbox:after {
  176. position: absolute;
  177. top: 0.5em;
  178. left: 0em;
  179. content: '';
  180. width: 3em;
  181. height: 2px;
  182. background-color: rgba(0, 0, 0, 0.1);
  183. }
  184. /* Button */
  185. .ui.slider.checkbox .box,
  186. .ui.slider.checkbox label {
  187. padding-left: 4em;
  188. }
  189. .ui.slider.checkbox .box:before,
  190. .ui.slider.checkbox label:before {
  191. cursor: pointer;
  192. display: block;
  193. position: absolute;
  194. top: -0.25em;
  195. left: 0em;
  196. z-index: 1;
  197. width: 1.5em;
  198. height: 1.5em;
  199. -webkit-transform: none;
  200. -ms-transform: none;
  201. transform: none;
  202. -webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  203. box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  204. border-radius: 50rem;
  205. -webkit-transition: left 0.3s ease 0s;
  206. transition: left 0.3s ease 0s;
  207. }
  208. /* Button Activation Light */
  209. .ui.slider.checkbox .box:after,
  210. .ui.slider.checkbox label:after {
  211. opacity: 1;
  212. position: absolute;
  213. content: '';
  214. top: 0.15em;
  215. left: 0em;
  216. z-index: 2;
  217. margin-left: 0.375em;
  218. border: none;
  219. width: 0.75em;
  220. height: 0.75em;
  221. border-radius: 50rem;
  222. -webkit-transform: none;
  223. -ms-transform: none;
  224. transform: none;
  225. -webkit-transition: background 0.3s ease 0s,
  226. left 0.3s ease 0s;
  227. transition: background 0.3s ease 0s,
  228. left 0.3s ease 0s;
  229. }
  230. /* Selected Slider Toggle */
  231. .ui.slider.checkbox input:checked + .box:before,
  232. .ui.slider.checkbox input:checked + label:before,
  233. .ui.slider.checkbox input:checked + .box:after,
  234. .ui.slider.checkbox input:checked + label:after {
  235. left: 1.75em;
  236. }
  237. /* Off Color */
  238. .ui.slider.checkbox .box:after,
  239. .ui.slider.checkbox label:after {
  240. background-color: #D95C5C;
  241. }
  242. /* On Color */
  243. .ui.slider.checkbox input:checked + .box:after,
  244. .ui.slider.checkbox input:checked + label:after {
  245. background-color: #89B84C;
  246. }
  247. /*--------------
  248. Toggle
  249. ---------------*/
  250. .ui.toggle.checkbox {
  251. cursor: pointer;
  252. }
  253. .ui.toggle.checkbox .box,
  254. .ui.toggle.checkbox label {
  255. padding-left: 4em;
  256. }
  257. /* Switch */
  258. .ui.toggle.checkbox .box:before,
  259. .ui.toggle.checkbox label:before {
  260. cursor: pointer;
  261. display: block;
  262. position: absolute;
  263. content: '';
  264. top: -0.25em;
  265. left: 0em;
  266. z-index: 1;
  267. background-color: #FFFFFF;
  268. width: 3em;
  269. height: 1.5em;
  270. -webkit-transform: none;
  271. -ms-transform: none;
  272. transform: none;
  273. -webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  274. box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) inset;
  275. border-radius: 50rem;
  276. }
  277. /* Activation Light */
  278. .ui.toggle.checkbox .box:after,
  279. .ui.toggle.checkbox label:after {
  280. opacity: 1;
  281. background-color: transparent;
  282. -webkit-box-shadow: none;
  283. box-shadow: none;
  284. content: '';
  285. position: absolute;
  286. top: 0.15em;
  287. left: 0.5em;
  288. z-index: 2;
  289. border: none;
  290. width: 0.75em;
  291. height: 0.75em;
  292. background-color: #D95C5C;
  293. border-radius: 50rem;
  294. -webkit-transition: background 0.3s ease 0s,
  295. left 0.3s ease 0s;
  296. transition: background 0.3s ease 0s,
  297. left 0.3s ease 0s;
  298. }
  299. /* Active */
  300. .ui.toggle.checkbox:active .box:before,
  301. .ui.toggle.checkbox:active label:before {
  302. background-color: #F5F5F5;
  303. }
  304. /* Active */
  305. .ui.toggle.checkbox input:checked + .box:after,
  306. .ui.toggle.checkbox input:checked + label:after {
  307. left: 1.75em;
  308. background-color: #89B84C;
  309. }
  310. /*--------------
  311. Sizes
  312. ---------------*/
  313. .ui.checkbox {
  314. font-size: 1em;
  315. }
  316. .ui.large.checkbox {
  317. font-size: 1.25em;
  318. }
  319. .ui.huge.checkbox {
  320. font-size: 1.5em;
  321. }