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

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

Develop #5372

Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ The page should match the design Pixel Perfect: all the sizes, colors and distan

❗️ Replace `<your_account>` with your Github username and copy the links to `Pull Request` description:

- [DEMO LINK](https://<your_account>.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_moyo-header/report/html_report/)
- [DEMO LINK](https://yevhen-loboda.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://yevhen-loboda.github.io/layout_moyo-header/report/html_report/)

❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it.

Expand Down
95 changes: 94 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,101 @@
rel="stylesheet"
href="./style.css"
/>
<!-- <link rel="stylesheet" href="https://fonts.google.com/specimen/Roboto"> -->
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
yevhen-loboda marked this conversation as resolved.
Show resolved Hide resolved
rel="stylesheet"
/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a
href="index.html"
class="logo"
>
yevhen-loboda marked this conversation as resolved.
Show resolved Hide resolved
<img
src="images/logo.png"
class="logo__image"
alt="Moyo Logo"
/>
</a>
<nav class="nav">
<ul class="nav__list">
<li>
<a
href="#"
class="nav__item is-active"
>
yevhen-loboda marked this conversation as resolved.
Show resolved Hide resolved
Apple
</a>

Choose a reason for hiding this comment

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

Class names represent the meaning of the content. The class name 'is-active' on line 49 could be more descriptive of its purpose, such as 'nav__item--active'.

</li>
<li>
<a
href="#"
class="nav__item"
>
Samsung
</a>
</li>
<li>
<a
href="#"
class="nav__item"
>
Smartphones
</a>
</li>
<li>
<a
href="#"
data-qa="hover"
class="nav__item"
>
Laptops & Computers
</a>
</li>
<li>
<a
href="#"
class="nav__item"
>
Gadgets
</a>
</li>
<li>
<a
href="#"
class="nav__item"
>
Tablets
</a>
</li>
<li>
<a
href="#"
class="nav__item"
>
Photo
</a>
</li>
<li>
<a
href="#"
class="nav__item"
>
Video
</a>
</li>

Choose a reason for hiding this comment

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

Add empty lines between multiline sibling blocks of HTML. There should be empty lines between the <li> elements to make the code more readable.

</ul>
</nav>
</header>
</body>
</html>
80 changes: 80 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,83 @@
body {
margin: 0;
padding: 0;
}

html {
font-family: Roboto, sans-serif;

Choose a reason for hiding this comment

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

Consider adding a fallback font-family for Roboto in case it fails to load. For example, font-family: Roboto, Arial, sans-serif; ensures that there will be a similar font displayed if Roboto is not available.

font-size: 12px;
font-weight: 500;

/* line-height: 14.06px; */

--active-color: #00acdc;
}

.header {
display: flex;
width: 100%;
align-items: center;
justify-content: space-between;
}

.nav {
margin: 0 50px 0 0;
}
Comment on lines +23 to +25

Choose a reason for hiding this comment

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

Avoid using specific side margins for elements like .nav. It can lead to unexpected layouts on different screen sizes. Consider using padding within the parent element or CSS Grid/Flexbox properties for spacing.


.nav__list {
display: flex;
margin: 0;
padding: 0;
list-style: none;
}

.nav__item {
display: block;
height: 60px;
line-height: 60px;

color: #000;
text-decoration: none;
text-transform: uppercase;
}

li {
margin-right: 20px;
}
Comment on lines +44 to +46

Choose a reason for hiding this comment

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

Styling using tag names can cause unwanted side effects if the same tag is used in a different context. Use class names to apply styles to specific elements. Replace the li selector with a class selector, for example .nav__item.


li:last-child {
margin-right: 0;
}

.is-active::after {
position: absolute;
bottom: 0;
display: block;
content: '';
height: 4px;
width: 100%;
background-color: var(--active-color);
border-radius: 8px;
}

.logo__image {
display: block;
width: 40px;
height: 40px;
margin: 10px 0 10px 50px;
}

a {
text-decoration: none;
padding: 0;
margin: 0;
}

a:hover {
color: var(--active-color);
}

.is-active {
color: var(--active-color);
position: relative;
}
Loading