/
outthevoid
/
frontend_developer
Обзор
Документация
Войти
/
outthevoid
/
frontend_developer
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/styles/modules/header.scss
410 строк
6 KB
darthmorgot
Мелкие правки стилей.
18 янв 2024, 12:03
18 янв 2024, 12:03
812651c
Код
Авторство
О чём код?
// header .header { padding: 17px 60px 23px; background-image: linear-gradient(to bottom, $white 40px, $yellow 40px); &__top { margin-bottom: 30px; } &__main { display: flex; flex-wrap: wrap; margin-bottom: 30px; } &__nav { display: flex; flex-wrap: wrap; } } .logo { display: block; width: 145px; height: 36px; } .logo[href]:hover { opacity: 0.6; } .logo[href]:focus { outline: 2px solid $violet; } .logo[href]:active { opacity: 0.3; } .header-main { &__user { width: 230px; padding-top: 6px; } &__auth { display: flex; flex-wrap: wrap; margin: auto; padding: 0; list-style: none; font-size: 18px; line-height: 30px; } &__menu { position: relative; display: flex; flex-wrap: wrap; margin-left: auto; padding-top: 5px; } &__link { position: relative; display: block; margin-right: 16px; font-size: 18px; line-height: 30px; color: $black; } &__link:hover { opacity: 0.6; } &__link:active { opacity: 0.3; } &__link:focus { outline: 2px solid $violet; } &__link--compare::before { content: ""; display: inline-block; width: 13px; height: 21px; margin-right: 11px; margin-left: 1px; background: url("Images/icons/icon-sort.svg") no-repeat center center; vertical-align: text-bottom; } &__link--cart { margin-right: 0; padding-left: 17px; } &__link--cart::before { content: ""; display: inline-block; width: 16px; height: 25px; margin-right: 11px; margin-left: 1px; background: url("Images/icons/icon-cart.svg") no-repeat center center; vertical-align: text-bottom; } &__counter { display: inline-block; position: absolute; top: 5px; left: 4px; padding: 2px 6px; font-size: 14px; line-height: 17px; border-radius: 50%; background-color: $white; text-align: center; } } // Auth list .auth-list { &__item { margin-right: 28px; } &__item:last-child { margin-right: 0; } &__item:nth-child(1) > &__link::before { content: ""; display: inline-block; width: 14px; height: 13px; margin-right: 12px; background: url("Images/icons/icon-login.svg") no-repeat center center; } &__item:nth-child(2) a { opacity: 0.3; } &__link { display: block; padding-left: 1px; } &__link:hover { opacity: 0.6; } &__link:active { opacity: 0.3; } &__link:focus { outline: 2px solid $violet; } } .form-search { display: flex; position: relative; margin-right: 26px; &__input { width: 357px; padding: 6px 10px 6px 45px; line-height: 20px; border: 2px solid $black; border-right: none; border-radius: 50px 0 0 50px; background-color: $yellow; } &__input::placeholder { color: $black; opacity: 0.3; } &__input:focus { outline: 2px solid $violet; } &__input:disabled, &__input:disabled + &__icon::before { opacity: 0.3; } &__icon::before { content: ""; position: absolute; top: 12px; left: 16px; width: 16px; height: 16px; background: url("Images/icons/icon-search.svg") no-repeat; } &__btn { width: 160px; padding-top: 9px; padding-bottom: 7px; line-height: 20px; border: 2px solid $black; border-radius: 0 50px 50px 0; background-color: $yellow; text-transform: none; } &__btn:hover { color: $white; background-color: $black; } &__btn:active { color: rgba(255 255 255 / 30%); } &__btn:focus { outline: 2px solid $violet; } &__btn:disabled { opacity: 0.3; } } .nav { &__wrapper-btn-list { position: relative; z-index: 1; } &__btn { display: flex; align-items: center; padding: 0; width: 293px; text-align: left; letter-spacing: 0.2em; } &__btn::after { content: ""; display: inline-block; width: 50px; height: 50px; margin-left: 16px; background: url("Images/icons/icon-plus-ellipse.svg") no-repeat right bottom; opacity: 0.3; } &__btn:hover::after { opacity: 1; } &__btn:focus { outline: 2px solid $violet; } &__btn:focus::after { background: url("Images/icons/icon-minus-ellipse.svg") no-repeat right bottom; } &__wrapper-btn-list:hover &__wrapper-list, &__wrapper-btn-list:focus-within &__wrapper-list { display: block; } &__wrapper-list { display: none; position: absolute; top: 51px; width: 1160px; margin-left: -60px; margin-right: -60px; padding: 13px 60px 57px; background-color: $yellow; } &__list { display: grid; grid-template-columns: 252px 212px 212px; grid-template-rows: repeat(3, auto); row-gap: 18px; padding: 0; margin: 0; line-height: 18px; list-style: none; } &__item:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 2; } &__item:nth-child(2) { grid-column: 1 / 2; grid-row: 2 / 3; } &__item:nth-child(3) { grid-column: 1 / 2; grid-row: 3 / 4; } &__item:nth-child(4) { grid-column: 2 / 3; grid-row: 1 / 2; } &__item:nth-child(5) { grid-column: 2 / 3; grid-row: 2 / 3; } &__item:nth-child(6) { grid-column: 3 / 4; grid-row: 1 / 2; } &__link { color: $black; } &__link:hover { opacity: 0.6; } &__link:active { opacity: 0.3; } &__link:focus { outline: 2px solid $violet; } &__link--current { position: relative; } &__link--current::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 1px; background-color: $black; } // Services list &__services { display: grid; grid-template-columns: repeat(3, auto); column-gap: 44px; width: 471px; padding: 0; margin: 0; margin-left: auto; list-style: none; } &__service-item { padding-top: 15px; } &__service-item:nth-child(2) { margin-right: 4px; } &__service-link { display: block; text-transform: uppercase; letter-spacing: 0.2em; } &__service-link:hover { opacity: 0.6; } &__service-link:active { opacity: 0.3; } &__service-link:focus { outline: 2px solid $violet; } &__service-link--current { position: relative; } &__service-link--current::after { content: ""; position: absolute; right: 0; bottom: 12px; left: 0; height: 2px; background-color: $black; } }