Skip to content

Commit

Permalink
feat: add :focus and :active styles for clickable items
Browse files Browse the repository at this point in the history
  • Loading branch information
apust committed Dec 2, 2020
1 parent 1fac50a commit 20c9f33
Show file tree
Hide file tree
Showing 12 changed files with 176 additions and 4 deletions.
22 changes: 20 additions & 2 deletions src/packages/core/src/action/action.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,28 @@

&:hover {
& ._e_action__icon svg {
fill: var(--B400);
fill: var(--B500);
}
& ._e_action__text {
color: var(--B400);
color: var(--B500);
}
}

&:focus {
& ._e_action__icon svg {
fill: var(--B500);
}
& ._e_action__text {
color: var(--B500);
}
}

&:active {
& ._e_action__icon svg {
fill: var(--B600);
}
& ._e_action__text {
color: var(--B600);
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions src/packages/core/src/banner/banner.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
&:hover {
background-color: var(--R600);
}
&:focus {
background-color: var(--R600);
}
&:active {
background-color: var(--R700);
}
}
}

Expand All @@ -24,6 +30,12 @@
&:hover {
background-color: var(--O600);
}
&:focus {
background-color: var(--O600);
}
&:active {
background-color: var(--O700);
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/packages/core/src/breadcrumbs/breadcrumbs.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
&:hover {
color: var(--B500);
}
&:focus {
color: var(--B500);
}
&:active {
color: var(--B600);
}

&::after {
content: '/';
Expand Down
24 changes: 24 additions & 0 deletions src/packages/core/src/button/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
&:hover {
background-color: var(--B50);
}

&:focus {
background-color: var(--B50);
}

&:active {
background-color: var(--B100);
}
}

._e_button_appearance_primary {
Expand All @@ -21,6 +29,14 @@
&:hover {
background-color: var(--B500);
}

&:focus {
background-color: var(--B500);
}

&:active {
background-color: var(--B600);
}
}

._e_button_appearance_danger {
Expand All @@ -30,6 +46,14 @@
&:hover {
background-color: var(--R600);
}

&:focus {
background-color: var(--R600);
}

&:active {
background-color: var(--R700);
}
}

._e_button_size_small {
Expand Down
16 changes: 16 additions & 0 deletions src/packages/core/src/chip/chip.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
&:hover {
background-color: var(--N100);
}

&:focus {
background-color: var(--N100);
}

&:active {
background-color: var(--B50);
}
}

._e_chip_selected {
Expand All @@ -19,6 +27,14 @@
background-color: var(--B100);
}

&:focus {
background-color: var(--B100);
}

&:active {
background-color: var(--N10);
}

& ._e_chip__check {
display: block;
}
Expand Down
8 changes: 8 additions & 0 deletions src/packages/core/src/link/link.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,12 @@
&:hover {
color: var(--B500);
}

&:focus {
color: var(--B500);
}

&:active {
color: var(--B600);
}
}
8 changes: 8 additions & 0 deletions src/packages/core/src/menu/menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@
&:hover {
background-color: var(--N50);
}

&:focus {
background-color: var(--N50);
}

&:active {
background-color: var(--N100);
}
}
10 changes: 10 additions & 0 deletions src/packages/core/src/snackbar/snackbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,14 @@
background-color: var(--N700);
color: var(--N0);
}

&:focus {
background-color: var(--N700);
color: var(--N0);
}

&:active {
background-color: var(--N600);
color: var(--N0);
}
}
8 changes: 8 additions & 0 deletions src/packages/core/src/tabs/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
&:hover {
background-color: var(--N10);
}

&:focus {
background-color: var(--N10);
}

&:active {
background-color: var(--N50);
}
}

._e_tabs__item_selected {
Expand Down
18 changes: 18 additions & 0 deletions src/packages/core/src/upload/upload.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@
border-color: var(--B400);
background-color: var(--B50);
}

&:focus {
border-color: var(--B400);
background-color: var(--B50);
}

&:active {
border-color: var(--B500);
background-color: var(--B100);
}
}

._e_upload__control {
Expand Down Expand Up @@ -145,6 +155,14 @@
&:hover svg {
fill: var(--N600);
}

&:focus svg {
fill: var(--N600);
}

&:active svg {
fill: var(--N700);
}
}

._e_upload-file__error {
Expand Down
24 changes: 22 additions & 2 deletions src/packages/layout/src/header/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,36 @@
}

&:hover {
background-color: var(--N1000);
background-color: var(--N900);

& ._e_header-action__icon svg {
fill: var(--N0);
fill: var(--N50);
}

& > ._e_header-action__tooltip {
display: flex;
}
}

&:focus {
background-color: var(--N900);

& ._e_header-action__icon svg {
fill: var(--N50);
}

& > ._e_header-action__tooltip {
display: flex;
}
}

&:active {
background-color: var(--N1000);

& ._e_header-action__icon svg {
fill: var(--N0);
}
}
}

._e_header-action__icon {
Expand Down
24 changes: 24 additions & 0 deletions src/packages/layout/src/sidebar/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@
&:hover {
background-color: var(--N0);

& ._e_sidebar-item__text {
color: var(--N800);
}
}
&:focus {
background-color: var(--N0);

& ._e_sidebar-item__text {
color: var(--N800);
}
}
&:active {
background-color: var(--N10);

& ._e_sidebar-item__text {
color: var(--N800);
}
Expand Down Expand Up @@ -98,6 +112,16 @@
fill: var(--B500);
}
}
&:focus {
& svg {
fill: var(--B500);
}
}
&:active {
& svg {
fill: var(--B600);
}
}
}

& ._e_sidebar-item__text {
Expand Down

0 comments on commit 20c9f33

Please sign in to comment.