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

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

Develop #978

wants to merge 19 commits into from

Conversation

Mykyta-snacj
Copy link

@Mykyta-snacj Mykyta-snacj commented Aug 29, 2024

I'm trying to make a responsive 'header'. Please check my code and give some advice.
DEMO LINK.

@Mykyta-snacj
Copy link
Author

I'm trying to make a responsive 'header'. Please check my code and give some advice.

https://Mykyta-snacj.github.io/layout_dia/

Copy link

@natalia-klonowska natalia-klonowska left a comment

Choose a reason for hiding this comment

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

it's a nice start 😃 but when creating responsive navigation it should adjust to screen size (horizontal margins stays the same) instead of increasing margins (except after 1024px)
image

Comment on lines +52 to +60
<a
href="#menu"
class="navigation__item navigation__item--menu"
>
<img
src="./images/Vector.svg"
alt="menu"
/>
</a>

Choose a reason for hiding this comment

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

for desktop you should replace burger menu with links (you can make use of display: none)

Comment on lines +86 to +92
<div class="header__slider-block">
<img
src="../src/images/slider/slide-img-1.jpg"
alt="slide"
class="header__slider-image"
/>
</div>

Choose a reason for hiding this comment

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

you should center position of this image and only clip sides (you can change it for the one used in design to better see differences)

Comment on lines 22 to 26
&--menu img {
vertical-align: bottom;
width: 18px;
height: 8px;
}

Choose a reason for hiding this comment

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

don't use tags to improve consistent with specificity ;)

@Mykyta-snacj
Copy link
Author

I'm trying to make a responsive 'header'. Please check my code and give some advice.
DEMO LINK.

@Mykyta-snacj
Copy link
Author

Please check my code and give some advice.
DEMO LINK.

Copy link

@Zibi95 Zibi95 left a comment

Choose a reason for hiding this comment

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

Hey, I’ve left some comments in the code. So far, great work! 🥇

Comment on lines 3 to 14
.list {
display: none;

@include for-desktop {
display: flex;
gap: 48px
}

@include for-large {
display: flex;
gap: 48px;
}
Copy link

Choose a reason for hiding this comment

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

There is a significant amount of repeated code.

Comment on lines 18 to 28
@mixin for-tablet {
@media (min-width: 640px) and (max-width: 1024px) {
@content;
}
}

@mixin for-desktop {
@media (min-width: 1024px) and (max-width: 1600px) {
@content;
}
}
Copy link

Choose a reason for hiding this comment

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

I believe that your approach of using both min-width and max-width in media queries is excessive for this design. It results in a lot of repeated styles.

Comment on lines +159 to +172
@include for-desktop {
width: calc(50% - (20px) / 2);
left: auto;
height: 680px;
border-radius: 30px 0;
}

@include for-large {
width: calc(50% - ((30px) / 2) - (30px + 68px));
left: auto;
height: 680px;
border-radius: 30px 0;
}
}
Copy link

Choose a reason for hiding this comment

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

A border radius should only be applied to the top-left corner of the image for screen widths between 1024px and 1600px.
image

@Mykyta-snacj
Copy link
Author

Pay attention to the services section. Perhaps there are options to simplify the code. Hope you can help

Copy link

@Zibi95 Zibi95 left a comment

Choose a reason for hiding this comment

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

Looks solid. That weird value for template rows is weird maybe it can be done simpler.

src/index.html Outdated
>
<p class="services__section-name">Services</p>

<h2 class="main__title services__title">
Copy link

Choose a reason for hiding this comment

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

You broke BEM rule here: The parent block element cannot be used inside another, nested block.

@include for-tablet {
padding: 148px 41px 48px;

grid-template-rows: auto auto 51px 132px 162px 132px 162px 132px;
Copy link

Choose a reason for hiding this comment

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

Whoa, that's a weird value! 🤯 I think you don't have to do such complex calculations with rows. And just declare that it should be in x row. Then just tweak its position with margin.

@Mykyta-snacj
Copy link
Author

Please check my mobile version and give some advices

Copy link

@danon321 danon321 left a comment

Choose a reason for hiding this comment

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

Looks fine for me :))

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