123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- //
- // Checkbox & Radio
- // --------------------------------------------------
- .checkbox,
- .radio {
- margin-bottom: 12px;
- padding-left: 32px;
- position: relative;
- transition: color .25s linear;
- font-size: ceil((@component-font-size-base * 0.933)); // ~14px
- line-height: 1.5; // 21px;
- .icons {
- color: @gray-light;
- display: block;
- height: 20px;
- top: 0;
- left: 0;
- position: absolute;
- width: 20px;
- text-align: center;
- line-height: 20px;
- font-size: 20px;
- cursor: pointer;
- .icon-checked {
- .opacity(0);
- }
- }
- }
- .checkbox,
- .radio {
- .icon-checked,
- .icon-unchecked {
- display: inline-table;
- position: absolute;
- left: 0;
- top: 0;
- background-color: transparent;
- margin: 0;
- opacity: 1;
- filter: none;
- transition: color .25s linear;
- &:before {
- font-family: 'Flat-UI-Icons';
- speak: none;
- font-style: normal;
- font-weight: normal;
- font-variant: normal;
- text-transform: none;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- }
- }
- }
- .checkbox {
- .icon-checked:before {
- content: "\e60e";
- }
- .icon-unchecked:before {
- content: "\e60d";
- }
- }
- .radio {
- .icon-checked:before {
- content: "\e60c";
- }
- .icon-unchecked:before {
- content: "\e60b";
- }
- }
- .checkbox,
- .radio {
- input[type="checkbox"].custom-checkbox,
- input[type="radio"].custom-radio {
- outline: none !important;
- opacity: 0;
- position: absolute;
- margin: 0;
- padding: 0;
- left: 0;
- top: 0;
- width: 20px;
- height: 20px;
- // Alternate States
- // --------------------------------------------------
- &:hover:not(.nohover):not(:disabled) + .icons {
- .icon-unchecked {
- .opacity(0);
- }
- .icon-checked {
- opacity: 1;
- filter: none;
- }
- }
- &:checked + .icons {
- color: @brand-secondary;
- .icon-unchecked {
- .opacity(0);
- }
- .icon-checked {
- opacity: 1;
- filter: none;
- color: @brand-secondary;
- }
- }
- &:disabled + .icons {
- cursor: default;
- color: mix(@gray-light, white, 38%);
- .icon-unchecked {
- opacity: 1;
- filter: none;
- }
- .icon-checked {
- .opacity(0);
- }
- }
- &:disabled:checked + .icons {
- color: mix(@gray-light, white, 38%);
- .icon-unchecked {
- .opacity(0);
- }
- .icon-checked {
- opacity: 1;
- filter: none;
- color: mix(@gray-light, white, 38%);
- }
- }
- &:indeterminate + .icons {
- color: @gray-light;
- .icon-unchecked {
- opacity: 1;
- filter: none;
- }
- .icon-checked {
- .opacity(0);
- }
- &:before {
- content: "\2013";
- position: absolute;
- top: 0;
- left: 0;
- line-height: 20px;
- width: 20px;
- text-align: center;
- color: @inverse;
- font-size: 22px;
- z-index: 10;
- }
- }
- }
- // Alternate Color
- // --------------------------------------------------
- // Primary
- &.primary input[type="checkbox"].custom-checkbox,
- &.primary input[type="radio"].custom-radio {
- & + .icons {
- color: @brand-primary;
- }
- // Checked State
- &:checked + .icons {
- color: @brand-secondary;
- }
- // Disabled state
- &:disabled + .icons {
- cursor: default;
- color: @gray-light;
- &.checked {
- color: @gray-light;
- }
- }
- &:indeterminate + .icons {
- color: @brand-primary;
- }
- }
- }
- // Group Addon
- .radio,
- .checkbox {
- .input-group-addon & {
- margin: -2px 0;
- padding-left: 20px;
- .icons {
- color: mix(@gray-light, white, 38%);
- }
- input[type="checkbox"].custom-checkbox,
- input[type="radio"].custom-radio {
- &:checked + .icons {
- color: @inverse;
- .icon-checked {
- color: @inverse;
- }
- }
- &:disabled + .icons {
- color: fade(mix(@gray-light, white, 38%), 60%);
- }
- &:disabled:checked + .icons {
- color: fade(mix(@gray-light, white, 38%), 60%);
- .icon-checked {
- color: fade(mix(@gray-light, white, 38%), 60%);
- }
- }
- }
- }
- }
- .radio + .radio,
- .checkbox + .checkbox {
- margin-top: 10px;
- }
- // Form inline style
- .form-inline .checkbox, .form-inline .radio {
- padding-left: 32px;
- }
|