From 9cd345cdfe3256be8fd8e64f4a4829f656b63c72 Mon Sep 17 00:00:00 2001 From: Pavel Miroshnykov Date: Tue, 17 Sep 2024 22:56:21 +0300 Subject: [PATCH 1/2] add task solution --- readme.md | 4 +-- src/index.html | 96 +++++++++++++++++++++++++++++++++++++++++++++++++- src/style.css | 73 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 170 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index e72b8051e7..ab68231caf 100644 --- a/readme.md +++ b/readme.md @@ -27,8 +27,8 @@ The page should match the design Pixel Perfect: all the sizes, colors and distan ❗️ Replace `` with your Github username and copy the links to `Pull Request` description: -- [DEMO LINK](https://.github.io/layout_moyo-header/) -- [TEST REPORT LINK](https://.github.io/layout_moyo-header/report/html_report/) +- [DEMO LINK](https://miroshnykow.github.io/layout_moyo-header/) +- [TEST REPORT LINK](https://miroshnykow.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. diff --git a/src/index.html b/src/index.html index b39fe97123..2fe865cfee 100644 --- a/src/index.html +++ b/src/index.html @@ -11,12 +11,106 @@ content="ie=edge" /> Moyo header + + + -

Moyo header

+
+ + + +
diff --git a/src/style.css b/src/style.css index 293d3b1f13..a78d681719 100644 --- a/src/style.css +++ b/src/style.css @@ -1,3 +1,76 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + list-style: none; +} + body { margin: 0; + padding: 0; +} + +.header { + max-width: 1200px; + display: flex; + justify-content: space-between; + align-items: center; + font-family: Roboto, system-ui; + font-size: 12px; + font-weight: 500; + position: relative; + padding: 0 50px; + margin: 0 auto; +} + +.logo { + display: block; + height: 40px; + width: 40px; +} + +.nav__list { + display: flex; + align-items: center; + justify-content: space-between; + text-align: center; + padding: 0; +} + +.nav__item { + list-style: none; + line-height: 60px; +} + +.nav__link { + display: block; + height: 60px; + text-decoration: none; + color: #000; + text-transform: uppercase; + position: relative; +} + +.is-active { + color: #00acdc; +} + +.is-active::after { + position: absolute; + left: 0; + bottom: 0; + content: ''; + display: block; + width: 100%; + height: 4px; + background-color: #00acdc; + border-radius: 2px; +} + +.nav__item[data-qa='hover']:hover .nav__link { + color: #00acdc; +} +/* stylelint-disable-next-line rule-empty-line-before */ +.nav__item:not(:last-child) { + margin-right: 20px; } From 8baf8419d7c48869c89334a8cf527be83e29bb1d Mon Sep 17 00:00:00 2001 From: Pavel Miroshnykov Date: Wed, 18 Sep 2024 06:59:59 +0300 Subject: [PATCH 2/2] add color variables --- src/style.css | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/style.css b/src/style.css index a78d681719..5b3caf77ca 100644 --- a/src/style.css +++ b/src/style.css @@ -21,6 +21,8 @@ body { position: relative; padding: 0 50px; margin: 0 auto; + + --nav-link-color: #00acdc; } .logo { @@ -52,7 +54,7 @@ body { } .is-active { - color: #00acdc; + color: var(--nav-link-color); } .is-active::after { @@ -63,14 +65,14 @@ body { display: block; width: 100%; height: 4px; - background-color: #00acdc; + background-color: var(--nav-link-color); border-radius: 2px; } -.nav__item[data-qa='hover']:hover .nav__link { - color: #00acdc; -} -/* stylelint-disable-next-line rule-empty-line-before */ .nav__item:not(:last-child) { margin-right: 20px; } + +.nav__link:hover { + color: var(--nav-link-color); +}