Skip to content
Snippets Groups Projects
header.sass 3.95 KiB
Newer Older
alexisben's avatar
alexisben committed
header#document-header
    background: $header-background
alexisben's avatar
alexisben committed
    border-bottom: $header-border-bottom-width solid $color-border
alexisben's avatar
alexisben committed
    color: $header-color
    position: fixed
    left: 0
    transition: transform $header-sticky-transition, background $header-sticky-transition
    top: 0
    width: 100%
alexisben's avatar
alexisben committed
    z-index: $zindex-header
    @include media-breakpoint-down(desktop)
alexisben's avatar
alexisben committed
        border-bottom: 0
Olivia206's avatar
Olivia206 committed
        width: 100%
alexisben's avatar
alexisben committed
    .dropdown-menu
        transition: background $header-sticky-transition
    &.is-sticky, html.has-menu-opened &
        background: $header-sticky-background
        color: $header-sticky-color
alexisben's avatar
alexisben committed
        .dropdown-menu
            background: $header-sticky-dropdown-background
        .menu
            a,
            a:hover,
            a:focus,
            a:active
alexisben's avatar
alexisben committed
                color: inherit
            a:not(:hover)
                text-decoration-color: transparent
            span
                color: $header-sticky-color
        @if $header-sticky-invert-logo
            .logo img
                filter: invert(1)
    html.is-scrolling-down:not(.has-menu-opened) &
        @include media-breakpoint-down(desktop)
            transform: translateY(-100%)
        @include media-breakpoint-up(desktop)
            &:not(:hover)
alexisben's avatar
alexisben committed
                transform: translateY(-100%)
alexisben's avatar
alexisben committed
    .logo
        img
            display: block
alexisben's avatar
alexisben committed
            height: $header-logo-height
alexisben's avatar
alexisben committed
            width: auto
            @if $header-sticky-invert-logo
                transition: filter $header-sticky-transition
            @include media-breakpoint-up(desktop)
alexisben's avatar
alexisben committed
                height: $header-logo-height-desktop
alexisben's avatar
alexisben committed
    @include media-breakpoint-down(desktop)
        html.has-menu-opened &
alexisben's avatar
alexisben committed
            nav
alexisben's avatar
alexisben committed
                padding-bottom: 0
alexisben's avatar
alexisben committed
// TODO : Est-ce au bon endroit ?
body
    &::after
        @include inset(0)
        background-color: $body-overlay-color
        content: ""
        pointer-events: none
        position: fixed
        opacity: 0
        transition: opacity $header-transition
        z-index: $zindex-body-overlay

    html.has-menu-opened &,
    html.has-offcanvas-opened &
        &::after
            display: block
            opacity: 1
            pointer-events: inherit
    html.has-offcanvas-opened &
        &::after
            z-index: $zindex-header + 1
    html.is-animating:not(.has-menu-opened) &
        &::after
            display: block
            opacity: 0

alexisben's avatar
alexisben committed
header#document-header
    nav
alexisben's avatar
alexisben committed
        padding-top: $header-nav-padding-y
alexisben's avatar
alexisben committed
        padding-bottom: $header-nav-padding-y
alexisben's avatar
alexisben committed
        @include media-breakpoint-up(desktop)
            padding-top: $header-nav-padding-y-desktop
            padding-bottom: $header-nav-padding-y-desktop
alexisben's avatar
alexisben committed
        .container
            align-items: center
            display: flex
            flex-wrap: wrap
            justify-content: space-between
        button[type="button"]
            @include button-reset
            display: none
            border: 0
            color: inherit
            padding: 0
            position: relative
alexisben's avatar
alexisben committed
            text-transform: uppercase
            line-height: 1
            @include media-breakpoint-down(desktop)
alexisben's avatar
alexisben committed
                display: flex
                align-items: center
            &:focus
                box-shadow: none
            &:focus-visible
                outline-color: gray
                outline-offset: 5px
                outline-style: dashed
                outline-width: 1px
            span:first-of-type
                @include meta
alexisben's avatar
alexisben committed
                font-size: 14px
alexisben's avatar
alexisben committed
            span:last-of-type
                background: none
alexisben's avatar
alexisben committed
                display: block
                padding: half($spacing0) 0 half($spacing0) half($spacing0)
                line-height: 1
                @include icon("burger", before, 11px)
                    vertical-align: baseline
alexisben's avatar
alexisben committed
            &[aria-expanded="true"]
                span:last-of-type
                    &::before
                        content: map-get($icons, "close")
alexisben's avatar
alexisben committed
                        font-size: 12px