Skip to content
Snippets Groups Projects
pages.sass 9.14 KiB
Newer Older
alexisben's avatar
alexisben committed
.block-pages
alexisben's avatar
alexisben committed
    .top
        a
            text-decoration: none
    .grid, .cards, .list
alexisben's avatar
alexisben committed
        article
alexisben's avatar
alexisben committed
            position: relative
alexisben's avatar
alexisben committed
            display: flex
            flex-direction: column
            .media
alexisben's avatar
alexisben committed
                @include handle-svg-fit
alexisben's avatar
alexisben committed
                order: -1
                &:empty
                    display: none
alexisben's avatar
alexisben committed
                img
                    display: block
                    aspect-ratio: 16/9
                    object-fit: cover
alexisben's avatar
alexisben committed
                    width: 100%
        .page-title
            @include h3
alexisben's avatar
alexisben committed
            a
alexisben's avatar
alexisben committed
                @include stretched-link(before)
                text-decoration: none
alexisben's avatar
alexisben committed
            + p
alexisben's avatar
alexisben committed

    @include media-breakpoint-up(desktop)
alexisben's avatar
alexisben committed
        .top
alexisben's avatar
alexisben committed

    @include media-breakpoint-down(desktop)
alexisben's avatar
alexisben committed
        .top
alexisben's avatar
alexisben committed
            .block-title
alexisben's avatar
alexisben committed
                @include h5
alexisben's avatar
alexisben committed
        .description
            @include h2
        article
alexisben's avatar
alexisben committed

    @include in-page-without-sidebar
alexisben's avatar
alexisben committed
            a
                @include icon(arrow, after, true)
                @include hover-translate-icon
            .description
                @include h2
alexisben's avatar
alexisben committed

alexisben's avatar
alexisben committed
    &--grid
        .top
            @include top-flex
alexisben's avatar
alexisben committed
        .grid
alexisben's avatar
alexisben committed
            a
alexisben's avatar
alexisben committed
                @include icon(arrow, after, true)
alexisben's avatar
alexisben committed
                @include hover-translate-icon(after)
        @include media-breakpoint-up(desktop)
alexisben's avatar
alexisben committed
            .grid
Arnaud Levy's avatar
Arnaud Levy committed
                @include grid(2)
alexisben's avatar
alexisben committed
                @include in-page-without-sidebar
Arnaud Levy's avatar
Arnaud Levy committed
                    @include grid(3)
alexisben's avatar
alexisben committed

    &--cards
        background-color: $block-pages-card-background
        padding-bottom: var(--grid-gutter)
        padding-top: var(--grid-gutter)
alexisben's avatar
alexisben committed
        *:not(.heading) + &
            margin-top: 0
alexisben's avatar
alexisben committed
        .blocks &:last-of-type
            margin-bottom: 0
        .top
            @include top-flex
alexisben's avatar
alexisben committed
        .cards
alexisben's avatar
alexisben committed
            @include grid(2, desktop)
alexisben's avatar
alexisben committed
            @include in-page-without-sidebar
Arnaud Levy's avatar
Arnaud Levy committed
                @include grid(3)
alexisben's avatar
alexisben committed
        // TODO: move this //
        .block-gallery + &,
        .block-pages--cards + &
            margin-top: 0
        // ----------------- //
        .card
alexisben's avatar
alexisben committed
            background-color: $block-pages-card-page-background
            transition: background 0.3s, color 0.3s
            display: flex
            flex: auto
            flex-direction: column
            min-height: 320px
            &,
            a
                color: $block-pages-card-page-color
            .media
                margin-bottom: 0
                margin-left: -$spacing-3
                margin-right: -$spacing-3
                margin-top: -$spacing-3
                img
                    min-width: 100%
alexisben's avatar
alexisben committed
            .more
alexisben's avatar
alexisben committed
                @include arrow-right-hover
alexisben's avatar
alexisben committed
                @include icon-block(arrow-right, after)
alexisben's avatar
alexisben committed
                @include link($block-pages-card-page-color)
                position: relative
                margin-top: auto
alexisben's avatar
alexisben committed
                display: flex
                justify-content: space-between
                align-items: center
            &:hover
                .more:after
                    opacity: 1
                    transform: translateX(0)
            a,
            .more
                transition: text-decoration-color .3s ease, color .3s ease
            &:hover
                background-color: $block-pages-card-page-background-hover
alexisben's avatar
alexisben committed
                &, a, .more
alexisben's avatar
alexisben committed
                    color: $block-pages-card-page-color-hover
                .more
                    text-decoration-color: $block-pages-card-page-color-hover
alexisben's avatar
alexisben committed
    &--list
        ul
            @include list-reset
            li
                display: block
                + li
alexisben's avatar
alexisben committed
                    @include icon(arrow, before, true)
alexisben's avatar
alexisben committed
                    @include hover-translate-icon(before, 5)
alexisben's avatar
alexisben committed
                    @extend %underline-on-hover
                article
                    .page-title
                        @include h3
                        a
                            @include icon(arrow, after, true)
                            @include hover-translate-icon(after)
alexisben's avatar
alexisben committed
                            @extend %underline-on-hover
        @include media-breakpoint-down(desktop)
alexisben's avatar
alexisben committed
            .top
alexisben's avatar
alexisben committed
            ul
        @include media-breakpoint-up(desktop)
            ul:not(.title-only)
                li + li
                    margin-top: var(--grid-gutter)
                article
                    gap: var(--grid-gutter)
                    flex-direction: row
                    .media
                        flex-shrink: 0
                        margin-bottom: 0
alexisben's avatar
alexisben committed
        @include in-page-with-sidebar
            .block-content
                .top
                ul.title-only
                    @include grid(2, desktop, 0)
                    display: flex
alexisben's avatar
alexisben committed
                    li
                        margin-top: 0
                article
Arnaud Levy's avatar
Arnaud Levy committed
                    gap: var(--grid-gutter)
Arnaud Levy's avatar
Arnaud Levy committed
                        width: columns(2)
                    .page-content
alexisben's avatar
alexisben committed
                        width: columns(6)
alexisben's avatar
alexisben committed
            .block-title
                a
                    @include stretched-link(before)
            .top
                .description
                    p
                        @include h2
            article
                .media
Arnaud Levy's avatar
Arnaud Levy committed
                    width: columns(2)
                .page-content
Arnaud Levy's avatar
Arnaud Levy committed
                    width: columns(4)
            &:not(.with-description)
                ul.title-only
                    @include grid(4, desktop, $spacing-1)
                ul:not(.title-only)
                    @include grid(2, desktop)
                        margin-top: 0
            &.with-description
                .block-content
                    @include grid(12, desktop, $spacing-4)
                    .top
                        align-items: initial
                        grid-column: 1 / 8
                        margin-bottom: 0
                        display: grid
                        grid-template-rows: subgrid
                        grid-row: span 2
                        .block-title
                            width: auto
                        .description
                            @include body-text
                            margin-top: 0
                    // If page description
                    .top + ul
                        grid-column: 9 / 13
                        grid-row: 2
                        display: block
                        li + li
                &.with-images
                    .top
                        grid-column: 1 / 7
                    .top + ul
                        grid-column: 7 / 13

alexisben's avatar
alexisben committed

    &--alternate
        .top
            @include top-flex
Olivia206's avatar
Olivia206 committed
        .alternate
            @include alternate
Olivia206's avatar
Olivia206 committed
            article 
                position: relative
                display: flex
                flex-direction: column
                a
                    @include stretched-link
                .media 
                    margin-bottom: $spacing-2
                    order: -1
                    img
                        aspect-ratio: unset
alexisben's avatar
alexisben committed
        @include in-page-without-sidebar
            .top
                .description
                    @include body-text
alexisben's avatar
alexisben committed
    &--large
        .top
            @include top-flex
        .page
Olivia206's avatar
Olivia206 committed
            position: relative
alexisben's avatar
alexisben committed
            + .page
alexisben's avatar
alexisben committed
            .more
                @include icon(arrow, after, true)
                @include hover-translate-icon(after)
Olivia206's avatar
Olivia206 committed
            &:hover .more:after
                transform: translateX(#{pxToRem(10)})
alexisben's avatar
alexisben committed
            &-title a
Olivia206's avatar
Olivia206 committed
                @include stretched-link
alexisben's avatar
alexisben committed
            .media
                img
                    aspect-ratio: 1
        @include media-breakpoint-up(desktop)
            .page
                flex-direction: row
                gap: var(--grid-gutter)
alexisben's avatar
alexisben committed

        @include in-page-with-sidebar
            .page
                &-title
                    @include h2
                    margin-bottom: space(4)
                &-content
                    flex: 1
                .media 
                    flex: 1
        @include in-page-without-sidebar
            .top
                .description
                    @include body-text
            .page
                align-items: center
                &-title
                    @include lead
                    margin-bottom: space(4)
                &-content
alexisben's avatar
alexisben committed
                    width: columns(5)
alexisben's avatar
alexisben committed
                .media
alexisben's avatar
alexisben committed
                    width: columns(6)