1
0
Fork 0
blog/public/css/index.css

321 lines
6.1 KiB
CSS
Raw Normal View History

2024-07-01 17:43:44 +00:00
/* Defaults */
:root {
2025-05-03 03:37:23 +00:00
/* --font-family: -apple-system, system-ui, sans-serif; */
--font-family: SometypeMono;
--font-family-monospace: SometypeMono;
2024-07-01 17:43:44 +00:00
}
/* Theme colors */
:root {
2025-05-03 03:37:23 +00:00
--text-color-link: var(--color-cyan);
--text-color-link-active: var(--color-cyan-bright);
--text-color-link-visited: var(--color-cyan);
2025-04-20 14:56:54 +00:00
2025-05-03 03:37:23 +00:00
--syntax-tab-size: 2;
2024-07-01 17:43:44 +00:00
}
@media (prefers-color-scheme: dark) {
2025-05-03 03:37:23 +00:00
:root {
/* --text-color is assigned to --color-gray-_ above */
/* --text-color-link: #1493fb; */
/* --text-color-link-active: #6969f7; */
/* --text-color-link-visited: #a6a6f8; */
--text-color-link: var(--color-cyan);
--text-color-link-active: var(--color-cyan-bright);
--text-color-link-visited: var(--color-cyan);
}
2024-07-01 17:43:44 +00:00
}
2025-04-20 18:11:20 +00:00
/* list style custom */
ul {
2025-05-03 03:37:23 +00:00
/* list-style: symbols(cyclic "\25E5" "\25E2" "\25E3" "\25E4"); */
list-style: symbols(cyclic "\25E9");
2025-04-20 18:11:20 +00:00
}
2024-07-01 17:43:44 +00:00
/* Global stylesheet */
* {
2025-05-03 03:37:23 +00:00
box-sizing: border-box;
2024-07-01 17:43:44 +00:00
}
html,
body {
2025-05-03 03:37:23 +00:00
padding: 0;
margin: 0 auto;
font-family: var(--font-family);
color: var(--color-fg);
background-color: var(--color-bg);
2024-07-01 17:43:44 +00:00
}
html {
2025-05-03 03:37:23 +00:00
overflow-y: scroll;
2024-07-01 17:43:44 +00:00
}
body {
2025-05-03 03:37:23 +00:00
max-width: 40em;
2025-01-02 05:57:08 +00:00
}
img {
2025-05-03 03:37:23 +00:00
max-width: 100%;
height: auto;
2024-07-01 17:43:44 +00:00
}
/* https://www.a11yproject.com/posts/how-to-hide-content/ */
.visually-hidden {
2025-05-03 03:37:23 +00:00
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
2024-07-01 17:43:44 +00:00
}
p:last-child {
2025-05-03 03:37:23 +00:00
margin-bottom: 0;
2024-07-01 17:43:44 +00:00
}
p {
2025-05-03 03:37:23 +00:00
line-height: 1.5;
2024-07-01 17:43:44 +00:00
}
li {
2025-05-03 03:37:23 +00:00
line-height: 1.5;
2024-07-01 17:43:44 +00:00
}
a[href] {
2025-05-03 03:37:23 +00:00
color: var(--text-color-link);
2024-07-01 17:43:44 +00:00
}
a[href]:visited {
2025-05-03 03:37:23 +00:00
color: var(--text-color-link-visited);
2024-07-01 17:43:44 +00:00
}
a[href]:hover,
a[href]:active {
2025-05-03 03:37:23 +00:00
color: var(--text-color-link-active);
2024-07-01 17:43:44 +00:00
}
main {
2025-05-03 03:37:23 +00:00
padding: 1rem;
2024-07-01 17:43:44 +00:00
}
main :first-child {
2025-05-03 03:37:23 +00:00
margin-top: 0;
2024-07-01 17:43:44 +00:00
}
header {
2025-05-03 03:37:23 +00:00
border-bottom: 1px dashed var(--color-white);
2024-07-01 17:43:44 +00:00
}
header:after {
2025-05-03 03:37:23 +00:00
content: "";
display: table;
clear: both;
2024-07-01 17:43:44 +00:00
}
.links-nextprev {
2025-05-03 03:37:23 +00:00
list-style: none;
border-top: 1px dashed var(--color-white);
padding: 1em 0;
2024-07-01 17:43:44 +00:00
}
table {
2025-05-03 03:37:23 +00:00
margin: 1em 0;
2024-07-01 17:43:44 +00:00
}
table td,
table th {
2025-05-03 03:37:23 +00:00
padding-right: 1em;
2024-07-01 17:43:44 +00:00
}
pre,
code {
2025-05-03 03:37:23 +00:00
font-family: var(--font-family-monospace);
2024-07-01 17:43:44 +00:00
}
pre:not([class*="language-"]) {
2025-05-03 03:37:23 +00:00
margin: 0.5em 0;
line-height: 1.375; /* 22px /16 */
-moz-tab-size: var(--syntax-tab-size);
-o-tab-size: var(--syntax-tab-size);
tab-size: var(--syntax-tab-size);
-webkit-hyphens: none;
-ms-hyphens: none;
hyphens: none;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
2024-07-01 17:43:44 +00:00
}
code {
2025-05-03 03:37:23 +00:00
/* word-break: break-all; */
2025-04-20 14:56:54 +00:00
2025-05-03 03:37:23 +00:00
color: var(--color-black);
background-color: var(--color-white);
2024-07-01 17:43:44 +00:00
}
/* Header */
header {
2025-05-03 03:37:23 +00:00
display: flex;
gap: 1em 0.5em;
flex-wrap: wrap;
align-items: center;
padding: 1em;
2024-07-01 17:43:44 +00:00
}
.home-link {
2025-05-03 03:37:23 +00:00
font-size: 1em; /* 16px /16 */
font-weight: 700;
margin-right: 2em;
2024-07-01 17:43:44 +00:00
}
.home-link:link:not(:hover) {
2025-05-03 03:37:23 +00:00
text-decoration: none;
2024-07-01 17:43:44 +00:00
}
/* Nav */
.nav {
2025-05-03 03:37:23 +00:00
display: flex;
padding: 0;
margin: 0;
list-style: none;
2024-07-01 17:43:44 +00:00
}
.nav-item {
2025-05-03 03:37:23 +00:00
display: inline-block;
margin-right: 1em;
2024-07-01 17:43:44 +00:00
}
.nav-item a[href]:not(:hover) {
2025-05-03 03:37:23 +00:00
text-decoration: none;
2024-07-01 17:43:44 +00:00
}
.nav a[href][aria-current="page"] {
2025-05-03 03:37:23 +00:00
text-decoration: underline;
2024-07-01 17:43:44 +00:00
}
/* Posts list */
.postlist {
2025-05-03 03:37:23 +00:00
list-style: none;
padding: 0;
padding-left: 1.5rem;
2024-07-01 17:43:44 +00:00
}
.postlist-item {
2025-05-03 03:37:23 +00:00
display: flex;
flex-wrap: wrap;
align-items: baseline;
counter-increment: start-from -1;
margin-bottom: 1em;
2024-07-01 17:43:44 +00:00
}
.postlist-item:before {
2025-05-03 03:37:23 +00:00
display: inline-block;
pointer-events: none;
content: "" counter(start-from, decimal-leading-zero) ". ";
line-height: 100%;
text-align: right;
margin-left: -1.5rem;
2024-07-01 17:43:44 +00:00
}
.postlist-date,
.postlist-item:before {
2025-05-03 03:37:23 +00:00
font-size: 0.8125em; /* 13px /16 */
color: var(--color-gray-90);
2024-07-01 17:43:44 +00:00
}
.postlist-date {
2025-05-03 03:37:23 +00:00
word-spacing: -0.5px;
2024-07-01 17:43:44 +00:00
}
.postlist-link {
2025-05-03 03:37:23 +00:00
font-size: 1.1875em; /* 19px /16 */
font-weight: 700;
flex-basis: calc(100% - 1.5rem);
padding-left: 0.25em;
padding-right: 0.5em;
text-underline-position: from-font;
text-underline-offset: 0;
text-decoration-thickness: 1px;
2024-07-01 17:43:44 +00:00
}
.postlist-item-active .postlist-link {
2025-05-03 03:37:23 +00:00
font-weight: bold;
2024-07-01 17:43:44 +00:00
}
/* Tags */
.post-tag {
2025-05-03 03:37:23 +00:00
display: inline-flex;
align-items: center;
justify-content: center;
text-transform: capitalize;
font-style: italic;
2024-07-01 17:43:44 +00:00
}
.postlist-item > .post-tag {
2025-05-03 03:37:23 +00:00
align-self: center;
2024-07-01 17:43:44 +00:00
}
/* Tags list */
.post-metadata {
2025-05-03 03:37:23 +00:00
display: inline-flex;
flex-wrap: wrap;
gap: 0.5em;
list-style: none;
padding: 0;
margin: 0;
2024-07-01 17:43:44 +00:00
}
.post-metadata time {
2025-05-03 03:37:23 +00:00
margin-right: 1em;
2024-07-01 17:43:44 +00:00
}
/* Direct Links / Markdown Headers */
.header-anchor {
2025-05-03 03:37:23 +00:00
text-decoration: none;
font-style: normal;
font-size: 1em;
margin-left: 0.1em;
2024-07-01 17:43:44 +00:00
}
a[href].header-anchor,
a[href].header-anchor:visited {
2025-05-03 03:37:23 +00:00
color: transparent;
2024-07-01 17:43:44 +00:00
}
a[href].header-anchor:focus,
a[href].header-anchor:hover {
2025-05-03 03:37:23 +00:00
text-decoration: underline;
2024-07-01 17:43:44 +00:00
}
a[href].header-anchor:focus,
:hover > a[href].header-anchor {
2025-05-03 03:37:23 +00:00
color: #aaa;
2024-07-01 17:43:44 +00:00
}
h2 + .header-anchor {
2025-05-03 03:37:23 +00:00
font-size: 1.5em;
2024-07-01 17:43:44 +00:00
}
2025-05-03 03:37:23 +00:00
h1,
h2,
h3 {
font-family: WO3;
letter-spacing: 0.1rem;
2025-01-02 02:35:57 +00:00
}
2025-04-20 14:56:54 +00:00
2025-04-21 03:29:15 +00:00
/* blockquote styling */
2025-04-20 14:56:54 +00:00
2025-04-20 18:11:20 +00:00
blockquote {
2025-04-20 14:56:54 +00:00
padding: 2em; /* Adjust padding as needed */
position: relative; /* Needed for positioning pseudo-elements */
border: none; /* Ensure no default border */
margin: 1em 0; /* Add some margin for spacing */
overflow: hidden; /* Prevents pseudo-elements from causing scrollbars if they slightly exceed bounds */
}
2025-04-20 18:11:20 +00:00
blockquote p {
2025-04-20 14:56:54 +00:00
margin: 0; /* Remove default paragraph margin inside callout */
}
/* Top-left corner bracket */
2025-04-20 18:11:20 +00:00
blockquote::before {
2025-05-03 03:37:23 +00:00
content: "";
2025-04-20 14:56:54 +00:00
position: absolute;
top: 0.5em; /* Adjust position */
left: 0.5em; /* Adjust position */
width: 1.5em; /* Adjust size */
height: 1.5em; /* Adjust size */
2025-04-20 18:11:20 +00:00
border-top: 3px solid var(--color-white); /* White border, adjust thickness */
border-left: 3px solid var(--color-white); /* White border, adjust thickness */
2025-04-20 14:56:54 +00:00
box-sizing: border-box;
}
/* Bottom-right corner bracket */
2025-04-20 18:11:20 +00:00
blockquote::after {
2025-05-03 03:37:23 +00:00
content: "";
2025-04-20 14:56:54 +00:00
position: absolute;
bottom: 0.5em; /* Adjust position */
right: 0.5em; /* Adjust position */
width: 1.5em; /* Adjust size */
height: 1.5em; /* Adjust size */
2025-04-20 18:11:20 +00:00
border-bottom: 3px solid var(--color-white); /* White border, adjust thickness */
border-right: 3px solid var(--color-white); /* White border, adjust thickness */
2025-04-20 14:56:54 +00:00
box-sizing: border-box;
}