From 8f373e6c6d3f9d322041ba4d949c1b0c39ae8ea0 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Fri, 8 Jan 2021 11:45:30 +0100 Subject: Added section link to the header in regular pages, improved template structure, improved CSS variable names, keep prefix for specific page items on mobile --- assets/css/components/_nav.scss | 2 +- assets/css/components/_page.scss | 95 +++++++++++++++++++++++++--------------- 2 files changed, 60 insertions(+), 37 deletions(-) (limited to 'assets/css/components') diff --git a/assets/css/components/_nav.scss b/assets/css/components/_nav.scss index 6d087ad..dc33d1e 100644 --- a/assets/css/components/_nav.scss +++ b/assets/css/components/_nav.scss @@ -50,7 +50,7 @@ @media (max-width: map-get($breakpoints, 'sm')) { &__item { - margin-left: $nav--item--spacing-sm - $nav--item--pad-h; + margin-left: $nav--item--spacing--sm - $nav--item--pad-h; } } diff --git a/assets/css/components/_page.scss b/assets/css/components/_page.scss index a55bcb4..435d696 100644 --- a/assets/css/components/_page.scss +++ b/assets/css/components/_page.scss @@ -1,34 +1,4 @@ .c-page { - &__header { - margin-bottom: $line-height * 1em; - - &::after { - content: '--'; - display: block; - margin-bottom: $line-height * -1em; - color: var(--fg-hi); - line-height: 2 * $line-height; - } - - &__title { - margin-top: 0; - } - - &__meta { - margin-top: 0; - color: var(--fg-hi); - font-weight: normal; - } - } - - &__content { - padding-left: $page--item-prefix--width; - - > :first-child { - margin-top: 0; - } - } - &__prefixed { position: relative; margin-left: -1 * $page--item-prefix--width; @@ -92,22 +62,75 @@ } &--ref::before { - content: '->'; + content: '|>'; + } + + &--backref::before { + content: '<|'; } } - @media (max-width: map-get($breakpoints, 'sm')) { - &__content { - padding-left: 0; + &__header { + margin-bottom: $line-height * 1em; + + &__title { + margin-top: 0; + } + + &__backlink__link { + &:link, + &:visited { + color: var(--fg-hi); + + &:hover { + color: var(--link--hover--fg); + } + } + } + + &__backlink + &__title { + margin-top: $line-height * 1em; + } + + &__meta { + margin-top: 0; + color: var(--fg-hi); + font-weight: normal; + } + } + + &__content { + padding-left: $page--item-prefix--width; + + > :first-child { + margin-top: 0; } + } + @media (max-width: map-get($breakpoints, 'sm')) { &__prefixed { margin-left: 0; - padding-left: 0; + padding-left: $page--item-prefix--width--sm; &::before { - display: none; + width: $page--item-prefix--width--sm; + margin-left: -1 * $page--item-prefix--width--sm; + } + + &--h1, + &--h2, + &--h3, + &--pre { + padding-left: 0; + + &::before { + display: none; + } } } + + &__content { + padding-left: 0; + } } } -- cgit v1.2.3-70-g09d2