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 #5386

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

Conversation

Julia-Pushko
Copy link

@Julia-Pushko Julia-Pushko commented Feb 10, 2025

  • DEMO LINK

  • TEST REPORT LINK

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

  • [x ] Each BEM block has its own separate file

  • [x ] All Typical Mistakes from BEM lesson theory are checked.

  • [ x] 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.

Your code is on the right track, but there are a few important issues to address before we can approve it. 🚀 Let's focus on these key points:

  1. Universal Selector: Avoid using the universal selector * for resetting margins due to performance concerns. Consider using more specific selectors.
  2. Fallback Fonts: Ensure you include fallback fonts in your CSS to maintain font consistency if the main font fails to load.
  3. HTML Formatting: Check that your lines of code do not exceed 80 characters for better readability.
  4. Semantic Tags: Use semantic HTML tags to improve SEO and accessibility.
  5. BEM File Structure: Each BEM block should have its own file. This helps in maintaining a clean and organized codebase.
  6. Pseudo-Selectors: Ensure yellow stars are styled using container modifiers and pseudo-selectors without extra classes.

These changes will enhance your code's performance, readability, and maintainability. Keep up the great work, and I'm confident you'll nail it with these adjustments! 💪

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

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

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 job on your submission! 🎉 While there are a few areas for improvement, such as using semantic HTML tags for star ratings, ensuring accessibility with meaningful link text or ARIA labels, and consistently applying the BEM methodology, your code is on the right track. Remember to avoid using the universal selector for resetting margins, include fallback fonts, and consider splitting your CSS into separate files for each BEM block. These changes will enhance your code's performance, maintainability, and accessibility. Keep up the good work and continue learning from these suggestions! 🚀

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

@@ -13,6 +13,142 @@
/>
</head>
<body>
<h1>Stars</h1>
<div class="stars stars--0">

Choose a reason for hiding this comment

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

Consider using a more semantic HTML tag instead of <div> for the star ratings, such as <ul> with <li> elements, to better represent the list of star ratings.

src/index.html Outdated
<div class="stars stars--0">
<a
href="#"
class="stars__star"

Choose a reason for hiding this comment

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

Each link should have meaningful text or an ARIA label for accessibility. Consider adding aria-label attributes to describe the purpose of each star link.

></a>
</div>

<div class="stars stars--1">

Choose a reason for hiding this comment

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

Similar to the previous comment, consider using semantic HTML tags and ensure accessibility features are in place.

></a>
</div>

<div class="stars stars--2">

Choose a reason for hiding this comment

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

Ensure that the BEM methodology is consistently applied. Check that your CSS file reflects the BEM naming conventions used here.

@@ -1 +1,36 @@
/* add styles here */
html {
margin: 0;

Choose a reason for hiding this comment

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

Consider using a more specific selector for resetting margins instead of applying it to the entire HTML element. This can improve performance.

display: flex;
}

.stars__star {

Choose a reason for hiding this comment

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

Ensure that you include fallback fonts in your CSS to maintain font consistency if the main font fails to load.

src/style.css Outdated
background-image: url(./images/star.svg);
}

.stars--1 .stars__star:nth-child(-n + 1) {

Choose a reason for hiding this comment

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

Consider using pseudo-selectors to style the active stars instead of creating separate classes for each star state. This can simplify your CSS and improve maintainability.

Copy link

@volodymyr-soltys97 volodymyr-soltys97 left a comment

Choose a reason for hiding this comment

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

Good job 👍
Let's improve your code

Comment on lines +25 to +26
- [DEMO LINK](https://Julia-Pushko.github.io/layout_stars/)
- [TEST REPORT LINK](https://Julia-Pushko.github.io/layout_stars/report/html_report/)

Choose a reason for hiding this comment

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

Add these links to the PR description
image

src/index.html Outdated
Comment on lines 17 to 20
<a
href="#"
class="stars__star"
></a>

Choose a reason for hiding this comment

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

Fix it everywhere

Suggested change
<a
href="#"
class="stars__star"
></a>
<div class="stars__star"></div>

src/style.css Outdated
Comment on lines 18 to 36
.stars--1 .stars__star:nth-child(-n + 1) {
background-image: url('./images/star-active.svg');
}

.stars--2 .stars__star:nth-child(-n + 2) {
background-image: url('./images/star-active.svg');
}

.stars--3 .stars__star:nth-child(-n + 3) {
background-image: url('./images/star-active.svg');
}

.stars--4 .stars__star:nth-child(-n + 4) {
background-image: url('./images/star-active.svg');
}

.stars--5 .stars__star:nth-child(-n + 5) {
background-image: url('./images/star-active.svg');
}

Choose a reason for hiding this comment

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

You need to combine these selectors with a comma.

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.

4 participants