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

develop #4954

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

develop #4954

wants to merge 2 commits into from

Conversation

Daniil-102
Copy link

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 so far! 👍 However, there are a few areas that need improvement. Pay attention to your CSS code, avoid setting fixed width and height if not necessary, and be consistent with your margins. Also, avoid using the * selector as it impacts performance. In your HTML, ensure proper formatting of attributes and correct indentation for readability. Keep up the good work and make these changes for better code quality. 😊

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

@@ -13,6 +13,52 @@
/>
</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.

Remember about correct indentation between parent and child elements. Each level of nesting, including text, contained inside the element, requires 2-space offset. For instance, in line 16, the 'div' elements inside the 'stars' class should be indented with 2 spaces.

src/style.css Outdated
Comment on lines 2 to 6
html {
margin: 0;
padding: 0;
box-sizing: border-box;
}

Choose a reason for hiding this comment

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

Don't use the * selector as it impacts performance. Set styles only for elements that require them. Zeroing out your margins, paddings, or other styles with '*' is still inefficient for the browser.

src/style.css Outdated
Comment on lines 13 to 16
.stars {
display: flex;
margin-bottom: 0;
}

Choose a reason for hiding this comment

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

To avoid potential margin collapse, be consistent with your margins. Add only top or bottom, but not both. In this case, you have a margin-bottom: 0; which might not be necessary.

Comment on lines +18 to +26
.stars__star {
width: 16px;
height: 16px;
background-image: url('images/star.svg');
background-size: auto;
background-repeat: no-repeat;
background-position: center;
margin-right: 4px;
}

Choose a reason for hiding this comment

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

Avoid fixing container size if there is no such requirement. Let the content size dictate it. To avoid overflow or accidental scroll bar, it would be better not to set a fixed width and height for .stars__star.

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 project! Your HTML and CSS files are well-structured and clean. There are a few formatting issues and places where the code could be improved, so make sure to review the comments. Keep practicing and continue to improve your coding skills. Happy coding! 🚀

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

@@ -12,7 +12,54 @@
href="./style.css"
/>

Choose a reason for hiding this comment

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

According to the checklist, if the HTML-element has long attribute values or number of attributes is more than 2, you should start each one, including the first, on the new line with 2-space indentation related to tag. Tag’s closing bracket should be on the same level as opening one. Please adjust the formatting accordingly.

Comment on lines +17 to +22
<div class="stars stars--0">
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>

Choose a reason for hiding this comment

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

You should add empty lines between multiline sibling blocks of HTML to add some 'air' and simplify reading. But don't add them between parent and child elements. Add an empty line after this block.

Comment on lines +25 to +30
<div class="stars stars--1">
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></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 after this block.

Comment on lines +33 to +38
<div class="stars stars--2">
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></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 after this block.

Comment on lines +41 to +46
<div class="stars stars--3">
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></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 after this block.

Comment on lines +49 to +54
<div class="stars stars--4">
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></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 after this block.

@@ -1 +1,47 @@
/* add styles here */
body {

Choose a reason for hiding this comment

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

It's not recommended to use tag names for styling (except html and body). This can lead to unexpected results when your project grows and becomes more complex. I would suggest to add a class to the body tag and style it instead. Refer to the checklist item: 'Don't use tag names for styling (except html and body)'

Comment on lines +25 to +47
.stars--0 .stars__star:nth-child(-n + 0) {
background-image: url('images/star-active.svg');
}

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

There is some code duplication here. You are setting the same background image for each condition. A better approach would be to set the background-image property once for all .stars__star elements and then just change it when needed. This will make your code DRYer and easier to maintain.

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