Skip to content

Commit 80b7fe5

Browse files
committed
Add small visual cue when label is active
Resolves #51.
1 parent 31fcf41 commit 80b7fe5

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
* [#49]: Add the ability to specify `disabled` to individual nodes
88
* [#50]: Allow `node.label` to be any valid React node
99

10+
### Usability
11+
12+
* [#51]: Apply additional background color when a node is active
13+
1014
## [v0.6.4](https://github.com/jakezatecky/react-checkbox-tree/compare/v0.6.3...v0.6.4) (2017-07-22)
1115

1216
### Bug Fixes

src/less/react-checkbox-tree.less

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@rct-icon-color: #33c;
22
@rct-label-hover: rgba(red(@rct-icon-color), green(@rct-icon-color), blue(@rct-icon-color), .1);
3+
@rct-label-active: rgba(red(@rct-icon-color), green(@rct-icon-color), blue(@rct-icon-color), .15);
34

45
.react-checkbox-tree {
56
font-size: 16px;
@@ -34,6 +35,10 @@
3435
&:hover {
3536
background: @rct-label-hover;
3637
}
38+
39+
&:active {
40+
background: @rct-label-active;
41+
}
3742
}
3843

3944
input {
@@ -54,12 +59,16 @@
5459
&:hover {
5560
background: transparent;
5661
}
62+
63+
&:active {
64+
background: transparent;
65+
}
5766
}
5867
}
5968

6069
.rct-collapse,
61-
.rct-node-icon,
62-
.rct-checkbox {
70+
.rct-checkbox,
71+
.rct-node-icon {
6372
padding: 0 5px;
6473

6574
* {

src/scss/react-checkbox-tree.scss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
$rct-icon-color: #33c !default;
22
$rct-label-hover: rgba($rct-icon-color, .1) !default;
3+
$rct-label-active: rgba($rct-icon-color, .15) !default;
34

45
.react-checkbox-tree {
56
font-size: 16px;
@@ -34,6 +35,10 @@ $rct-label-hover: rgba($rct-icon-color, .1) !default;
3435
&:hover {
3536
background: $rct-label-hover;
3637
}
38+
39+
&:active {
40+
background: $rct-label-active;
41+
}
3742
}
3843

3944
input {
@@ -54,12 +59,16 @@ $rct-label-hover: rgba($rct-icon-color, .1) !default;
5459
&:hover {
5560
background: transparent;
5661
}
62+
63+
&:active {
64+
background: transparent;
65+
}
5766
}
5867
}
5968

6069
.rct-collapse,
61-
.rct-node-icon,
62-
.rct-checkbox {
70+
.rct-checkbox,
71+
.rct-node-icon {
6372
padding: 0 5px;
6473

6574
* {

0 commit comments

Comments
 (0)