@layer components { :root { --text-margin: .8rem; } .text { /* paragraphs */ p { line-height: 1.6; overflow-wrap: anywhere; margin: var(--text-margin) 0; color: var(--text); strong, b { color: var(--aqua); } em, i { color: var(--skye); } } /* inline code */ :not(pre)>code { background: var(--surface0); color: var(--subtext0); padding: .0rem .4rem; } .subtle { color: var(--subtext0); } del { color: var(--red); } ins { color: var(--green); } mark { background-color: var(--yellow); } /* text blocks */ aside, blockquote { --border: var(--overlay0); margin: var(--text-margin) 0; padding-left: 1rem; border-left: 4px solid var(--border, var(--default-border)); transition: border-color .2s; p { color: var(--subtext1); } } /* quote */ blockquote.quote { p { color: var(--subtext0); &.quote__body { font-style: italic; } } } q { color: var(--subtext0); font-style: italic; &::before { content: open-quote; } &::after { content: close-quote; } } aside { --icon: url('data:image/svg+xml;charset=utf-8, '); /* callouts */ h6 { &::before { content: ''; display: inline-block; height: 1rem; aspect-ratio: 1/1; vertical-align: middle; margin: 0 .8rem 0 0; mask: var(--icon); background-color: var(--border); } color: var(--border); } &.info { --border: var(--blue); --icon: url('data:image/svg+xml;charset=utf-8, '); } &.warn { --border: var(--yellow); --icon: url('data:image/svg+xml;charset=utf-8, '); } &.caution { --border: var(--red); --icon: url('data:image/svg+xml;charset=utf-8, '); } &.note { --border: var(--aqua); --icon: url('data:image/svg+xml;charset=utf-8, '); } } --h-margin-b: .8rem; /* headers */ h1 { margin: 2.25rem 0 var(--h-margin-b); font-size: 1.75rem; &:first-child { margin-top: 1.2rem; } @media not (min-width: 1280px) { font-size: 1.4rem; } } h2 { margin: 1.9rem 0 var(--h-margin-b); font-size: 1.4rem; @media not (min-width: 1280px) { font-size: 1.25rem; } } h3 { margin: 1.62rem 0 var(--h-margin-b); font-size: 1.12rem } h4, h5, h6 { margin: 1.5rem 0 var(--h-margin-b); font-size: 1rem } h6:not(:has(> .heading-anchor)):after { content: '~'; margin-inline: 1rem 0; color: var(--overlay2); } /* lists */ ul, ol { list-style-position: inside; li { margin: .6rem 0; padding: 0 0 0 .5rem; text-indent: hanging .5em; &::marker { color: var(--overlay2); } p { display: inline; } } li a.rainbow { text-decoration: wavy underline; text-decoration-thickness: 1px; } >:nth-child(6n+1) .rainbow { color: var(--red); } >:nth-child(6n+2) .rainbow { color: var(--orange); } >:nth-child(6n+3) .rainbow { color: var(--yellow); } >:nth-child(6n+4) .rainbow { color: var(--green); } >:nth-child(6n+5) .rainbow { color: var(--aqua); } >:nth-child(6n+6) .rainbow { color: var(--skye); } } ul { list-style-type: '- '; } p>img { border: 6px solid var(--surface1); border-radius: 8px; } } p.subtitle { margin-top: 0; .text :has(+ &) { margin-bottom: 0; } } .text pre:has(>code) { --cb-padding: 1rem; --gutter-size: 2rem; margin: .5rem 0; padding: var(--cb-padding) var(--gutter-size, var(--cb-padding)); border-radius: .3rem; background: var(--mantle) !important; overflow: auto; /* The line numbers already provide some kind of left/right padding */ &[data-linenos] { padding: var(--cb-padding) 0; } table td { padding: 0; /* The line number cells */ &:nth-of-type(1) { text-align: center; user-select: none; width: var(--gutter-size); color: var(--overlay0); } } mark { /* If you want your highlights to take the full width */ display: block; /* The default background colour of a mark is bright yellow */ background-color: rgba(254, 252, 232, 0.9); } table { width: 100%; border-collapse: collapse; } } /* spacing */ hr { background-color: var(--surface1); border: none; width: 100%; height: 1px; margin: 2rem auto; } }