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 solution #4543

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

add solution #4543

wants to merge 4 commits into from

Conversation

LiliiaVol
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 to be corrected. Please fix the typo in the class names and avoid using the '*' selector due to its impact on performance. Also, consider using semantic HTML5 elements and a more descriptive document title. Don't forget to correct the indentation as well. Keep up the good work! 💪

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

src/index.html Outdated
placeholder="Try “Los Angeles“"
/>
<form
class="search-form search-form_big"

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. But here, it seems like you used 4-space offset. Please fix it.

src/index.html Outdated
placeholder="Try “Los Angeles“"
/>
<form
class="search-form search-form_small"

Choose a reason for hiding this comment

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

Here again, the indentation is not correct. Please use 2-space offset for the nested elements.

class="search-form__input search-form__input_small"
/>
</label>
</form>
</body>

Choose a reason for hiding this comment

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

The semantic structure of the HTML document could be improved. Consider using semantic HTML5 elements like <header>, <main>, <section>, <article>, <aside>, <footer>, etc. These elements provide additional information about your document to both the browser and the developer.

src/style.css Outdated
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.

You're using the '*' selector here. This is generally not recommended because it can impact performance. It would be better to apply these styles to the specific elements that need them.

src/style.css Outdated

body {
margin: 8px;
font-family: Avenir, sans-serif;

Choose a reason for hiding this comment

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

You've specified a font-family here, but you haven't provided a fallback font. If the Avenir font fails to load for some reason, the browser will use the default font, which may not fit your design. It's a good idea to specify a generic font family that the browser can fall back to. For example: font-family: Avenir, sans-serif;.

src/style.css Outdated
}

* {
margin: 0;

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 the * selector to set styles for all elements, as it can negatively affect performance. Try to apply these styles specifically to the elements that need them.

src/style.css Outdated
box-shadow: 0 3px 8px rgba(61, 78, 97, 0.2);
}

.input:focus {

Choose a reason for hiding this comment

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

It seems like there is a typo in your class name. You probably meant .search-form__input:focus instead of .input:focus.

src/style.css Outdated
line-height: 19px;
}

.search-form_input:hover {

Choose a reason for hiding this comment

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

It seems like there is a typo in your class name. You probably meant .search-form__input:hover instead of .search-form_input:hover.

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 really good, but there are some minor issues that need your attention. Let's fix them to make your code even better! 😊 Remember to avoid fixing the container size unless it's necessary, be consistent with your margins, use fallback fonts and avoid using the * selector. Keep up the good work! 👍

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

src/style.css Outdated
Comment on lines 17 to 20
* {
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.

According to the checklist, you should not use the * selector as it impacts performance. It's better to set styles only for elements that require them.

src/style.css Outdated

body {
margin: 8px;
font-family: Avenir, sans-serif;

Choose a reason for hiding this comment

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

Good job on defining the font family. However, remember to use fallback fonts - alternative font-family in case the main one doesn't work. This is to ensure that some sort of font is displayed to the user in case the first one doesn't load for some reason. For example, you could modify this line to: font-family: Avenir, Arial, sans-serif;

src/style.css Outdated
}

body {
margin: 8px;

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, not both, to avoid potential margin collapse. In this case, you're adding margin to all sides of the body element.

Comment on lines +37 to +38
width: 100%;
height: 70px;

Choose a reason for hiding this comment

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

You've fixed the size of the .search-form_big container. Unless it's a strict requirement, it's better not to fix the container size. This allows the content size to dictate the size of the container, helping to avoid overflow or accidental scroll bars.

Comment on lines +42 to +43
width: 100%;
height: 42px;

Choose a reason for hiding this comment

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

Similar to the .search-form_big class, you've also fixed the size of the .search-form_small container. Consider letting the content size dictate the size of the container.

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 pull request! 🎉 You've done well in structuring your HTML and CSS files. However, there are a few areas that need improvement. You should avoid fixing container heights and styling using tag names. Also, be consistent with your margins to avoid potential margin collapse. In your HTML, ensure that label elements have a for attribute for better accessibility, and that your title tag is more descriptive. These are not major issues, but addressing them will make your code cleaner and more efficient. 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! ✨

src/index.html Outdated
Comment on lines 20 to 29
<form class="search-form search-form_big" data-qa="big">
<label class="search-form__label search-form__label_big">
<input
data-qa="keypress"
type="text"
placeholder="Try “Los Angeles”"
class="search-form__input search-form__input_big"
/>
</label>
</form>

Choose a reason for hiding this comment

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

There should be an empty line between multiline sibling blocks of HTML. Please add an empty line between these two form elements. [HTML Formatting]

src/index.html Outdated
Comment on lines 22 to 27
<input
data-qa="keypress"
type="text"
placeholder="Try “Los Angeles”"
class="search-form__input search-form__input_big"
/>

Choose a reason for hiding this comment

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

The label element should have a for attribute which refers to the id of the input it labels. This improves accessibility as it allows screen readers to read out the label when the user is focused on the input. [HTML Content]

src/index.html Outdated
Comment on lines 33 to 38
<input
data-qa="hover"
type="text"
placeholder="Try “Los Angeles”"
class="search-form__input search-form__input_small"
/>

Choose a reason for hiding this comment

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

The label element should have a for attribute which refers to the id of the input it labels. This improves accessibility as it allows screen readers to read out the label when the user is focused on the input. [HTML Content]

body {
padding: 0;
box-sizing: border-box;
font-family: Avenir, Arial, sans-serif;

Choose a reason for hiding this comment

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

You've done a good job specifying a fallback font in case the main font doesn't load. This is a good practice as it ensures that some font will be displayed, improving your website's resilience and usability. Keep it up!

.search-form {
display: flex;
justify-content: center;
margin: 20px auto 0;

Choose a reason for hiding this comment

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

You are adding both top and bottom margins to this class. According to the checklist, it's better to be consistent with your margins and add either top or bottom, but not both, to avoid potential margin collapse.


.search-form_big {
width: 100%;
height: 70px;

Choose a reason for hiding this comment

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

Here you are fixing the height of the container. Unless there is a specific requirement to do so, it's better to let the content size dictate the container size. This helps to avoid overflow or accidental scroll bars.


.search-form_small {
width: 100%;
height: 42px;

Choose a reason for hiding this comment

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

The same issue here. You've fixed the height of the container. It's better to let the content size dictate the container size unless there is a specific requirement.

width: 100%;
height: 100%;
border: 1px solid #e1e7ed;
border-radius: 4px;

Choose a reason for hiding this comment

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

Here you are using tag names for styling. According to the checklist, it's better to style all elements using .classes and if needed with :pseudo-classes, pseudo-elements and [attributes].

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