radiocheck.less 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. //
  2. // Checkbox & Radio
  3. // --------------------------------------------------
  4. .checkbox,
  5. .radio {
  6. margin-bottom: 12px;
  7. padding-left: 32px;
  8. position: relative;
  9. transition: color .25s linear;
  10. font-size: ceil((@component-font-size-base * 0.933)); // ~14px
  11. line-height: 1.5; // 21px;
  12. .icons {
  13. color: @gray-light;
  14. display: block;
  15. height: 20px;
  16. top: 0;
  17. left: 0;
  18. position: absolute;
  19. width: 20px;
  20. text-align: center;
  21. line-height: 20px;
  22. font-size: 20px;
  23. cursor: pointer;
  24. .icon-checked {
  25. .opacity(0);
  26. }
  27. }
  28. }
  29. .checkbox,
  30. .radio {
  31. .icon-checked,
  32. .icon-unchecked {
  33. display: inline-table;
  34. position: absolute;
  35. left: 0;
  36. top: 0;
  37. background-color: transparent;
  38. margin: 0;
  39. opacity: 1;
  40. filter: none;
  41. transition: color .25s linear;
  42. &:before {
  43. font-family: 'Flat-UI-Icons';
  44. speak: none;
  45. font-style: normal;
  46. font-weight: normal;
  47. font-variant: normal;
  48. text-transform: none;
  49. -webkit-font-smoothing: antialiased;
  50. -moz-osx-font-smoothing: grayscale;
  51. }
  52. }
  53. }
  54. .checkbox {
  55. .icon-checked:before {
  56. content: "\e60e";
  57. }
  58. .icon-unchecked:before {
  59. content: "\e60d";
  60. }
  61. }
  62. .radio {
  63. .icon-checked:before {
  64. content: "\e60c";
  65. }
  66. .icon-unchecked:before {
  67. content: "\e60b";
  68. }
  69. }
  70. .checkbox,
  71. .radio {
  72. input[type="checkbox"].custom-checkbox,
  73. input[type="radio"].custom-radio {
  74. outline: none !important;
  75. opacity: 0;
  76. position: absolute;
  77. margin: 0;
  78. padding: 0;
  79. left: 0;
  80. top: 0;
  81. width: 20px;
  82. height: 20px;
  83. // Alternate States
  84. // --------------------------------------------------
  85. &:hover:not(.nohover):not(:disabled) + .icons {
  86. .icon-unchecked {
  87. .opacity(0);
  88. }
  89. .icon-checked {
  90. opacity: 1;
  91. filter: none;
  92. }
  93. }
  94. &:checked + .icons {
  95. color: @brand-secondary;
  96. .icon-unchecked {
  97. .opacity(0);
  98. }
  99. .icon-checked {
  100. opacity: 1;
  101. filter: none;
  102. color: @brand-secondary;
  103. }
  104. }
  105. &:disabled + .icons {
  106. cursor: default;
  107. color: mix(@gray-light, white, 38%);
  108. .icon-unchecked {
  109. opacity: 1;
  110. filter: none;
  111. }
  112. .icon-checked {
  113. .opacity(0);
  114. }
  115. }
  116. &:disabled:checked + .icons {
  117. color: mix(@gray-light, white, 38%);
  118. .icon-unchecked {
  119. .opacity(0);
  120. }
  121. .icon-checked {
  122. opacity: 1;
  123. filter: none;
  124. color: mix(@gray-light, white, 38%);
  125. }
  126. }
  127. &:indeterminate + .icons {
  128. color: @gray-light;
  129. .icon-unchecked {
  130. opacity: 1;
  131. filter: none;
  132. }
  133. .icon-checked {
  134. .opacity(0);
  135. }
  136. &:before {
  137. content: "\2013";
  138. position: absolute;
  139. top: 0;
  140. left: 0;
  141. line-height: 20px;
  142. width: 20px;
  143. text-align: center;
  144. color: @inverse;
  145. font-size: 22px;
  146. z-index: 10;
  147. }
  148. }
  149. }
  150. // Alternate Color
  151. // --------------------------------------------------
  152. // Primary
  153. &.primary input[type="checkbox"].custom-checkbox,
  154. &.primary input[type="radio"].custom-radio {
  155. & + .icons {
  156. color: @brand-primary;
  157. }
  158. // Checked State
  159. &:checked + .icons {
  160. color: @brand-secondary;
  161. }
  162. // Disabled state
  163. &:disabled + .icons {
  164. cursor: default;
  165. color: @gray-light;
  166. &.checked {
  167. color: @gray-light;
  168. }
  169. }
  170. &:indeterminate + .icons {
  171. color: @brand-primary;
  172. }
  173. }
  174. }
  175. // Group Addon
  176. .radio,
  177. .checkbox {
  178. .input-group-addon & {
  179. margin: -2px 0;
  180. padding-left: 20px;
  181. .icons {
  182. color: mix(@gray-light, white, 38%);
  183. }
  184. input[type="checkbox"].custom-checkbox,
  185. input[type="radio"].custom-radio {
  186. &:checked + .icons {
  187. color: @inverse;
  188. .icon-checked {
  189. color: @inverse;
  190. }
  191. }
  192. &:disabled + .icons {
  193. color: fade(mix(@gray-light, white, 38%), 60%);
  194. }
  195. &:disabled:checked + .icons {
  196. color: fade(mix(@gray-light, white, 38%), 60%);
  197. .icon-checked {
  198. color: fade(mix(@gray-light, white, 38%), 60%);
  199. }
  200. }
  201. }
  202. }
  203. }
  204. .radio + .radio,
  205. .checkbox + .checkbox {
  206. margin-top: 10px;
  207. }
  208. // Form inline style
  209. .form-inline .checkbox, .form-inline .radio {
  210. padding-left: 32px;
  211. }