d75fd1cb98a5d318e348f2101ad24713947d1363
[roojs1] / less / roojs-bootstrap / checkbox.less
1 /*
2  *
3  * From https://github.com/flatlogic/awesome-bootstrap-checkbox
4  *
5  */
6 .checkbox label.box-label {
7     display: inline-block;
8     position: relative;
9     padding-left: 5px;
10     -webkit-touch-callout: none;
11     -webkit-user-select: none;
12     -khtml-user-select: none;
13     -moz-user-select: none;
14     -ms-user-select: none;
15     user-select: none;
16 }
17 .checkbox label::after {
18     display: inline-block;
19     position: absolute;
20     width: 16px;
21     height: 16px;
22     left: 0;
23     top: 0;
24     margin-left: -20px;
25     padding-left: 3px;
26     padding-top: 1px;
27     font-size: 11px;
28     color: @gray;
29 }
30
31 .checkbox input[type="checkbox"] {
32     display: none;
33 }
34 .checkbox input[type="checkbox"]:checked + label::after {
35     font-size: 18px;
36     padding-top: 0px;
37     font-family: 'Font Awesome 5 Free 400';
38     font-weight: 900;
39     color: @brand-success;
40     content: "\f14a"; }
41 .checkbox input[type="checkbox"]:not(:checked) + label::after {
42     font-size: 18px;
43     padding-top: 0px;
44     font-family: 'Font Awesome 5 Free 400';
45     font-weight: 900;
46     content: "\f0c8"; }
47
48 .checkbox input[type="checkbox"]:disabled + label {
49     opacity: 0.65; }
50 .checkbox input[type="checkbox"]:disabled + label::before {
51     background-color: @gray-lighter;
52     cursor: not-allowed; }
53 .checkbox.checkbox-circle label::before {
54     border-radius: 50%; }
55
56 .checkbox-primary input[type="checkbox"]:checked + label::before {
57     background-color: @brand-primary;
58     border-color: @brand-primary; }
59 .checkbox-primary input[type="checkbox"]:checked + label::after {
60     color: @body-bg; }
61
62 .checkbox-danger input[type="checkbox"]:checked + label::before {
63     background-color: @brand-danger;
64     border-color: @brand-danger; }
65 .checkbox-danger input[type="checkbox"]:checked + label::after {
66     color: @body-bg; }
67
68 .checkbox-info input[type="checkbox"]:checked + label::before {
69     background-color: @brand-info;
70     border-color: @brand-info; }
71 .checkbox-info input[type="checkbox"]:checked + label::after {
72     color: @body-bg; }
73
74 .checkbox-warning input[type="checkbox"]:checked + label::before {
75     background-color: @brand-warning;
76     border-color: @brand-warning; }
77 .checkbox-warning input[type="checkbox"]:checked + label::after {
78     color: @body-bg; }
79
80 .checkbox-success input[type="checkbox"]:checked + label::before {
81     background-color: @brand-success;
82     border-color: @brand-success; }
83 .checkbox-success input[type="checkbox"]:checked + label::after {
84     color: @body-bg; }
85
86 /* before is the outer cicle */    
87 /* after is the inner circle.. */
88
89
90
91 .radio label {
92     display: inline-block;
93     position: relative;
94     padding-left: 5px; }
95 .radio label::before {
96     content: "";
97     display: inline-block;
98     position: absolute;
99     width: 17px;
100     height: 17px;
101     left: 0;
102     margin-left: -20px;
103     border: 1px solid @gray-light;
104     border-radius: 50%;
105     background-color: @body-bg;
106     -webkit-transition: border 0.15s ease-in-out;
107     -o-transition: border 0.15s ease-in-out;
108     transition: border 0.15s ease-in-out; }
109 .radio label::after {
110     display: inline-block;
111     position: absolute;
112     content: " ";
113     width: 11px;
114     height: 11px;
115     left: 3px;
116     top: 3px;
117     margin-left: -20px;
118     border-radius: 50%;
119     background-color: @body-bg; 
120     -webkit-transform: scale(0, 0);
121     -ms-transform: scale(0, 0);
122     -o-transform: scale(0, 0);
123     transform: scale(0, 0);
124     -webkit-transition: -webkit-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
125     -moz-transition: -moz-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
126     -o-transition: -o-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
127     transition: transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
128 }
129 .radio input[type="radio"] {
130     display: none;
131 }
132 .radio input[type="radio"]:checked + label::after {
133     -webkit-transform: scale(1, 1);
134     -ms-transform: scale(1, 1);
135     -o-transform: scale(1, 1);
136     transform: scale(1, 1);
137     background-color: @gray;
138 }
139 .radio input[type="radio"]:disabled + label {
140     opacity: 0.65; }
141 .radio input[type="radio"]:disabled + label::before {
142     cursor: not-allowed; }
143
144 .radio-primary input[type="radio"] + label::after {
145     background-color: @body-bg; }
146 .radio-primary input[type="radio"]:checked + label::before {
147     border-color: @brand-primary; }
148 .radio-primary input[type="radio"]:checked + label::after {
149     background-color: @brand-primary; }
150
151 .radio-danger input[type="radio"] + label::after {
152     background-color: @brand-danger; }
153 .radio-danger input[type="radio"]:checked + label::before {
154     border-color: @brand-danger; }
155 .radio-danger input[type="radio"]:checked + label::after {
156     background-color: @brand-danger; }
157
158
159
160 .radio-info input[type="radio"] + label::after {
161     background-color: @body-bg;
162 }
163 .radio-info input[type="radio"]:checked + label::before {
164     border-color: @brand-info; }
165 .radio-info input[type="radio"]:checked + label::after {
166     background-color: @brand-info; }
167
168 .radio-warning input[type="radio"] + label::after {
169     background-color: @body-bg; }
170 .radio-warning input[type="radio"]:checked + label::before {
171     border-color: @brand-warning; }
172 .radio-warning input[type="radio"]:checked + label::after {
173     background-color: @brand-warning; }
174
175 .radio-success input[type="radio"] + label::after {
176     background-color: @body-bg; }
177 .radio-success input[type="radio"]:checked + label::before {
178     border-color: @brand-success; }
179 .radio-success input[type="radio"]:checked + label::after {
180     background-color: @brand-success; }
181
182 .checkbox.checkbox-inline,
183 .radio.radio-inline {
184     margin-top: 0;
185 }
186
187 .form-group.checkbox {
188     padding-bottom:25px;
189     margin-top: 0;
190
191 }