Skip to content

Solution#6125

Open
KrzywMan wants to merge 3 commits intomate-academy:masterfrom
KrzywMan:develop
Open

Solution#6125
KrzywMan wants to merge 3 commits intomate-academy:masterfrom
KrzywMan:develop

Conversation

@KrzywMan
Copy link
Copy Markdown

  • DEMO LINK

  • TEST REPORT LINK

  • All components follow BEM and use SCSS

  • Repeated sizes and special colors are put to variables

  • Grid is used for the columns

  • Cards are shown in 1, 2, 3, or 4 columns based on screen resolution

  • All changes on :hover are smooth

  • Code follows all the Code Style Rules ❗️

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Great job on the visual implementation and the HTML structure! The page is responsive and all the hover effects work as expected.

However, some changes are needed regarding the SCSS architecture. The main issue is that src/styles/index.scss contains all the styles, duplicating the content from the partial files in styles/blocks/ and _variables.scss. The index.scss file should only be used to @import the other partials to create a modular and maintainable structure.

Additionally, many repeated values like paddings, gaps, card widths, and media query breakpoints are hardcoded. Please define these as variables in _variables.scss as required by the checklist [CHECKLIST ITEM #2].

One last detail: for the card's z-index on hover to work correctly, the .card element also needs a position: relative; property. Please make these adjustments to align the project with the task requirements.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/styles/_variables.scss Outdated
Comment on lines +1 to +6
$font-main: 'Roboto', 'Arial', sans-serif;
$color-text-nav: #060b35;
$color-accent: #00acdc;
$color-title-hover: #34568b;
$color-white: #fff;
$transition-duration: 300ms;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This file is a good start for centralizing your variables, but there are a couple of major issues with the overall SCSS implementation:

  1. Unused Partials: This file and all the files in the styles/blocks/ directory are currently unused. Your main stylesheet, index.scss, duplicates all styles and variables instead of importing these partials. You should use @import in index.scss to build your styles from these modular files.

  2. Missing Variables: This violates checklist item Vitalii Pshychenko #2: 'Repeated sizes and special colors are put to variables'. This file should contain all reusable values. Please add variables for sizes like card width, gaps, and paddings. For example:

    $card-width: 200px;
    $catalog-gap: 46px 48px;

    Then use these variables throughout your other SCSS files.

Comment thread src/styles/blocks/_catalog.scss Outdated
Comment on lines +4 to +6
padding: 50px 40px;
gap: 46px 48px;
grid-template-columns: repeat(1, 200px);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #2: 'Repeated sizes and special colors are put to variables'. The hardcoded values for padding, gap, and card width should be defined as variables in your _variables.scss file for better maintainability. The card width 200px is used in multiple files and is a clear candidate for a variable.

Comment thread src/styles/blocks/_catalog.scss Outdated
Comment on lines +8 to +16
@media (min-width: 488px) {
grid-template-columns: repeat(2, 200px);
}

@media (min-width: 768px) {
grid-template-columns: repeat(3, 200px);
}

@media (min-width: 1024px) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #2: 'Repeated sizes and special colors are put to variables'. These media query breakpoints should also be defined as variables (e.g., $breakpoint-tablet, $breakpoint-desktop). This makes your responsive design more consistent and easier to manage across the project.

@@ -0,0 +1,53 @@
.card {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For the z-index property (set on line 47) to have an effect, this element needs a position property with a value other than static (e.g., relative). This is crucial for making sure the hovered card appears on top of its neighbors, which is required so that "neighboring cards should not be affected".

Comment thread src/styles/blocks/_nav.scss Outdated
list-style: none;
padding: 0;
margin: 0;
gap: 20px;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #2: 'Repeated sizes and special colors are put to variables'. The gap value 20px should be stored in a variable in your _variables.scss file to improve maintainability, for example: $nav-gap: 20px;.

Comment thread src/styles/index.scss Outdated
Comment on lines +1 to +6
$font-main: 'Roboto', sans-serif;
$color-nav: #060b35;
$color-hover: #00acdc;
$color-title-hover: #34568b;
$color-white: #fff;
$transition-speed: 300ms;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These variables should not be redefined here. The index.scss file should import the _variables.scss partial at the very top using @import '../variables';. The current approach creates duplicated and conflicting variable definitions, which undermines the maintainability of the code.

Comment thread src/styles/index.scss Outdated
Comment on lines +43 to +45
padding: 50px 40px;
gap: 46px 48px;
grid-template-columns: repeat(1, 200px);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #2: 'Repeated sizes and special colors are put to variables'. All these hardcoded values (padding, gap, width) should be defined as variables in _variables.scss and then used here. For example: $catalog-padding: 50px 40px;.

Comment thread src/styles/index.scss Outdated
Comment on lines +47 to +56
@media (min-width: 488px) {
grid-template-columns: repeat(2, 200px);
}

@media (min-width: 768px) {
grid-template-columns: repeat(3, 200px);
}

@media (min-width: 1024px) {
grid-template-columns: repeat(4, 200px);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #2: 'Repeated sizes and special colors are put to variables'. The media query breakpoints (488px, 768px, 1024px) should also be defined as variables in _variables.scss for consistency and easier maintenance.

Comment thread src/styles/index.scss Outdated
Comment on lines +13 to +128
.header {
padding: 20px 40px;
}

.nav {
&__list {
display: flex;
margin: 0;
padding: 0;
list-style: none;
gap: 20px;
}

&__link {
font-weight: 500;
color: $color-nav;
text-decoration: none;
transition: color $transition-speed;
cursor: pointer;

&:hover,
&.is-active {
color: $color-hover;
}
}
}

.catalog {
display: grid;
justify-content: center;
padding: 50px 40px;
gap: 46px 48px;
grid-template-columns: repeat(1, 200px);

@media (min-width: 488px) {
grid-template-columns: repeat(2, 200px);
}

@media (min-width: 768px) {
grid-template-columns: repeat(3, 200px);
}

@media (min-width: 1024px) {
grid-template-columns: repeat(4, 200px);
}
}

.card {
position: relative;
width: 200px;
border-radius: 8px;
background-color: #f9f9f9;
transition: transform $transition-speed;
cursor: pointer;

&__image {
display: block;
width: 100%;
}

&__content {
padding: 10px;
}

&__title {
margin: 10px 0;
font-size: 16px;
transition: color $transition-speed;
}

&__footer {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 15px;
}

&__price {
font-weight: 700;
color: $color-nav;
}

&__button {
padding: 8px 16px;
color: $color-white;
text-decoration: none;
background-color: $color-hover;
border: 1px solid $color-hover;
border-radius: 4px;
transition: all $transition-speed;

&:hover {
color: $color-hover;
background-color: $color-white;
}
}

&:hover {
z-index: 10;
transform: scale(1.2);

.card__title {
color: $color-title-hover;
}
}
}

.stars {
font-size: 14px;
color: #ccc;

&__item {
&--filled {
color: #ffc107;
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All of these style blocks (.header, .nav, .catalog, .card, .stars) should be removed from this file. They should exist in their own respective partial files within the styles/blocks/ directory. This file should then import them using @import statements. The current implementation makes all the other .scss files redundant.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Excellent work on refactoring the SCSS structure! The code is much cleaner and more modular now. However, a few changes are needed to meet all the requirements.

There's a small typo in src/styles/blocks/_card.scss where you've used $color-nav-text instead of the correct $color-text-nav. This typo is preventing the card price from being styled correctly.

Additionally, to fully comply with the requirement to use variables [CHECKLIST ITEM #2], please move the remaining hardcoded values to _variables.scss. This includes:

  • The background-color: #f9f9f9; in _card.scss.
  • The 20px and 40px padding values in _header.scss.
  • The 20px gap in _nav.scss.
  • The 4px gap and 14px font-size in _stars.scss.

Once these fixes are in place, the solution will be perfect. Keep up the great work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

@@ -0,0 +1,16 @@
$color-text-nav: #060b35;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great job defining this variable for the navigation text color. Just a small heads-up: in src/styles/blocks/_card.scss, when setting the color for .card__price, this variable is misspelled as $color-nav-text. Please correct the typo to match the name defined here.

$card-width: 200px;
$bp-mobile-plus: 488px;
$bp-tablet: 768px;
$bp-desktop: 1024px;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This file is well-organized. To fully comply with checklist item #2 ('Repeated sizes and special colors are put to variables'), please add variables for a few remaining hardcoded values. For instance, the background-color: #f9f9f9; in _card.scss should be defined as a variable here (e.g., $color-card-bg: #f9f9f9;).

$card-width: 200px;
$bp-mobile-plus: 488px;
$bp-tablet: 768px;
$bp-desktop: 1024px;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #2 also applies to repeated sizes. The value 20px is used as padding in _header.scss and as a gap in _nav.scss. To avoid this repetition, please define a variable for it here (e.g., $spacing-md: 20px;).

Additionally, _header.scss uses a hardcoded 40px padding, for which you already have the $catalog-padding-h variable.

Comment thread src/styles/blocks/_card.scss Outdated

&__price {
font-weight: 700;
color: $color-nav-text;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It seems there's a typo in the variable name here. The variable $color-nav-text is not defined in your _variables.scss file. I believe you intended to use $color-text-nav.

Comment thread src/index.html
Apple
</a>
</li>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It seems there's a small typo in this variable name. According to _variables.scss, it should be $color-text-nav.

Comment thread src/styles/blocks/_stars.scss Outdated
Comment on lines +3 to +4
gap: 4px;
font-size: 14px;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a good implementation. To fully comply with checklist item #2 ('Repeated sizes and special colors are put to variables'), please avoid using hardcoded 'magic numbers' for sizes.

  • The gap: 4px; uses a value that is also present in _card.scss (border-radius: 4px;). Please create a variable for this repeated size in _variables.scss (e.g., $spacing-xs: 4px;) and use it in both places.
  • It would also be good practice to create a variable for the font-size: 14px;.

Comment thread src/styles/blocks/_header.scss Outdated
@@ -0,0 +1,3 @@
.header {
padding: 20px 40px;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To comply with checklist item #2, hardcoded values should be avoided.

  1. You already have a variable $catalog-padding-h: 40px;. Please use it here for the horizontal padding.
  2. The 20px value is also used in _nav.scss for the gap. Please create a new variable for this repeated size (e.g., $spacing-md: 20px;) in _variables.scss and use it in both places.

Comment thread src/styles/blocks/_nav.scss Outdated
margin: 0;
padding: 0;
list-style: none;
gap: 20px;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To comply with checklist item #2 ('Repeated sizes and special colors are put to variables'), this hardcoded 20px value should be a variable. This size is also used as padding in the _header.scss file, making it a repeated value. Please define it in _variables.scss (e.g., $spacing-md: 20px;) and use the variable here.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Excellent progress on this task! You've successfully addressed almost all the feedback, and your code is clean and well-structured.

I am approving your solution as an educational override so you can move forward. However, please note that a few "magic numbers" for sizes and font weights remain in your SCSS files, specifically in src/styles/blocks/_card.scss and src/styles/blocks/_nav.scss. To fully meet the requirements [CHECKLIST ITEM #2], values like padding: 8px 16px and font-weight: 700 should be moved to variables in _variables.scss.

This practice greatly improves code maintainability. Keep up the fantastic work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment on lines +1 to +61
.card {
position: relative;
width: $card-width;
border-radius: $spacing-xs;
background-color: $color-card-bg;
transition: transform $transition-speed;
cursor: pointer;

&__image {
display: block;
width: 100%;
}

&__content {
padding: 10px;
}

&__title {
margin: 10px 0;
font-size: 16px;
transition: color $transition-speed;
}

&__footer {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 15px;
}

&__price {
font-weight: 700;
color: $color-text-nav;
}

&__button {
padding: 8px 16px;
color: $color-white;
text-decoration: none;
background-color: $color-accent;
border: 1px solid $color-accent;
border-radius: $spacing-xs;
transition:
background-color $transition-speed,
color $transition-speed;

&:hover {
color: $color-accent;
background-color: $color-white;
}
}

&:hover {
z-index: 10;
transform: scale(1.2);

.card__title {
color: $color-title-hover;
}
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great job addressing the previous feedback! To fully satisfy checklist item #2 ('Repeated sizes and special colors are put to variables'), let's also move the remaining hardcoded values in this file to variables.

For example, values like 10px, 16px, 15px, font-weight: 700, and padding: 8px 16px should be defined in _variables.scss to avoid 'magic numbers' and improve maintainability.

}

&__link {
font-weight: 500;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This looks great! To be fully compliant with checklist item #2, it's a good practice to move typographic values like font-weight into variables. Consider creating a variable like $font-weight-medium: 500; in your _variables.scss file and using it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants