hugo-theme-paradox/assets/styles/features/headings.scss

80 lines
1.4 KiB
SCSS
Raw Normal View History

2022-10-16 22:15:34 +00:00
h2.heading {
2022-12-23 11:21:41 +00:00
padding-block-end: 1rem;
border-block-end: 1px solid var(--ui-text-muted);
2022-10-16 22:15:34 +00:00
}
/* headings with no numbers */
article:not([autonumbering]) .heading {
position: relative;
2022-12-23 11:21:41 +00:00
margin-inline-end: 2.5rem;
2022-10-16 22:15:34 +00:00
&__anchor-link {
display: inline-flex;
align-content: center;
2022-12-23 11:21:41 +00:00
margin-inline-start: 0.25em;
2022-10-16 22:15:34 +00:00
position: absolute;
2022-12-23 11:21:41 +00:00
inset-inline-end: -2.5rem;
inset-block-start: 3px;
2022-10-16 22:15:34 +00:00
font-size: 1rem;
}
}
/* headings with autonumbering support */
body {counter-reset: h2}
h2 {counter-reset: h3}
h3 {counter-reset: h4}
h4 {counter-reset: h5}
article[autonumbering] {
h2:before {
counter-increment: h2;
content: counter(h2) " ";
}
h3:before {
counter-increment: h3;
content: counter(h2) "." counter(h3) " ";
}
h4:before {
counter-increment: h4;
content: counter(h2) "." counter(h3) "." counter(h4) " ";
}
h2:before,
h3:before,
h4:before
{
2022-12-23 11:21:41 +00:00
margin-inline-end: 1em;
2022-10-16 22:15:34 +00:00
font-family: monospace;
font-size: 1rem;
}
.heading {
display: grid;
grid-template-columns: 1fr auto;
grid-template-rows: auto auto;
2022-12-23 11:21:41 +00:00
gap: 0.5rem;
2022-10-16 22:15:34 +00:00
&__text {
grid-column: span 2;
}
&__anchor-link {
font-size: 1rem;
grid-column: 2;
grid-row: 1;
justify-self: end;
}
}
#TableOfContents :is(ol, ul) {
counter-reset: item;
}
#TableOfContents li:before {
content: counters(item, ".") ". ";
counter-increment: item;
2022-10-17 14:46:58 +00:00
font-family: monospace;
}
#TableOfContents ol ol,
#TableOfContents ul ul
{
2022-12-23 11:21:41 +00:00
margin-inline-start: 0;
2022-10-16 22:15:34 +00:00
}
}