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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
5 changes: 3 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Moyo header

Create HTML page with the header using `flexbox` based on the [Figma Mockup](https://www.figma.com/file/1sog2rmfyCjnVxkeZ3ptnc/MOYO-%2F-Header?node-id=0%3A1&mode=dev).

The page should match the design Pixel Perfect: all the sizes, colors and distanced MUST be the same as on the design.
Expand Down Expand Up @@ -27,8 +28,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://pat5513.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://pat5513.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
104 changes: 102 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Moyo header</title>
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
Expand All @@ -10,13 +11,112 @@
http-equiv="X-UA-Compatible"
content="ie=edge"
/>
<title>Moyo header</title>
<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"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="./style.css"
/>
</head>

<body>
<h1>Moyo header</h1>
<header class="header">
<a
href="index.html"
class="header__logo"
>
<img
src="images/logo.png"
alt="moyo logo"
/>
</a>

<nav class="navigation">
<ul class="nav_list">
<li class="nav_item">
<a
href="index.html"
class="is-active nav_link"
>
apple
</a>
</li>

<li class="nav_item">
<a
href="index.html"
class="nav_link"
>
samsung
</a>
</li>

<li class="nav_item">
<a
href="index.html"
class="nav_link"
>
smartphones
</a>
</li>

<li class="nav_item">
<a
href="index.html"
class="nav_link"
data-qa="hover"
>
laptops & computers
</a>
</li>

<li class="nav_item">
<a
href="index.html"
class="nav_link"
>
gadgets
</a>
</li>

<li class="nav_item">
<a
href="index.html"
class="nav_link"
>
tablets
</a>
</li>

<li class="nav_item">
<a
href="index.html"
class="nav_link"
>
photo
</a>
</li>

<li class="nav_item">
<a
href="index.html"
class="nav_link"
>
video
</a>
</li>
</ul>
</nav>
</header>
</body>
</html>
74 changes: 74 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
:root {
--link-on: #00acdc;
--link-off: black;
}

body {
margin: 0;
font-family: Roboto, sans-serif;
font-weight: 500;
}

.header {
display: flex;
justify-content: space-between;
padding: 0 50px;
}

.header__logo {
align-self: center;
display: flex;
}

.navigation {
display: flex;
align-items: center;
}

.nav_list {
Copy link

Choose a reason for hiding this comment

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

ul tag is also applying some left padding. Thats why test's are failing.

display: flex;
list-style: none;
margin: 0;
}

.nav_item {
display: flex;
}

.nav_link {
color: var(--link-off);
text-decoration: none;
font-size: 12px;
text-transform: uppercase;
align-items: center;
display: flex;
height: 60px;
margin-left: 20px;
}

.nav_link:visited {
color: var(--link-off);
}

.nav_link:hover {
color: var(--link-on);
}

.nav_link:active {
color: var(--link-on);
position: relative;
}

.is-active {
color: var(--link-on);
Copy link

Choose a reason for hiding this comment

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

This color is not applied to the active link because .nav_link:visited has higher specificity. You have to increase specificity of this selector to apply that active color.

Copy link

Choose a reason for hiding this comment

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

It should be

.nav_link.is_active {
}

To be more precise

margin-left: 0;
Copy link

Choose a reason for hiding this comment

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

reset of margin with is-active is bad. You should use :first-child pseudo class fro this

position: relative;
}

.is-active::after {
content: '';
display: block;
border-bottom: 4px solid var(--link-on);
position: absolute;
border-radius: 2px;
Copy link

Choose a reason for hiding this comment

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

I think that border radius on that underline should be higher. In figma i believe its 8px

left: 0;
right: 0;
bottom: 0;
}
Loading