website/assets/scss/extend.scss

250 lines
4.2 KiB
SCSS
Raw Normal View History

2023-02-20 11:04:13 +00:00
// This is copied from https://stackoverflow.com/a/19721069.
$tooltip-size: 5em
2020-11-05 04:34:37 +00:00
:root {
2022-11-22 14:36:44 +00:00
--accented-border-style: var(--content-color) solid .1vw;
--content-color: var(--base05);
--code-size: 50vh;
2021-01-20 07:01:56 +00:00
--body-family: "Source Serif Pro", "IBM Plex Serif", "Noto Serif", serif;
--header-family: "Source Sans Pro", "IBM Plex Sans", "Noto Sans", sans-serif;
--mono-family: "Source Code Pro", "IBM Plex Mono", "Noto Mono", monospace;
color: var(--base05);
2019-09-28 12:15:00 +00:00
}
2022-11-22 14:36:44 +00:00
hr {
border-color: var(--content-color);
}
nav[aria-label="Primary navigation"] a {
color: var(--base05);
}
2022-03-01 09:55:57 +00:00
ul {
ul, ol {
padding-left: 1em;
}
}
pre, code {
max-height: var(--code-size);
}
2020-11-06 22:16:12 +00:00
// Layouts
2021-01-20 07:01:56 +00:00
.site__title {
--size: 2rem;
margin-bottom: unset;
font-size: var(--size);
2021-01-21 21:07:48 +00:00
line-height: unset;
2021-01-20 07:01:56 +00:00
}
2020-11-06 22:16:12 +00:00
.site__socials {
margin-top: 1em;
}
2021-01-21 21:07:48 +00:00
.site__social-icon svg {
fill: currentColor;
}
article.post {
padding: 0.5em;
background: var(--base01);
}
2020-11-05 04:34:37 +00:00
.post__meta--single {
p > span:first-child {
white-space: nowrap;
}
2019-09-28 12:15:00 +00:00
}
2021-01-21 21:07:48 +00:00
// Asciidoctor roles (e.g., [.text-center]) on a block.
.text-center {
text-align: center;
}
.line-through {
text-decoration: line-through;
}
2021-02-01 04:34:15 +00:00
// Custom layouts
#logo {
2023-02-20 11:04:13 +00:00
display: flex;
align-items: center;
justify-content: center;
height: $tooltip-size;
width: $tooltip-size;
svg {
--size: 4em;
height: var(--size);
width: var(--size);
fill: var(--base0C);
2023-02-20 11:04:13 +00:00
position: relative;
animation: rainbow 3s infinite, pulse 2s alternate infinite, bounce 0.6s ease-in-out alternate infinite;
}
}
2023-02-20 11:04:13 +00:00
@keyframes bounce {
$baseSize: 3em;
$baseRotation: 20deg;
from {
transform: rotate($baseRotation) translateX($baseSize) translateY(-#{$baseSize / 5});
}
2023-02-20 11:04:13 +00:00
to {
transform: rotate(-$baseRotation) translateX(-$baseSize) translateY(-#{$baseSize / 5});
}
}
@keyframes pulse {
from { width: #{$tooltip-size / 2}; }
to { width: #{$tooltip-size}; }
}
@keyframes rainbow {
2023-02-20 11:04:13 +00:00
$colorOrder: "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F";
$divide: floor(100 / length($colorOrder));
@for $i from 1 to length($colorOrder) {
#{$i * $divide}% {
fill: var(--base#{nth($colorOrder, $i)});
}
}
}
[data-tooltip] {
&::before {
--scale: 0;
background: var(--base01);
content: attr(data-tooltip);
font-size: 0.8em;
padding: 0.5em;
position: absolute;
2023-02-20 11:04:13 +00:00
transform: translateY(var(--translate-y, -#{round($tooltip-size / 2)})) scale(var(--scale));
transform-origin: bottom center;
width: max-content;
max-width: 100%;
}
&:hover::before {
--scale: 1;
}
}
2020-11-05 04:34:37 +00:00
// Prism CSS
code[class*="language-"], pre[class*="language-"] {
color: var(--base05);
2019-09-28 12:15:00 +00:00
}
2021-01-21 21:07:48 +00:00
2020-11-05 04:34:37 +00:00
// Asciidoctor-specific styles
sup.footnote {
vertical-align: baseline;
position: relative;
top: 0;
left: 0;
font-size: 1rem;
}
2020-11-05 04:34:37 +00:00
.anchor {
border-bottom: unset;
&:hover {
border-bottom: unset;
}
2020-11-05 04:34:37 +00:00
&::before {
content: "§";
display: inline-block;
margin-right: 0.25em;
}
}
.conum {
color: var(--base05) !important;
background-color: var(--base02);
user-select: none;
}
2020-11-05 04:34:37 +00:00
.quoteblock {
blockquote {
border: var(--accented-border-style);
margin: auto;
padding: 1em 0.5em;
}
}
2019-09-28 12:15:00 +00:00
2020-11-05 04:34:37 +00:00
@keyframes target-fade {
0% {
background: var(--base0D);
color: unset;
}
100% {
background-color: transparent;
}
2019-09-28 12:15:00 +00:00
}
2020-11-05 04:34:37 +00:00
#footnotes > *:not(hr) {
2020-11-05 07:30:02 +00:00
line-height: 1.45;
2020-11-05 04:34:37 +00:00
margin: 1em;
}
*:not(.listingblock) {
> *.attribution,
> *.title {
2022-11-22 14:36:44 +00:00
background: var(--content-color);
2020-11-05 04:34:37 +00:00
color: var(--base00);
font-size: 0.9em;
padding: 0.5em;
2020-11-06 22:16:12 +00:00
&::selection {
background: var(--base07);
}
2020-11-05 04:34:37 +00:00
}
> *.content {
border: var(--accented-border-style);
padding: 0.5em;
}
}
2019-09-28 12:15:00 +00:00
2020-11-05 04:34:37 +00:00
.admonitionblock {
.icon {
2022-11-22 14:36:44 +00:00
background: var(--content-color);
2020-11-05 04:34:37 +00:00
border: var(--accented-border-style);
vertical-align: middle;
2022-11-22 14:36:44 +00:00
width: 12%;
> .title {
display: flex;
justify-content: center;
}
2020-11-05 04:34:37 +00:00
}
2019-09-28 12:15:00 +00:00
}
2020-11-05 04:34:37 +00:00
.imageblock {
> .content {
2019-09-28 12:15:00 +00:00
display: flex;
justify-content: center;
2020-11-05 04:34:37 +00:00
}
2021-01-20 07:01:56 +00:00
> .title {
text-align: center;
}
2019-09-28 12:15:00 +00:00
}
2020-11-06 22:16:12 +00:00
2022-03-01 09:55:57 +00:00
.sidebarblock {
.title {
background: unset;
color: unset;
font-weight: bold;
padding: unset;
}
}
2020-11-06 22:16:12 +00:00
@media all and (max-width: 860px) {
.imageblock {
> .content {
width: 100% !important;
}
}
}