Skip to content

Commit

Permalink
Put border on answers in Result component
Browse files Browse the repository at this point in the history
To avoid using the same as the background color on hover,
it's additionally put on a white background.
The border is implemented with a relative value of the neutral-light color.

Part of XI-6385
  • Loading branch information
christophblessing committed May 15, 2024
1 parent d5b1886 commit 05ab5ef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/Result.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@include variables.font-s;

&:hover {
background-color: hsl(0, 0%, 99%);
background-color: variables.$neutral-light;
}
}

Expand Down Expand Up @@ -54,6 +54,7 @@
.chevronIcon {
color: variables.$neutral-dark;
@include variables.font-s;
cursor: pointer;
}

.correctIcon {
Expand Down
10 changes: 9 additions & 1 deletion src/components/ResultViewer.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,26 @@
margin: 5px 0;
box-sizing: border-box;
flex-wrap: nowrap;
background-color: variables.$neutral-light;
background-color: white;
border: 1px solid;
border-color: variables.$border-neutral;

&.selected {
font-weight: bold;

.icon {
color: variables.$neutral-dark;
}
}

&.correct {
background-color: variables.$success-light;
border-color: variables.$success;
}

&.wrong {
background-color: variables.$danger-light;
border-color: variables.$danger;
}

.icon {
Expand Down
2 changes: 2 additions & 0 deletions src/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ $neutral: var(--qr-color-neutral, hsl(0, 0%, 45%));
$neutral-light: var(--qr-color-neutral-light, hsl(0, 0%, 96%));
$neutral-dark: var(--qr-color-neutral-dark, hsl(0, 0%, 32%));

$border-neutral: hsl(from $neutral-light h s 80%);

$success: var(--qr-color-success, hsl(142, 71%, 45%));
$success-light: var(--qr-color-success-light, hsl(142, 77%, 73%));
$success-dark: var(--qr-color-success-dark, hsl(142, 76%, 36%));
Expand Down

0 comments on commit 05ab5ef

Please sign in to comment.