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.

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