Skip to content

Commit 902ee2f

Browse files
committed
disabled
1 parent 8c32776 commit 902ee2f

File tree

3 files changed

+39
-6
lines changed

3 files changed

+39
-6
lines changed

demo/build.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
margin-left: -20px;
1313
border: 1px solid #cccccc;
1414
border-radius: 3px;
15+
background-color: #fff;
1516
-webkit-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
1617
transition: border 0.15s ease-in-out, color 0.15s ease-in-out; }
1718
.checkbox label:after {
@@ -30,3 +31,8 @@
3031
.checkbox input[type=checkbox]:checked + label:after {
3132
font-family: 'FontAwesome';
3233
content: "\f00c"; }
34+
.checkbox input[type=checkbox]:disabled + label {
35+
opacity: 0.65; }
36+
.checkbox input[type=checkbox]:disabled + label:before {
37+
background-color: #eeeeee;
38+
cursor: not-allowed; }

demo/index.html

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,30 @@
1111
<div class="container">
1212
<h2>Basic controls</h2>
1313
<form role="form">
14-
<div class="checkbox">
15-
<input id="checkbox1" type="checkbox">
16-
<label for="checkbox1">
17-
Check me out
18-
</label>
14+
<div class="row">
15+
<div class="col-md-4">
16+
<div class="checkbox">
17+
<input id="checkbox1" type="checkbox">
18+
<label for="checkbox1">
19+
Check me out
20+
</label>
21+
</div>
22+
</div>
23+
<div class="col-md-4">
24+
<div class="checkbox">
25+
<input id="checkbox7" type="checkbox" disabled>
26+
<label for="checkbox7">
27+
Can't check this
28+
</label>
29+
</div>
30+
<div class="checkbox">
31+
<input id="checkbox8" type="checkbox" disabled checked>
32+
<label for="checkbox8">
33+
This too
34+
</label>
35+
</div>
36+
</div>
1937
</div>
20-
<button type="submit" class="btn btn-default">Submit</button>
2138
</form>
2239
</div>
2340
</body>

font-awesome-checkbox.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
margin-left: -20px;
1515
border: 1px solid $input-border;
1616
border-radius: 3px;
17+
background-color: #fff;
1718
@include transition(border 0.15s ease-in-out, color 0.15s ease-in-out);
1819
}
1920

@@ -39,5 +40,14 @@
3940
content: $fa-var-check;
4041
}
4142

43+
&:disabled + label{
44+
opacity: 0.65;
45+
46+
&:before{
47+
background-color: $gray-lighter;
48+
cursor: not-allowed;
49+
}
50+
}
51+
4252
}
4353
}

0 commit comments

Comments
 (0)