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

add task solution #4861

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

add task solution #4861

wants to merge 4 commits into from

Conversation

mmmy33
Copy link

@mmmy33 mmmy33 commented Sep 25, 2024

  • DEMO LINK

  • TEST REPORT LINK

  • Yellow stars are added with container modifier + pseudo-selector (NO extra classes)

  • Each BEM block has its own separate file

  • All Typical Mistakes from BEM lesson theory are checked.

  • Code follows all the Code Style Rules ❗️

Copy link

@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.

While your CSS code is generally well-written and follows good practices, I've noticed a few areas that could use some improvement to enhance the consistency and maintainability of your project. Don't worry, these are not major issues, but addressing them will help you write even cleaner and more professional code. Keep up the good work, and with a bit of polishing, your code will be top-notch! 🌟🛠️

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

src/index.html Outdated
<h1>Stars</h1>
<div class="stars stars--yellow">

<div class="stars__row">

Choose a reason for hiding this comment

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

Remember about correct indentation between parent and child elements. The div with class 'stars__row' should be indented with 2 spaces inside its parent div.

src/index.html Outdated
<span class="stars__star"></span>
</div>

<div class="stars__row">

Choose a reason for hiding this comment

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

Add empty lines between multiline sibling blocks of HTML. There should be an empty line before this div to separate it from the previous sibling div.

src/index.html Outdated
<span class="stars__star"></span>
</div>

<div class="stars__row">

Choose a reason for hiding this comment

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

Add empty lines between multiline sibling blocks of HTML. There should be an empty line before this div to separate it from the previous sibling div.

src/index.html Outdated
<span class="stars__star"></span>
</div>

<div class="stars__row">

Choose a reason for hiding this comment

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

Add empty lines between multiline sibling blocks of HTML. There should be an empty line before this div to separate it from the previous sibling div.

src/index.html Outdated
<span class="stars__star"></span>
</div>

<div class="stars__row">

Choose a reason for hiding this comment

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

Add empty lines between multiline sibling blocks of HTML. There should be an empty line before this div to separate it from the previous sibling div.

src/style.css Outdated
Comment on lines 14 to 20
.stars__star {
width: 30px;
height: 30px;
display: inline-block;
background-size: cover;
background-image: url('../src/images/star.svg');
}

Choose a reason for hiding this comment

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

The use of display: inline-block is unnecessary here since you are already using display: flex in the parent container .stars__row. Flex items are automatically block level in the context of a flex container.

src/style.css Outdated
height: 30px;
display: inline-block;
background-size: cover;
background-image: url('../src/images/star.svg');

Choose a reason for hiding this comment

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

Consider using a more descriptive name for the image file to reflect its purpose or appearance, such as 'star-icon.svg' or 'star-outline.svg'. This can improve maintainability and readability of the code.

src/style.css Outdated
.stars--yellow .stars__row:nth-child(4) .stars__star:nth-child(-n+3),
.stars--yellow .stars__row:nth-child(5) .stars__star:nth-child(-n+4),
.stars--yellow .stars__row:nth-child(6) .stars__star:nth-child(-n+5) {
background-image: url('../src/images/star-active.svg');

Choose a reason for hiding this comment

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

Similar to the previous suggestion, 'star-active.svg' could be renamed to something more descriptive, like 'star-filled.svg' or 'star-highlighted.svg', to better convey the purpose of the image.

Copy link

@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.

Hey there! It looks like there are a few things that need a bit more attention before we can move forward. The path to the background image should be corrected, and we need to switch from tag names to classes for styling the stars. Also, let's tidy up the HTML by adding some empty lines for better readability and fixing the indentation. Don't worry, these tweaks will make your code shine even brighter! 🌟 Keep up the great work, and let's polish these details for an awesome final product!

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

src/index.html Outdated
@@ -13,6 +13,57 @@
/>
</head>
<body>
<h1>Stars</h1>
<div class="stars stars--yellow">

Choose a reason for hiding this comment

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

Use semantic tags where possible. For example, you could wrap the .stars element in a

or
tag with a semantic class name.

src/index.html Outdated
@@ -13,6 +13,57 @@
/>
</head>
<body>
<h1>Stars</h1>
<div class="stars stars--yellow">

Choose a reason for hiding this comment

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

There is no need for a blank line between the and the first

element. Blank lines should not be between parent and child elements.

<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>

Choose a reason for hiding this comment

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

Add an empty line between sibling blocks of HTML to add some 'air' and simplify reading. There should be an empty line between the closing of one .stars__row and the opening

of the next .stars__row.

<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>

Choose a reason for hiding this comment

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

Add an empty line between sibling blocks of HTML to add some 'air' and simplify reading. There should be an empty line between the closing of one .stars__row and the opening

of the next .stars__row.

<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>

Choose a reason for hiding this comment

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

Add an empty line between sibling blocks of HTML to add some 'air' and simplify reading. There should be an empty line between the closing of one .stars__row and the opening

of the next .stars__row.

<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>

Choose a reason for hiding this comment

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

Add an empty line between sibling blocks of HTML to add some 'air' and simplify reading. There should be an empty line between the closing of one .stars__row and the opening

of the next .stars__row.

src/style.css Outdated
Comment on lines 14 to 19
.stars__star {
width: 30px;
height: 30px;
background-size: cover;
background-image: url('../src/images/star-icon.svg');
}

Choose a reason for hiding this comment

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

Don't use tag names for styling (except html and body). Instead, style elements using .classes. In this case, .stars__star should be used to style the stars, without the need to mention tag names.

width: 30px;
height: 30px;
background-size: cover;
background-image: url('../src/images/star-icon.svg');

Choose a reason for hiding this comment

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

The relative path to the background image should be updated to reflect the CSS file's location. Since the CSS file is in src/, the correct path would be images/star-icon.svg without the ../src/ prefix.

.stars--yellow .stars__row:nth-child(4) .stars__star:nth-child(-n + 3),
.stars--yellow .stars__row:nth-child(5) .stars__star:nth-child(-n + 4),
.stars--yellow .stars__row:nth-child(6) .stars__star:nth-child(-n + 5) {
background-image: url('../src/images/star-filled.svg');

Choose a reason for hiding this comment

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

Similarly, the relative path to the background image should be images/star-filled.svg.

Copy link

@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.

Great work on your Pull Request! However, there are a few things to keep in mind for future improvements: 👍

  • Simplify your nth-child usage for clarity and ensure it matches your HTML structure.
  • Be consistent with your margins and consider using them only on one axis (top/bottom) to avoid collapse issues.
  • Use classes for styling instead of tag names where possible, except for html and body.
  • Improve readability by adding empty lines between multiline sibling blocks in your HTML.
  • Ensure proper indentation and formatting, especially within your <head> tag and its attributes.

Keep up the good work, and remember to address these points in your future code to enhance quality and maintainability! 🚀

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

@@ -13,6 +13,54 @@
/>

Choose a reason for hiding this comment

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

Keep your attributes correctly formatted. The attributes of the tag should start each on a new line with 2-space indentation related to the tag.

src/index.html Outdated
Comment on lines 16 to 64
<div class="stars__box stars--yellow">
<div class="stars stars--0">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>

<div class="stars stars--1">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>

<div class="stars stars--2">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>

<div class="stars stars--3">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>

<div class="stars stars--4">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>

<div class="stars stars--5">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>
</div>

Choose a reason for hiding this comment

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

Remember about correct indentation between parent and child elements. Each level of nesting, including the

and elements, should have a 2-space offset from its parent.

src/index.html Outdated
Comment on lines 25 to 31
<div class="stars stars--1">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>

Choose a reason for hiding this comment

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

Add empty lines between multiline sibling blocks of HTML to add some 'air' and simplify reading.

src/index.html Outdated
Comment on lines 33 to 39
<div class="stars stars--2">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>

Choose a reason for hiding this comment

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

Add empty lines between multiline sibling blocks of HTML to add some 'air' and simplify reading.

src/index.html Outdated
Comment on lines 41 to 47
<div class="stars stars--3">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>

Choose a reason for hiding this comment

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

Add empty lines between multiline sibling blocks of HTML to add some 'air' and simplify reading.

src/index.html Outdated
Comment on lines 49 to 55
<div class="stars stars--4">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>

Choose a reason for hiding this comment

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

Add empty lines between multiline sibling blocks of HTML to add some 'air' and simplify reading.

src/style.css Outdated
Comment on lines 1 to 4
html {
display: flex;
justify-content: center;
}

Choose a reason for hiding this comment

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

Avoid using tag names for styling, with the exception of html and body. In this case, it's acceptable to style the html tag, but ensure it's necessary for the layout. If it is not required for the global layout, consider using a class instead.

src/style.css Outdated
Comment on lines 27 to 29
.stars__star:not(:last-child){
margin: 0 4px 4px 0;
}

Choose a reason for hiding this comment

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

Be consistent with your margins. It's recommended to add margins only to the top or bottom of elements to prevent potential margin collapse issues. In this case, you're adding margins to the right and bottom, which could lead to inconsistencies when stacking elements or when they wrap.

src/style.css Outdated
Comment on lines 31 to 37
.stars--1:nth-child(2) .stars__star:nth-child(-n + 1 ),
.stars--2:nth-child(3) .stars__star:nth-child(-n + 2),
.stars--3:nth-child(4) .stars__star:nth-child(-n + 3),
.stars--4:nth-child(5) .stars__star:nth-child(-n + 4),
.stars--5:nth-child(6) .stars__star:nth-child(-n + 5) {
background-image: url('../src/images/star-filled.svg');
}

Choose a reason for hiding this comment

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

The nth-child pseudo-class usage here seems incorrect and overly complex. It looks like you're trying to select stars within differently rated .stars elements, but the nth-child is not necessary unless there's a specific reason for its usage that's not apparent in the CSS alone. Simplify the selectors if possible, and ensure they match the actual HTML structure.

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