From b183e3b3cbe878a4d5ea42d99b5e2c6f85e32aee Mon Sep 17 00:00:00 2001 From: TatianaFokina Date: Thu, 23 May 2024 13:54:40 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=87=D0=B5=D0=BD=D1=8C=20=D0=BA=D1=80?= =?UTF-8?q?=D0=B8=D0=B2=D0=BE=20=D0=BE=D0=BF=D1=8F=D1=82=D1=8C=20=D1=84?= =?UTF-8?q?=D0=B8=D0=BA=D1=81=D0=B8=D1=80=D1=83=D0=B5=D1=82=20=D1=85=D0=B5?= =?UTF-8?q?=D0=B4=D0=B5=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/blocks/base.css | 7 ++++--- src/styles/blocks/header.css | 34 ++++++++++++++++++++++++++++------ src/styles/blocks/search.css | 2 -- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/styles/blocks/base.css b/src/styles/blocks/base.css index 288540a5..fa516ce8 100644 --- a/src/styles/blocks/base.css +++ b/src/styles/blocks/base.css @@ -13,14 +13,15 @@ } /* TODO: рассчитать правильный отступ при наличии класса aria__controls--expanded */ + .base__body { margin: 0; } .base__body:has(.header--open) { - margin-top: var(--header-height); + top: 56px; } -.base__body:has(.header--open > .header__controls--shrink) { +/* .base__body:has(.header--open > .header__controls--shrink) { padding-top: var(--header-height); -} +} */ diff --git a/src/styles/blocks/header.css b/src/styles/blocks/header.css index c43f14e6..79d7da77 100644 --- a/src/styles/blocks/header.css +++ b/src/styles/blocks/header.css @@ -16,7 +16,7 @@ position: relative; } -/* фиксированное меню на десктопах и планшетах (остальные страницы) */ +/* фиксированное меню на мобилках */ .header--sticky { position: static; } @@ -28,19 +28,31 @@ } } -/* фиксированный дропдаун */ .header--open { position: fixed; - width: 100%; + + /* width: 100%; */ } @media (height <= 450px) { .header--open { + position: fixed; height: 100%; overflow-y: scroll; } } +@media (width >= 768px) { + .header--open { + position: sticky; + width: 100%; + } + + .header--open .header__menu { + position: fixed; + } +} + /* содержимое главного меню (без дропдауна) */ .header__controls { --letter-spacing: -0.06em; @@ -154,14 +166,24 @@ /* дропдаун с разделами */ .header__menu { - height: 100%; + /* position: absolute; */ + + /* position: fixed; */ + width: 100%; + + /* height: 100%; */ font-size: calc(var(--font-size-xl) * 0.95); line-height: calc(var(--font-line-height-xl) * 0.95); letter-spacing: -0.06em; background-color: var(--color-background); - z-index: -1; } +/* @media (width >= 1024px) { + .header__menu { + position: absolute; + } +} */ + /* всегда раскрытый список разделов на главной */ .header--static .header__menu { position: static; @@ -169,8 +191,8 @@ } .header:not(.header--open, .header--static) .header__menu { - height: 0; visibility: hidden; + height: 0; opacity: 0; } diff --git a/src/styles/blocks/search.css b/src/styles/blocks/search.css index 31233945..5b6c29b5 100644 --- a/src/styles/blocks/search.css +++ b/src/styles/blocks/search.css @@ -88,8 +88,6 @@ visibility: hidden; } -/* TODO: починить отступ у горячей клавиши поиска на мобилках? */ - .search__input:placeholder-shown ~ .search__key--enter, .search__input:not(:focus) ~ .search__key--enter { visibility: hidden;