website/assets/scss/asciidoctor.scss
2023-05-02 12:06:49 +08:00

293 lines
4.4 KiB
SCSS

// Asciidoctor-specific styles
.anchor {
&::before {
content: "§";
display: inline-block;
margin-right: 0.25em;
}
}
.conum {
color: var(--base05) !important;
background-color: var(--base03);
user-select: none;
}
.quoteblock {
border: var(--border-style);
border-left: 0.5em var(--base05) solid;
blockquote {
margin: auto;
padding: 0.5em;
max-height: var(--code-block-size);
overflow: auto;
& > :first-child {
margin-top: 0;
}
}
}
#footnotes > :not(hr) {
margin-top: 1rem;
}
[class$="block"],
:where(.admonitionblock, .dialogblock, .listingblock, .literalblock) {
margin: 1rem 0 0;
.title > code {
background: unset;
}
.content > :first-child {
margin-top: 0;
}
}
p.tableblock {
margin: unset;
}
*:not(.listingblock, .literalblock, .openblock) {
> .attribution,
> .title {
background: var(--foreground);
color: var(--base00);
font-size: 0.9em;
padding: 0.5em;
word-break: break-word;
}
> .content {
border: var(--border-style);
padding: 0.5em;
}
}
.listingblock {
position: relative;
> .title {
background: var(--foreground);
color: var(--background);
font-size: 0.9em;
padding: 0.5em;
word-wrap: break-word;
code {
background: unset;
}
}
> .content pre {
margin-top: unset;
}
}
.literalblock {
position: relative;
> .content pre {
background: var(--base00);
font-size: 0.9em;
}
}
.literalblock,
.listingblock {
> .listingblock__btn-row {
$gap: 0.3em;
display: flex;
gap: $gap;
flex-flow: row;
justify-content: center;
align-items: center;
width: min-content;
position: absolute;
top: 0;
right: 0;
> button {
background: var(--base01);
padding: $gap;
&:hover {
background: var(--selection-color);
color: var(--base05);
}
&:active {
background: var(--accent-color);
color: var(--base06);
}
}
}
&:fullscreen {
border: unset;
.content > pre {
max-height: 100vh;
border: unset;
}
.title {
display: none;
}
> .listingblock__btn-row {
top: 0;
}
&::backdrop {
--color1: var(--base08);
--color2: var(--base0C);
--threshold1: 9px;
--threshold2: 24px;
background: repeating-linear-gradient(
45deg,
var(--color1) 0px,
var(--color1) var(--threshold1),
var(--color2) var(--threshold1),
var(--color2) var(--threshold2)
);
}
}
}
.admonitionblock {
> table {
border: unset;
margin: unset;
table-layout: fixed;
width: 100%;
tbody {
tr + tr,
tr:first-child {
border-top: unset;
}
}
}
td.content {
background: var(--base01);
border: unset;
max-height: var(--code-block-size);
overflow: auto;
}
td.icon {
--size: 6ch;
background: var(--foreground);
color: var(--background);
vertical-align: middle;
width: var(--size);
padding: 0.25em;
> .title {
display: flex;
justify-content: center;
}
> svg.icon {
width: 100%;
height: var(--size);
}
}
}
.imageblock {
> .content {
display: flex;
justify-content: center;
}
> .title {
text-align: center;
}
}
p {
margin-bottom: unset;
}
.sidebarblock {
> .content {
background: var(--base01);
border: unset;
padding: var(--vertical-rhythm);
> .title {
background: unset;
color: unset;
font-family: var(--header-family);
font-size: 1em;
font-weight: bold;
padding: unset;
}
}
}
// Custom Asciidoctor components.
.dialogblock {
&__box {
align-items: center;
border: var(--border-style);
display: flex;
flex-flow: row nowrap;
gap: 1em;
padding: 0.5em;
max-width: 55ch;
width: fit-content;
}
&__avatar {
--size: 4em;
width: var(--size);
flex-basis: var(--size);
flex-shrink: 0;
margin: 0;
.imageblock {
margin: 0;
.content {
border: unset;
padding: 0;
}
}
}
&__text {
display: block;
margin: 0;
> :first-child {
margin-top: 0;
}
}
&__avatar-name {
font-weight: bolder;
}
// Roles/modifiers.
&.reversed {
flex-direction: row-reverse;
margin-left: auto;
}
}
@media all and (max-width: 860px) {
.imageblock {
> .content {
width: 100% !important;
}
}
}