-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Develop #4819
base: master
Are you sure you want to change the base?
Develop #4819
Conversation
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.
Hey there! It looks like there are a few critical issues that need your attention before we can move forward. 😊 The active stars should use a modifier class for flexibility, and properties shouldn't be duplicated to keep the code DRY. Also, make sure the border property is complete, and correct the way you're using buttons and links. Lastly, check the file extensions for images and CSS files. Once you address these points, your code will be in great shape! Keep up the good work, and I'm looking forward to seeing the improved version! 👍
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -11,8 +11,67 @@ | |||
rel="stylesheet" | |||
href="./styles/index.scss" |
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.
According to Code Style Rules ❗️, CSS files should be linked with a .css
extension, not .scss
. Please change the file extension in the href attribute.
src/index.html
Outdated
data-qa="card" | ||
> | ||
<img | ||
src="./images/imac.jpeg" |
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.
The image file extension in the src
attribute should match the actual file extension. The file is named imac.png
but here it is referenced as imac.jpeg
. Please correct the file extension.
src/index.html
Outdated
<br /> | ||
5K Monoblock (MNED2UA/A) |
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.
Avoid using <br />
to create line breaks in text content. It's better to control the layout using CSS. If these are meant to be separate lines, consider wrapping them in separate elements.
<button class="card__buy-button"> | ||
<a | ||
data-qa="hover" | ||
href="#" | ||
class="card__buy-button-link" | ||
> | ||
Buy | ||
</a> | ||
</button> |
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.
The button element should not contain an anchor tag. Instead, style the <a>
tag to look like a button if you want it to be a link, or use a <button>
tag with a click event handler if it's meant to be a button.
src/styles/index.scss
Outdated
margin: 0 16px 16px; | ||
|
||
border-radius: 5px; | ||
border: #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.
The 'border' property should include the border-style (e.g., solid), not just the color. It seems like there's a mistake here because only the color is specified. According to the checklist, the border property should be written shorthand with all its parts.
color: #fff; | ||
} | ||
|
||
.card__buy-button: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.
You have specified 'border-radius' and 'border' properties again inside the hover state, but these are already defined outside and don't change on hover. You should remove them from the hover state to follow the DRY principle.
.stars-star { | ||
width: 16px; | ||
height: 16px; | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
background-image: url(../images/star.svg); | ||
|
||
display: inline-block; | ||
} |
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.
The '.stars-star' class has duplicated properties that are also defined in the '.stars .stars-star:nth-child(-n + 4)' class. Consider combining these properties into a single class to follow the DRY principle.
src/styles/index.scss
Outdated
.stars .stars-star:nth-child(-n + 4) { | ||
width: 16px; | ||
height: 16px; | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
background-image: url(../images/star-active.svg); | ||
|
||
display: inline-block; | ||
} |
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.
The background image for the active stars should be set using a modifier class instead of the nth-child selector to make it more flexible and maintainable. This way, if the number of active stars needs to change, you can just change the class applied to the star elements.
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.
Great effort on the work you've done so far! However, there are a few critical issues that need to be addressed before we can move forward. The use of incorrect BEM naming and the presence of a button element around an anchor tag are significant concerns that could affect the maintainability and functionality of the code. Also, the fixed dimensions on the BEM block could limit flexibility. Please take a look at these points and make the necessary changes. Keep up the good work, and you'll have this polished up in no time! 😊🛠️
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -11,8 +11,65 @@ | |||
rel="stylesheet" | |||
href="./styles/index.scss" |
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.
According to the Code Style Rules ❗️, stylesheets with a .scss
extension should be included as regular .css
files in HTML. You should compile .scss
to .css
and then link to the .css
file in your HTML.
src/index.html
Outdated
data-qa="card" | ||
> | ||
<img | ||
src="./images/imac.jpeg" |
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.
The image source path is incorrect, it should be ./images/imac.png
as per the file structure provided. Make sure the file extension and the path are correct.
<h4 class="card__code">Product code: 195434</h4> | ||
|
||
<div class="card__rating"> | ||
<div class="stars"> |
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.
Each star should have a class stars__star
instead of stars-star
following the BEM methodology as per the Code Style Rules ❗️.
src/index.html
Outdated
<div class="stars-star"></div> | ||
</div> | ||
|
||
<h3 class="card__reviews">Reviews: 5</h3> |
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.
The element with class card__reviews
should be a paragraph <p>
instead of a heading <h3>
, because it's not a heading but a piece of information related to the product. Reserve heading tags for titles and headings only.
<h1 class="card__price-amount">$2,199</h1> | ||
</div> | ||
|
||
<button class="card__buy-button"> |
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.
The button element should not contain the anchor <a>
element. Instead, apply the card__buy-button
class directly to the anchor tag and remove the button element. This is because semantically, a button should not be used to navigate, which is the purpose of an anchor tag.
.stars .stars-star:nth-child(-n + 4) { | ||
background-image: url(../images/star-active.svg); |
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.
The .stars .stars-star:nth-child(-n + 4)
selector does not follow the BEM methodology. Instead of modifying the element based on a parent class, you should use a modifier class for the star element itself. For example, .stars-star--active
could be used to represent an active star.
.card { | ||
width: 200px; | ||
border: 1px solid #f3f3f3; | ||
border-radius: 5px; | ||
background-color: #fff; | ||
} |
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.
According to the checklist, the BEM block should not have fixed width and height. Instead, consider making the card width more flexible or controlled by its parent container.
.card__buy-button:hover { | ||
background-color: #fff; | ||
|
||
.card__buy-button-link { | ||
font-size: 14px; | ||
line-height: 16px; | ||
color: #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.
The nested selector .card__buy-button-link
inside the :hover
pseudo-class is not recommended in SCSS. Instead, you should use the &
parent selector to keep the nesting within the .card__buy-button
block scope. For example, &:hover &__buy-button-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.
Great effort on the Pull Request! 👍 However, please address the following issues in the future:
- Use correct SCSS nesting for the hover state.
- Include all necessary assets or adjust the code accordingly.
- Correct the semantic use of
<button>
and<a>
elements. - Use appropriate tags for non-heading content.
- Remember to compile SCSS to CSS and link the CSS file in your HTML.
These points will enhance the quality and maintainability of your code. Keep up the good work and happy coding! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -11,8 +11,65 @@ | |||
rel="stylesheet" | |||
href="./styles/index.scss" |
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.
According to the Code Style Rules ❗️, SCSS files should be linked as CSS files in HTML. You need to compile your SCSS to CSS and link the compiled CSS file here instead.
<div class="card__price-block"> | ||
<h3 class="card__price-title">Price:</h3> | ||
|
||
<h1 class="card__price-amount">$2,199</h1> |
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.
Heading tags should be used to introduce content. Using an <h1>
tag for the price amount is not semantically correct as it does not represent a heading of a section or the document. Consider using a different tag, like <p>
or <span>
, with appropriate class names for styling.
<button class="card__buy-button"> | ||
<a | ||
data-qa="hover" | ||
href="#" | ||
class="card__buy-button-link" | ||
> | ||
Buy | ||
</a> | ||
</button> |
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's a semantic issue here. The <button>
element should not contain an <a>
link. Instead, you should use either a <button>
or an <a>
, but not both. If the intention is to navigate, use the <a>
tag with button styles. If the intention is to submit a form or trigger a JavaScript action, use the <button>
tag.
.stars .stars-star:nth-child(-n + 4) { | ||
background-image: url(../images/star-active.svg); | ||
} |
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.
The class .stars-star
is modified by :nth-child(-n + 4)
to change the image, which suggests that these are active stars, but there is no star-active.svg
provided in the changed files. Make sure to include all necessary assets if they are meant to be part of the pull request. If star-active.svg
is not meant to be different from star.svg
, consider removing this rule to avoid confusion.
.card__buy-button:hover { | ||
background-color: #fff; | ||
|
||
.card__buy-button-link { | ||
font-size: 14px; | ||
line-height: 16px; | ||
color: #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.
The nested SCSS inside .card__buy-button:hover
should be written as '&:hover' directly inside the .card__buy-button
block. Nested rules like this won't compile correctly in standard SCSS and will lead to a syntax error. This is how it should be structured:
.card__buy-button {
...styles...
&:hover {
...hover styles...
.card__buy-button-link {
...link styles...
}
}
}
❗️ Copy this
Checklist
to thePull Request
description after links, and put- [x]
before each point after you checked it.card
andstars
each in it own fileelements
,modifiers
andpseudo-classes
stars--N
modifiers work as expected (Highlight firstN
stars)