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

ad solution #4533

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

Conversation

t-namestnykova
Copy link

  • DEMO LINK

  • TEST REPORT LINK

  • Icon implemented using background-image CSS property

  • Inputs are written inside of 'form' tag with correctly passed attributes

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

Great job so far! 😊 However, there are a few areas that need improvements. Please consider the feedback on your CSS file, such as avoiding the use of the * selector for all elements, keeping font family consistent, and making your class names more meaningful. Once you've made these changes, your code will be even better! Keep going! 💪

✨ 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-bar search-bar-top"
data-qa="big"
>
<input
class="search-bar-input search-bar-input--top"
type="text"
data-qa="keypress"
placeholder="Try “Los Angeles“"
/>

Choose a reason for hiding this comment

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

You have two forms here that seem to be doing the same thing. Unless they have different purposes, you might want to consider combining them into one form to avoid repetition. This will make your code more DRY (Don't Repeat Yourself), which is a key principle in software development.

src/index.html Outdated
Comment on lines 31 to 40
<form
class="search-bar search-bar-bottom"
data-qa="small"
>
<input
class="search-bar-input search-bar-input--bottom"
type="text"
data-qa="hover"
placeholder="Try “Los Angeles“"
/>

Choose a reason for hiding this comment

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

Same as above, consider combining these forms if they serve the same purpose.

class="search-bar search-bar-top"
data-qa="big"
>
<input

Choose a reason for hiding this comment

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

The class name 'search-bar-input--top' and 'search-bar-input--bottom' do not represent the meaning of the content. Consider renaming these classes to something more meaningful. For example, if the class is intended to style the input differently based on its position, a name like 'search-bar-input-upper' and 'search-bar-input-lower' might be more appropriate.

class="search-bar search-bar-bottom"
data-qa="small"
>
<input

Choose a reason for hiding this comment

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

Same as above, consider renaming 'search-bar-input--bottom' to something more meaningful.

src/style.css Outdated
font-style: normal;
color: #3d4e61;
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 to set the font family, font weight, font style, color, and box-sizing for all elements. This is not recommended as it can impact performance. It's better to set these properties on specific elements that require them. (Refer to the CSS checklist)

src/style.css Outdated
}

* {
font-family: Avenir, Arial, Helvetica, sans-serif;

Choose a reason for hiding this comment

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

You've set the font family to Avenir, Arial, Helvetica, sans-serif. This is good, but remember to use fallback fonts - alternative font-family in case the main one doesn't work. (Refer to the CSS checklist)

src/style.css Outdated
}

.search-bar {
margin-top: 20px;

Choose a reason for hiding this comment

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

You've added a margin-top to the .search-bar class. It's better to be consistent with your margins. Add only top or bottom, but not both, to avoid potential margin collapse. (Refer to the CSS checklist)

border: 1px solid #e1e7ed;
border-radius: 4px;
box-shadow: 0 1px 8px 0 #3d4e611a;
}

Choose a reason for hiding this comment

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

You've set the width and height of the .search-bar-input class to 100%. This can cause issues if the parent container's size is not fixed. It's generally better not to fix container size, and let the content size dictate it. This helps to avoid overflow or accidental scroll bar. (Refer to the CSS checklist)

box-shadow: rgba(0, 0, 0, 0.25);
font-family: Avenir-Heavy, sans-serif;
outline: none;
}

Choose a reason for hiding this comment

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

In the .search-bar-input:focus class, you've changed the font family. This can lead to a sudden change in the layout when the input is focused, which may not be a good user experience. It's better to keep the font family consistent across different states of an element.

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 HTML and CSS! 😊 However, there are a few improvements to be made in your CSS code. Please ensure the correct use of font-family and consider not fixing container sizes unless necessary. Also, remember to include a fallback font. Keep up the good work and make these minor changes to enhance your code quality! 👍

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

Comment on lines +7 to +8
@font-face {
font-family: Avenir-Heavy;

Choose a reason for hiding this comment

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

It seems like you've declared a new font-family 'Avenir-Heavy'. Ideally, you should only declare the base font family once (i.e., 'Avenir') and then use the 'font-weight' property to control the boldness of the font. The browser will then choose the closest available font weight. This is important for the consistency and maintainability of your CSS code.

border-radius: 4px;
box-shadow: 0 1px 8px 0 #3d4e611a;

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 declared the 'Avenir' font here, but there's no fallback font. It's a good practice to always include a fallback font, in case the custom font doesn't load. For example, you can use a generic font family like 'sans-serif' as a fallback.

src/style.css Outdated
}

.search-bar {
margin-top: 20px;

Choose a reason for hiding this comment

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

It's recommended to be consistent with your margins. Here you've added a top margin, but in a real-world scenario, it's better to stick to just one direction (either top or bottom) to avoid potential margin collapse problems.

src/style.css Outdated

.search-bar-top {
height: 70px;
margin-top: 20px;

Choose a reason for hiding this comment

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

Be careful with fixing container size. In this case, you've fixed the height for '.search-bar-top'. Unless it's a specific requirement, it's better to let the content dictate the size of the container to avoid overflow or accidental scroll bar.

src/style.css Outdated
}

.search-bar-bottom {
height: 42px;

Choose a reason for hiding this comment

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

The same comment about fixing container size applies here for '.search-bar-bottom'. It's better to let the content size dictate the container size.

border-radius: 4px;
box-shadow: 0 1px 8px 0 #3d4e611a;

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 used the 'Avenir' font here, but it seems you've declared a new font-family 'Avenir-Heavy' at the beginning of your CSS. Remember to use the correct font-family name when applying it to your elements.

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 the HTML and CSS! The code is clean and well-structured. However, there are a few things to note. Firstly, always provide a fallback font-family in case your chosen font fails to load. Secondly, use semantic names for your font-families and control the weight via the 'font-weight' property. Keep up the good work and continue to improve your coding skills! 👍

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

}

@font-face {
font-family: Avenir-Heavy;

Choose a reason for hiding this comment

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

The font-family name 'Avenir-Heavy' is not semantic. It would be better to use 'Avenir' as the font-family for all related fonts, and control the weight via the 'font-weight' property. This way, you can easily switch between font weights without having to change the font-family.

border-radius: 4px;
box-shadow: 0 1px 8px 0 #3d4e611a;

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 have specified 'Avenir' as the font-family, but you haven't provided a fallback font. If the 'Avenir' font fails to load for any reason, the browser will use the default font, which may not fit your design. It's a good practice to specify a fallback font that is widely available across different systems. For example: font-family: Avenir, Arial, sans-serif;

.search-bar__input:focus {
box-shadow: 0 1px 8px 0 rgba(0, 0, 0, 0.25);
outline: none;
font-family: Avenir-Heavy, sans-serif;

Choose a reason for hiding this comment

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

Same as before, remember to provide a fallback font-family.

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