duckquill/sass/_main.scss
daudix-UFO 84a1f95da4
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
feat: Contrast and legibility improvements
2023-12-05 20:36:38 +03:00

630 lines
10 KiB
SCSS

* {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
html {
font-size: 16px;
scroll-behavior: smooth;
scrollbar-color: var(--primary-color) transparent;
accent-color: var(--primary-color);
overflow-wrap: break-word;
}
// smaller font size on mobile
// @media only screen and (max-device-width: 480px) {
// html {
// font-size: 14px;
// }
// }
html,
body {
margin: 0;
padding: 0;
}
body {
font-family: "Inter Variable", sans-serif;
font-weight: 400;
line-height: 1.6;
color: var(--fg-color);
background-color: var(--bg-color);
// put footer at the bottom for short pages, such as the 404
display: grid;
min-height: 100vh;
grid-template-rows: auto minmax(auto, 1fr) auto; // header, stuff, footer
}
// style text selection to use primary color
::selection {
color: var(--bg-color);
background-color: var(--primary-color);
}
// make focused anchor not get covered by nav,
// and flash it with primary color when jumping to it
:target {
scroll-margin-top: 15vh;
animation: highlight-in-out var(--transition-long);
animation-delay: 1s;
@keyframes highlight-in-out {
50% {
color: var(--primary-color);
}
}
}
// LAYOUT
.container {
width: 80vw;
margin-left: auto;
margin-right: auto;
max-width: var(--content-width);
}
@media only screen and (max-device-width: 480px) {
.container {
width: 90vw;
}
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 3rem 0 1rem;
font-weight: 600;
line-height: 1.25;
.zola-anchor {
display: none;
visibility: hidden;
}
&:hover .zola-anchor {
display: inline-block;
text-decoration: none;
visibility: visible;
}
}
h1 {
letter-spacing: -0.08rem;
font-weight: 900;
font-size: 3rem;
a {
font-weight: 900;
}
}
h2 {
font-size: 2.4rem;
letter-spacing: -0.04rem;
}
h3 {
font-size: 1.5rem;
}
h4 {
font-size: 1.25rem;
}
h5 {
font-size: 1rem;
}
h6 {
font-size: 0.75rem;
}
a {
color: var(--primary-color);
cursor: pointer;
font-weight: 600;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
b,
strong {
font-weight: 600;
}
small {
// color: var(--fg50);
font-size: 0.8rem;
}
dl {
padding: 0;
dt {
padding: 0;
margin-top: 1rem;
font-size: 1rem;
font-weight: bold;
}
dd {
padding: 0;
margin-bottom: 1rem;
}
}
hr {
border: 0.125rem solid var(--fg50);
margin: 3rem auto;
width: 40%;
border-radius: 9999px;
}
blockquote {
padding: 0 0.75em;
border-left: 0.25rem solid var(--primary-color);
margin: 0;
border-radius: 2.5px;
> :first-child {
margin-top: 0;
}
> :last-child {
margin-bottom: 0;
}
// // make border slightly transparent for nested blockquote
// > blockquote {
// border-left: 0.3rem solid var(--primary-color-alpha);
// }
}
abbr {
cursor: help;
text-decoration: underline dotted;
}
// CODE
pre,
code {
font-family: "Source Code VF", monospace;
}
code:not(pre code) {
padding: 2px 6px;
border-radius: var(--rounded-corner-small);
background-color: var(--fg05);
color: var(--red-fg);
}
pre {
line-height: normal; // unset line height
padding: 1rem;
margin: 1rem 0 1rem;
border-radius: var(--rounded-corner);
max-width: 100vw;
box-shadow: var(--shadow);
overflow: auto;
table td {
padding: 0;
border: none;
}
// the line number cells
table td:nth-of-type(1) {
text-align: center;
user-select: none;
}
mark {
display: block;
background-color: var(--fg05);
color: var(--fg-color); // unset mark color from primary color to text color
border-radius: 0; // unset code block border radius
padding: 0; // unset mark padding
}
table {
width: 100%;
border-collapse: collapse;
}
// the line numbers already provide some kind of left/right padding
&[data-linenos] {
padding: 1rem 0;
}
}
kbd {
background-color: var(--fg05);
border-radius: var(--rounded-corner-small);
box-shadow: inset 0 -2px 0 var(--fg10), 0 -1px 0 var(--fg10);
cursor: pointer;
display: inline-block;
font-size: 0.8rem;
line-height: normal;
padding: 2px 6px;
// small nice thingy, keys can be pressed!
&:active {
background-color: var(--fg10);
box-shadow: inset 0 1px 0 var(--fg10);
transform: translateY(2px);
}
}
mark {
padding: 2px 6px;
border-radius: var(--rounded-corner-small);
background-color: var(--primary-color-alpha);
color: var(--primary-color);
}
figcaption {
margin-top: -1rem;
margin-bottom: 2rem;
display: block;
text-align: center;
color: var(--fg50);
font-size: 0.8rem;
}
details {
background-color: var(--fg05);
border-radius: var(--rounded-corner);
box-shadow: var(--shadow);
padding: 1rem;
& > summary {
cursor: pointer;
}
}
// TABLES
table {
display: block;
overflow-x: auto;
border-collapse: collapse;
th {
font-weight: bold;
}
th,
td {
padding: 0.5rem 1rem;
border: 1px solid var(--fg50);
}
}
td,
th {
padding: 0;
}
// MEDIA
img,
video {
display: block;
margin: 2rem auto;
max-width: 100%;
border-radius: var(--rounded-corner);
box-shadow: var(--shadow);
}
img {
transition: var(--transition-longer);
&:not(.no-hover):hover {
transform: scale(125%);
border-radius: 0;
box-shadow: var(--shadow-raised);
}
@media only screen and (max-device-width: 480px) {
&:not(.no-hover):hover {
transform: scale(110%);
}
}
}
.full {
width: 100%;
}
.pixels {
image-rendering: crisp-edges; // older firefox browsers
image-rendering: pixelated;
}
.transparent {
border-radius: 0;
box-shadow: none;
}
// NAVBAR
.nav {
overflow: auto;
width: 80vw;
// max-width: var(--content-width);
margin: 1rem auto;
box-shadow: 0px 12px 24px -16px rgba(0, 0, 0, 0.5);
border-radius: var(--rounded-corner-big);
background-color: var(--nav-bg);
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px);
// position: sticky;
top: 1rem;
z-index: 1;
&-container {
margin: 0.5rem 0.5rem;
position: relative;
text-align: center;
}
ul {
list-style-type: none;
margin: 1rem 0 0;
padding: 0;
text-align: center;
}
li {
transition: var(--transition);
color: var(--default-color);
display: inline-block;
}
a {
display: inline-block;
padding: 0.4rem 1rem;
border-radius: var(--rounded-corner);
background-color: transparent;
color: var(--fg50);
transition: var(--transition);
&:hover {
background-color: var(--fg05);
color: var(--primary-color);
text-decoration: none;
}
}
@media only screen and (max-device-width: 480px) {
& {
width: 90vw;
position: static;
}
}
@media (min-width: 600px) {
& {
border-radius: 9999px;
&-container {
text-align: left;
}
ul {
bottom: 0;
position: absolute;
right: 0;
}
a {
border-radius: 9999px;
}
}
}
}
// FOOTER
.footer {
text-align: center;
padding: 3rem 0 3rem;
font-size: 1rem;
margin-top: 4rem;
details {
all: unset;
}
}
// LINK ARROWS
.link-page::after {
content: "";
}
.link-site::after {
content: "";
}
// BUTTONS
.dialog-buttons {
display: flex;
flex-direction: row;
align-items: baseline;
justify-content: space-between;
margin-top: 6rem;
}
.inline-button {
background-color: var(--fg05);
border-radius: var(--rounded-corner);
color: var(--fg-color);
display: inline-block;
font-size: 0.9rem;
padding: 0.4rem 1rem;
transition: var(--transition);
}
.inline-button:hover {
background-color: var(--fg10);
text-decoration: none;
}
// CRT
.crt {
margin: 1rem 0 1rem;
border-radius: var(--rounded-corner);
box-shadow: var(--glow);
background: var(--crt-bg);
pre {
color: var(--primary-color);
padding: 1rem 1rem;
text-shadow: var(--primary-color-alpha) 0 0 4px,
var(--primary-color) 0 0 12px;
// unset some <pre> stuff
background-color: unset;
box-shadow: unset;
margin: unset;
}
}
.scanlines {
position: relative;
overflow: hidden;
}
.scanlines::after {
display: block;
pointer-events: none;
position: absolute;
content: "";
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
background: repeating-linear-gradient(
0deg,
rgba(0, 0, 0, 0.25),
rgba(0, 0, 0, 0.25) 1px,
transparent 3px,
transparent 4px
);
}
.cursor {
animation: blicking 1s infinite;
@keyframes blicking {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
75% {
opacity: 1;
}
}
}
// STATEMENTS
.statement-container {
margin: 1rem 0 1rem;
padding: 1rem 1rem 0.5rem 1rem;
border-radius: var(--rounded-corner);
box-shadow: var(--shadow);
* {
margin: 0;
}
p,
ul,
ol {
margin: 0.5rem 0 0.5rem;
}
.big {
font-size: 150%;
}
&.archive {
background-color: var(--purple-bg);
color: var(--purple-fg);
}
&.disclaimer {
background-color: var(--red-bg);
color: var(--red-fg);
}
&.trigger {
background-color: var(--yellow-bg);
color: var(--yellow-fg);
}
}
.johnvertisement {
margin: 0 auto;
display: block;
width: min(728px, 100vw);
height: min(90px, 12.367vw);
border: none;
}
.tags {
list-style: none;
padding: 0;
display: inline-block;
li {
display: inline-block;
margin: 0 0.2rem 0.4rem 0;
}
}
.tag {
border-radius: 9999px;
color: var(--fg-color);
padding: 0.25rem 0.75rem;
transition: var(--transition);
background-color: var(--fg05);
&:hover {
color: rgb(255, 255, 255);
background-color: var(--purple3);
background-image: radial-gradient(at 0 0, var(--blue3) 0, transparent 50%),
radial-gradient(at 100% 100%, var(--red2) 0, transparent 50%);
text-decoration: none;
}
&::before {
content: "#";
}
@media (prefers-color-scheme: dark) {
&:hover {
color: rgba(0, 0, 0, 0.8);
background-color: var(--purple2);
background-image: radial-gradient(at 0 0, var(--blue2) 0, transparent 50%),
radial-gradient(at 100% 100%, var(--red1) 0, transparent 50%);
text-decoration: none;
}
}
}
.heading {
text-align: center;
text-decoration: underline;
// &::after {
// content: ".";
// color: var(--primary-color);
// }
}