Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make card close button an actual button (+ focus/hover consistency) #138

Merged
merged 2 commits into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/ambassadorButton/AmbassadorButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default function AmbassadorButton(props: AmbassadorButtonProps) {
className={classes(styles.ambassador, className)}
id={ambassadorKey}
onClick={onClick}
type="button"
>
<img
className={styles.img}
Expand Down
8 changes: 7 additions & 1 deletion src/components/ambassadorButton/ambassadorButton.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@
flex-shrink: 0;
box-shadow: $shadow;
border-radius: 0.5rem;
outline-color: $outline-color;
transition: $transition;
transition-property: filter;
transition-property: filter, outline;

&:hover,
&:focus {
outline: $outline;
}

&:hover {
filter: brightness(1.2);
Expand Down
9 changes: 7 additions & 2 deletions src/components/ambassadorCard/AmbassadorCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,14 @@ export default function AmbassadorCard(props: AmbassadorCardProps) {

<div className={styles.overlay}>
{props.onClose && (
<div className={styles.close} onClick={onClose}>
<button
className={styles.close}
onClick={onClose}
type="button"
aria-label="Close"
>
&times;
</div>
</button>
)}

<h2 className={styles.name} title={ambassador.name}>
Expand Down
6 changes: 5 additions & 1 deletion src/components/ambassadorCard/ambassadorCard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,18 @@
right: 0.25rem;
transform: translateY(-50%);
width: 2rem;

appearance: none;
display: block;
font-size: 1.5rem;
line-height: 1.1;
color: $primary-text;
cursor: pointer;
text-align: center;
transition: $transition color;

&:hover {
&:hover,
&:focus {
color: $outline-color;
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/pages/overlay/components/buttons/buttons.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@
transition-property: outline, filter;

&:hover,
&:focus,
&.highlighted {
outline: $outline;
}

&:hover {
filter: brightness(1.2);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ $fade-distance: 3rem;
z-index: 2;
transition: $transition opacity;

&:hover {
&:hover,
&:focus {
svg {
scale: 1.2;

Expand Down Expand Up @@ -141,14 +142,8 @@ $fade-distance: 3rem;
}

.ambassadorButton {
outline-color: $outline-color;
transition: $transition;
transition-property: outline, filter;

&:hover,
&.highlighted {
outline: $outline;
filter: brightness(1.2);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
list-style: none;
transition: $transition scale;

&:hover {
&:hover,
&:focus {
scale: 1.2;

a {
Expand Down Expand Up @@ -44,7 +45,8 @@
transition: $transition;
transition-property: color;

&:hover {
&:hover,
&:focus {
color: $outline-color;
}
}
3 changes: 2 additions & 1 deletion src/pages/overlay/components/toggle/toggle.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
gap: 0.5rem;
cursor: pointer;

&:hover {
&:hover,
&:focus-within {
.toggle {
input {
outline: $outline;
Expand Down