-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
catalog hover version 1 #2015
base: master
Are you sure you want to change the base?
catalog hover version 1 #2015
Conversation
steveforde
commented
Jul 30, 2023
- DEMO LINK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/styles/blocks/catalog.scss
Outdated
width: 200px; | ||
height: 300px; | ||
border: 1px solid #ccc; | ||
border-radius: 5px; | ||
margin-bottom: 48px; | ||
transition: all $hoverTransitionDuration; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify the transition property. Using all
as a transition property is not the best approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/styles/blocks/header.scss
Outdated
$hoverTransitionDuration: 300ms; | ||
$linkTextColorOnHover: #00acdc; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a separate file for variables
src/styles/blocks/catalog.scss
Outdated
transform: scale($cardScaleOnHover); | ||
.card-title { | ||
color: $titleTextColorOnHover; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transform: scale($cardScaleOnHover); | |
.card-title { | |
color: $titleTextColorOnHover; | |
} | |
transform: scale($cardScaleOnHover); | |
color: $titleTextColorOnHover; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, make sure you fixed all the comments
src/index.html
Outdated
@@ -60,31 +60,31 @@ | |||
|
|||
<main class="catalog"> | |||
<div class="catalog__card"> | |||
Product card | |||
<p class="card-title">Product card</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to change the html file. Just use the correct styles. Discard all changes in this file, please
src/styles/blocks/catalog.scss
Outdated
transform: scale($cardScaleOnHover); | ||
.card-title { | ||
color: $titleTextColorOnHover; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/styles/blocks/header.scss
Outdated
@@ -32,11 +32,15 @@ | |||
} | |||
} | |||
|
|||
&__link { | |||
.nav__link { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to change the selector here
.nav__link { | |
.&__link { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls fix this)
src/styles/blocks/header.scss
Outdated
transition: color $hoverTransitionDuration; | ||
&:hover { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transition: color $hoverTransitionDuration; | |
&:hover { | |
transition: color $hoverTransitionDuration; | |
&:hover { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,4 @@ | |||
$hoverTransitionDuration: 300ms; | |||
$linkTextColorOnHover: #00acdc; | |||
$cardScaleOnHover: 1.2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't really need to create a variable for the scale value, you use it only once. But it's not a mistake, you can leave it like that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, make sure you fixed all previous comments. Feel free to ask questions in the chat
src/styles/blocks/catalog.scss
Outdated
width: 200px; | ||
height: 300px; | ||
border: 1px solid #ccc; | ||
border-radius: 5px; | ||
margin-bottom: 48px; | ||
transition: all $hoverTransitionDuration; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/styles/blocks/header.scss
Outdated
@@ -32,11 +32,15 @@ | |||
} | |||
} | |||
|
|||
&__link { | |||
.nav__link { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/styles/blocks/header.scss
Outdated
transition: color $hoverTransitionDuration; | ||
&:hover { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there) Just several more things needs to be fixed
src/styles/blocks/header.scss
Outdated
|
||
.nav { | ||
&__list { | ||
.nav__list { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls make use of sass nesting for nav
selector like so
.nav {
&__list {
...
}
&__item {
...
}
}
src/styles/blocks/header.scss
Outdated
@@ -32,11 +32,15 @@ | |||
} | |||
} | |||
|
|||
&__link { | |||
.nav__link { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls fix this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls pay attention to .nav__link
and the comments to it
and try to make use of nesting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've got this, keep pushing forward!