Skip to content

Commit 2e09fbc

Browse files
committed
transparencify inputs instead of hiding + outline of focus
1 parent 9bea273 commit 2e09fbc

File tree

6 files changed

+61
-11
lines changed

6 files changed

+61
-11
lines changed

awesome-bootstrap-checkbox.css

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.checkbox {
2+
padding-left: 20px; }
13
.checkbox label {
24
display: inline-block;
35
position: relative;
@@ -29,7 +31,11 @@
2931
font-size: 11px;
3032
color: #555555; }
3133
.checkbox input[type="checkbox"] {
32-
display: none; }
34+
opacity: 0; }
35+
.checkbox input[type="checkbox"]:focus + label::before {
36+
outline: thin dotted;
37+
outline: 5px auto -webkit-focus-ring-color;
38+
outline-offset: -2px; }
3339
.checkbox input[type="checkbox"]:checked + label::after {
3440
font-family: 'FontAwesome';
3541
content: "\f00c"; }
@@ -40,6 +46,8 @@
4046
cursor: not-allowed; }
4147
.checkbox.checkbox-circle label::before {
4248
border-radius: 50%; }
49+
.checkbox.checkbox-inline {
50+
margin-top: 0; }
4351

4452
.checkbox-primary input[type="checkbox"]:checked + label::before {
4553
background-color: #428bca;
@@ -71,6 +79,8 @@
7179
.checkbox-success input[type="checkbox"]:checked + label::after {
7280
color: #fff; }
7381

82+
.radio {
83+
padding-left: 20px; }
7484
.radio label {
7585
display: inline-block;
7686
position: relative;
@@ -109,7 +119,11 @@
109119
-o-transition: -o-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
110120
transition: transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33); }
111121
.radio input[type="radio"] {
112-
display: none; }
122+
opacity: 0; }
123+
.radio input[type="radio"]:focus + label::before {
124+
outline: thin dotted;
125+
outline: 5px auto -webkit-focus-ring-color;
126+
outline-offset: -2px; }
113127
.radio input[type="radio"]:checked + label::after {
114128
-webkit-transform: scale(1, 1);
115129
-ms-transform: scale(1, 1);
@@ -119,6 +133,8 @@
119133
opacity: 0.65; }
120134
.radio input[type="radio"]:disabled + label::before {
121135
cursor: not-allowed; }
136+
.radio.radio-inline {
137+
margin-top: 0; }
122138

123139
.radio-primary input[type="radio"] + label::after {
124140
background-color: #428bca; }

awesome-bootstrap-checkbox.less

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@
5353
}
5454

5555
input[type="checkbox"]{
56-
display: none;
56+
opacity: 0;
57+
58+
&:focus + label::before{
59+
.tab-focus();
60+
}
5761

5862
&:checked + label::after{
5963
font-family: 'FontAwesome';
@@ -149,7 +153,11 @@
149153
}
150154

151155
input[type="radio"]{
152-
display: none;
156+
opacity: 0;
157+
158+
&:focus + label::before{
159+
.tab-focus();
160+
}
153161

154162
&:checked + label::after{
155163
.scale(1, 1);

awesome-bootstrap-checkbox.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@
5353
}
5454

5555
input[type="checkbox"]{
56-
display: none;
56+
opacity: 0;
57+
58+
&:focus + label::before{
59+
@include tab-focus();
60+
}
5761

5862
&:checked + label::after{
5963
font-family: 'FontAwesome';
@@ -149,7 +153,11 @@
149153
}
150154

151155
input[type="radio"]{
152-
display: none;
156+
opacity: 0;
157+
158+
&:focus + label::before{
159+
@include tab-focus();
160+
}
153161

154162
&:checked + label::after{
155163
@include scale(1, 1);

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "awesome-bootstrap-checkbox",
33
"main": ["awesome-bootstrap-checkbox.css", "awesome-bootstrap-checkbox.scss"],
4-
"version": "0.2.2",
4+
"version": "0.2.3",
55
"homepage": "https://github.com/flatlogic/awesome-bootstrap-checkbox",
66
"authors": [
77
"okendoken flatlogic.com"

demo/build.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@
3131
font-size: 11px;
3232
color: #555555; }
3333
.checkbox input[type="checkbox"] {
34-
display: none; }
34+
opacity: 0; }
35+
.checkbox input[type="checkbox"]:focus + label::before {
36+
outline: thin dotted;
37+
outline: 5px auto -webkit-focus-ring-color;
38+
outline-offset: -2px; }
3539
.checkbox input[type="checkbox"]:checked + label::after {
3640
font-family: 'FontAwesome';
3741
content: "\f00c"; }
@@ -115,7 +119,11 @@
115119
-o-transition: -o-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
116120
transition: transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33); }
117121
.radio input[type="radio"] {
118-
display: none; }
122+
opacity: 0; }
123+
.radio input[type="radio"]:focus + label::before {
124+
outline: thin dotted;
125+
outline: 5px auto -webkit-focus-ring-color;
126+
outline-offset: -2px; }
119127
.radio input[type="radio"]:checked + label::after {
120128
-webkit-transform: scale(1, 1);
121129
-ms-transform: scale(1, 1);

demo/build.less.css

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@
3535
color: #555555;
3636
}
3737
.checkbox input[type="checkbox"] {
38-
display: none;
38+
opacity: 0;
39+
}
40+
.checkbox input[type="checkbox"]:focus + label::before {
41+
outline: thin dotted;
42+
outline: 5px auto -webkit-focus-ring-color;
43+
outline-offset: -2px;
3944
}
4045
.checkbox input[type="checkbox"]:checked + label::after {
4146
font-family: 'FontAwesome';
@@ -133,7 +138,12 @@
133138
transition: transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
134139
}
135140
.radio input[type="radio"] {
136-
display: none;
141+
opacity: 0;
142+
}
143+
.radio input[type="radio"]:focus + label::before {
144+
outline: thin dotted;
145+
outline: 5px auto -webkit-focus-ring-color;
146+
outline-offset: -2px;
137147
}
138148
.radio input[type="radio"]:checked + label::after {
139149
-webkit-transform: scale(1, 1);

0 commit comments

Comments
 (0)