mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
47247e01c5
- Restructure pages/ directory: shared/, posts/, specials/ modules - Add per-layout entry points (home, posts, archives, search, friends, link) - Include 404 and offline styles in main bundle - Consolidate scss-vars.html with Internal and Appearance categories - Simplify _variables.scss with @forward "hugo:vars" - Extract CSS loading logic to base/head/css.html - Update [params.appearance] with all configurable values
310 lines
5.5 KiB
SCSS
310 lines
5.5 KiB
SCSS
@use "sass:color";
|
|
@use "core/functions" as *;
|
|
@use "core/mixins" as *;
|
|
@use "variables" as *;
|
|
|
|
// Common styles for all TOC types
|
|
.toc {
|
|
.toc-title {
|
|
font-size: fi-var(toc-title-font-size);
|
|
font-weight: bold;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.toc-content {
|
|
font-size: fi-var(toc-content-font-size);
|
|
|
|
code {
|
|
@include inline-code;
|
|
}
|
|
|
|
ul {
|
|
margin: 0;
|
|
text-indent: -0.8em;
|
|
padding-left: 0.8em;
|
|
list-style: none;
|
|
|
|
a:first-child::before {
|
|
content: '|';
|
|
font-weight: bolder;
|
|
margin-right: 0.5em;
|
|
position: relative;
|
|
bottom: 2px;
|
|
color: fi-var(single-link-color);
|
|
}
|
|
|
|
ul {
|
|
padding-left: 1em;
|
|
}
|
|
}
|
|
|
|
ol {
|
|
margin: 0;
|
|
padding-left: 2.25em;
|
|
|
|
ol {
|
|
padding-left: 1.25em;
|
|
}
|
|
|
|
li:has(> a:hover)::marker {
|
|
color: fi-var(single-link-color);
|
|
}
|
|
}
|
|
}
|
|
|
|
ruby {
|
|
background-color: fi-var(code-block-background-color);
|
|
|
|
rt {
|
|
color: fi-var(global-font-secondary-color);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Common active state styles for auto and dialog TOC
|
|
#toc-auto,
|
|
#toc-dialog {
|
|
.toc-content {
|
|
li.has-active {
|
|
&::marker {
|
|
color: fi-var(single-link-color);
|
|
}
|
|
|
|
&:has(> .active)::marker {
|
|
font-weight: bold;
|
|
}
|
|
|
|
> a {
|
|
color: fi-var(single-link-color);
|
|
}
|
|
}
|
|
|
|
ul {
|
|
a.active::before {
|
|
color: fi-var(single-link-hover-color);
|
|
}
|
|
}
|
|
|
|
a.active {
|
|
font-weight: bold;
|
|
}
|
|
}
|
|
}
|
|
|
|
#toc-auto {
|
|
display: block;
|
|
position: sticky;
|
|
box-sizing: border-box;
|
|
visibility: hidden;
|
|
margin-bottom: 8rem;
|
|
@include overflow-wrap(break-word);
|
|
@include sticky-top-offset;
|
|
|
|
.toc-title {
|
|
margin-block: 0 0.5em;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
|
|
&::before {
|
|
content: '|';
|
|
font-weight: bolder;
|
|
margin-right: 0.5em;
|
|
position: relative;
|
|
bottom: 2px;
|
|
color: fi-var(global-border-color);
|
|
}
|
|
|
|
i.toc-icon {
|
|
transition: rotate 0.2s ease;
|
|
}
|
|
}
|
|
|
|
&.toc-hidden i.toc-icon {
|
|
rotate: -90deg;
|
|
transition: rotate 0.2s ease;
|
|
}
|
|
|
|
.toc-content {
|
|
overflow-y: auto;
|
|
overscroll-behavior: contain;
|
|
max-height: fi-var(toc-content-max-height, 90dvh);
|
|
@include scrollbar-width(none, 0);
|
|
|
|
&.always-active ul,
|
|
&.always-active ol {
|
|
display: block;
|
|
}
|
|
|
|
// for unordered list automatically collapsed
|
|
ul {
|
|
ul {
|
|
display: none;
|
|
}
|
|
|
|
.has-active > ul {
|
|
display: block;
|
|
}
|
|
}
|
|
|
|
// for ordered list automatically collapsed
|
|
ol {
|
|
ol {
|
|
display: none;
|
|
}
|
|
|
|
.has-active > ol {
|
|
display: block;
|
|
}
|
|
}
|
|
}
|
|
|
|
@include media('print') {
|
|
display: none !important;
|
|
}
|
|
}
|
|
|
|
#toc-static {
|
|
display: none;
|
|
margin: 0.8em 0;
|
|
|
|
&[data-kept='true'] {
|
|
display: block;
|
|
}
|
|
|
|
.toc-title {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
line-height: 2em;
|
|
padding: 0 0.75em;
|
|
background-color: fi-var(code-header-background-color);
|
|
}
|
|
|
|
.toc-content {
|
|
background-color: fi-var(code-block-background-color);
|
|
|
|
> nav {
|
|
> ul {
|
|
padding: 0.4em 1em 0.4em 1.8em;
|
|
|
|
a:hover {
|
|
font-weight: bold;
|
|
|
|
&::before {
|
|
color: fi-var(single-link-hover-color);
|
|
}
|
|
}
|
|
}
|
|
|
|
> ol {
|
|
padding: 0.4em 1em 0.4em 2.25em;
|
|
|
|
li:has(> a:hover)::marker,
|
|
a:hover {
|
|
font-weight: bold;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
&:not(.open) {
|
|
.toc-title {
|
|
@include set-fi-var(
|
|
code-header-background-color,
|
|
light-dark(color.adjust($code-header-background-color, $lightness: -1%), color.adjust($code-header-background-color-dark, $lightness: -1%))
|
|
);
|
|
}
|
|
}
|
|
|
|
@include media('sm', 'down') {
|
|
display: block;
|
|
}
|
|
}
|
|
|
|
#toc-dialog {
|
|
opacity: 0;
|
|
translate: 100vw 0;
|
|
width: MIN(calc(100% - 4rem), 460px);
|
|
height: 100dvh;
|
|
max-width: 100%;
|
|
max-height: 100%;
|
|
margin-right: 0;
|
|
border: none;
|
|
border-left: 1px solid fi-var(global-border-color-light);
|
|
background-color: fi-var(global-background-color);
|
|
transition:
|
|
display 0.2s allow-discrete,
|
|
overlay 0.2s allow-discrete,
|
|
translate 0.2s,
|
|
opacity 0.2s 0.4s;
|
|
|
|
.toc-close-btn {
|
|
position: absolute;
|
|
top: 1.25rem;
|
|
right: 1rem;
|
|
padding: 0.25rem;
|
|
color: fi-var(global-font-secondary-color);
|
|
transition: color 0.2s ease;
|
|
@include border-radius;
|
|
|
|
&:hover,
|
|
&:focus-visible {
|
|
color: fi-var(global-font-color);
|
|
}
|
|
}
|
|
|
|
.toc {
|
|
max-width: 100%;
|
|
margin-inline: 1rem;
|
|
|
|
.toc-title {
|
|
font-size: calc(#{fi-var(toc-title-font-size)} * 1.5);
|
|
line-height: calc(#{fi-var(toc-title-font-size)} * 2);
|
|
margin-block: fi-var(toc-title-font-size);
|
|
}
|
|
|
|
.toc-content {
|
|
font-size: MAX(fi-var(toc-content-font-size), 1rem);
|
|
|
|
nav {
|
|
max-height: calc(100dvh - 5rem);
|
|
overflow: auto;
|
|
}
|
|
}
|
|
}
|
|
|
|
&::backdrop {
|
|
background-color: rgba(0, 0, 0, 0.25);
|
|
backdrop-filter: blur(2px);
|
|
opacity: 0;
|
|
transition:
|
|
display 0.5s allow-discrete,
|
|
overlay 0.5s allow-discrete,
|
|
opacity 0.2s 0.4s;
|
|
}
|
|
|
|
&[open],
|
|
&[open]::backdrop {
|
|
opacity: 1;
|
|
transition:
|
|
display 0.2s allow-discrete,
|
|
overlay 0.2s allow-discrete,
|
|
translate 0.2s,
|
|
opacity 0.2s;
|
|
}
|
|
|
|
&[open] {
|
|
translate: 0 0;
|
|
}
|
|
|
|
@starting-style {
|
|
&[open],
|
|
&[open]::backdrop {
|
|
opacity: 0;
|
|
}
|
|
|
|
&[open] {
|
|
translate: 100vw 0;
|
|
}
|
|
}
|
|
}
|