Skip to content

Commit

Permalink
fix(chart): allow all items to show focused style…
Browse files Browse the repository at this point in the history
…when they are tabbed into using the keyboard.
This will also reduce the repetitive code, in the
compiled styles.
  • Loading branch information
Kiarokh committed Jan 13, 2025
1 parent 527a09f commit ccec5cd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/components/chart/chart.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ table {
}

.item {
@include mixins.visualize-keyboard-focus;
transition:
background-color 0.2s ease,
box-shadow 0.2s ease,
filter 0.2s ease,
opacity 0.4s ease;
cursor: help;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
}

.item {
@include mixins.visualize-keyboard-focus;
position: relative;
mix-blend-mode: hard-light;
}
Expand Down
1 change: 0 additions & 1 deletion src/components/chart/partial-styles/_nps.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
var(--limel-chart-nps-gauge-angel)
);

@include mixins.visualize-keyboard-focus;
display: flex;
align-items: flex-start;
justify-content: center;
Expand Down
2 changes: 0 additions & 2 deletions src/components/chart/partial-styles/_ring.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
}

.item {
@include mixins.visualize-keyboard-focus;

background: conic-gradient(
var(--limel-chart-item-color, $default-item-color) 0
calc(
Expand Down
16 changes: 11 additions & 5 deletions src/components/chart/partial-styles/_stacked-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
}

.item {
@include mixins.visualize-keyboard-focus;
display: flex;
border-radius: var(--chart-item-border-radius, 0);
background: var(--limel-chart-item-color, $default-item-color);

&:last-of-type {
&:last-of-type:not(:focus-visible) {
box-shadow: none !important;
}
}
Expand All @@ -31,8 +30,12 @@
.item {
min-height: 0.5rem;
width: calc(var(--limel-chart-item-size) * 1%);
box-shadow: -1px 0 0 0
var(--chart-item-divider-color, rgb(var(--color-white), 0.6)) inset;

&:not(:focus-visible) {
box-shadow: -1px 0 0 0
var(--chart-item-divider-color, rgb(var(--color-white), 0.6))
inset;
}
}
}

Expand All @@ -44,6 +47,9 @@
.item {
min-width: 0.5rem;
height: calc(var(--limel-chart-item-size) * 1%);
box-shadow: 0 -1px 0 0 rgb(var(--color-white), 0.6) inset;

&:not(:focus-visible) {
box-shadow: 0 -1px 0 0 rgb(var(--color-white), 0.6) inset;
}
}
}

0 comments on commit ccec5cd

Please sign in to comment.