Skip to content

fix: changing card hover behaviour #875

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

Merged
merged 4 commits into from
May 25, 2021
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
6 changes: 5 additions & 1 deletion projects/assets-library/assets/styles/_interaction.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@

@mixin card-hover {
&:hover {
@include dropdown-box-shadow();
@include box-shadow-2dp();
cursor: pointer;
}
}

@mixin filter-box-shadow {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: why the 2 separate mixins defined the same?

@include box-shadow-2dp();
}

@mixin box-shadow-2dp {
box-shadow: 2px 2px 2px rgba(225, 228, 229, 0.5), 2px -2px 4px rgba(225, 228, 229, 0.2),
0px 2px 4px rgba(225, 228, 229, 0.2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
border-radius: 8px;
border: 1px solid $gray-2;
margin-bottom: 8px;
@include card-hover;

@include card-hover();

&.selected-card {
background: $blue-1;
Expand All @@ -33,21 +34,13 @@
}

&:hover {
background: $blue-2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to show a darker blue when user hover on selected card?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove these on hover on card

  1. border
  2. background color change

To maintain consistency on hover elements, selected and un-selected cards should follow the same behavior.
I can revert this change if required.

border: 1px solid $blue-5;

&.grouped-style {
margin-bottom: 8px;
@include grouped-style($blue-2);
}
}
}

&:hover {
background: $gray-1;
border: 1px solid $gray-2;
}

&.grouped-style {
margin-bottom: 8px;
@include grouped-style($gray-1);
Expand Down