Skip to content
Snippets Groups Projects
header.sass 4.25 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 var(--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
        .menu
            a,
            a:hover,
            a:focus,
            span
        @if $header-sticky-invert-logo
            .logo
                img, .logo-text
                    filter: invert(1)
        @include media-breakpoint-up(desktop)
            .dropdown-menu
                background: $header-sticky-dropdown-background
                color: $header-sticky-dropdown-color
    &.is-sticky
        .pagefind-ui__toggle
            color: $header-sticky-color
    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
alexisben's avatar
alexisben committed
        @extend %logo
Olivia206's avatar
Olivia206 committed
        color: $header-color
alexisben's avatar
alexisben committed
        img
alexisben's avatar
alexisben committed
            height: $header-logo-height
            @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 &,
alexisben's avatar
alexisben committed
    html.has-modal-opened &,
alexisben's avatar
alexisben committed
    html.has-offcanvas-opened &
alexisben's avatar
alexisben committed
        overflow: hidden
        height: 100%
        min-height: -webkit-fill-available
alexisben's avatar
alexisben committed
        &::after
            display: block
            opacity: 1
            pointer-events: inherit
alexisben's avatar
alexisben committed
    html.has-offcanvas-opened &
alexisben's avatar
alexisben committed
        &::after
            background-color: $toc-overlay-color
alexisben's avatar
alexisben committed
            z-index: $zindex-header + 1
alexisben's avatar
alexisben committed
    html.has-modal-opened &
        &::after
            z-index: $zindex-modal - 1
alexisben's avatar
alexisben committed
    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
        > .container
alexisben's avatar
alexisben committed
            align-items: center
            display: flex
            flex-wrap: wrap
            justify-content: space-between
alexisben's avatar
alexisben committed
        .header-button
alexisben's avatar
alexisben committed
            @include button-reset
            display: none
            border: 0
            color: inherit
            padding: 0
            position: relative
alexisben's avatar
alexisben committed
            text-transform: uppercase
            line-height: 1
alexisben's avatar
alexisben committed
            &:focus
                box-shadow: none
            &:focus-visible
                outline-color: gray
                outline-offset: 5px
                outline-style: dashed
                outline-width: 1px
Olivia206's avatar
Olivia206 committed
            @include media-breakpoint-down(desktop)
                display: flex
                align-items: center
alexisben's avatar
alexisben committed
            span:first-of-type
                @include meta
alexisben's avatar
alexisben committed
                font-size: pxToRem(14)
alexisben's avatar
alexisben committed
            span:last-of-type
                background: none
                @include icon-block(menu-line, before)
alexisben's avatar
alexisben committed
                    vertical-align: baseline
alexisben's avatar
alexisben committed
                    margin-right: $icon-burger-margin-right
alexisben's avatar
alexisben committed
            &[aria-expanded="true"]
                span:last-of-type
                    &::before
                        content: map-get($icons, "close-line")
alexisben's avatar
alexisben committed
                        margin-right: $icon-close-margin-right