Theme refactor: shared base.css + palette-only themes (minified); template P4/P5/P7/P11 skip-link; per-image alt; system theme default

This commit is contained in:
Richard Zink
2026-09-10 08:51:59 +02:00
parent 3a100364aa
commit 212a98e7f2
10 changed files with 619 additions and 2364 deletions
+507
View File
@@ -0,0 +1,507 @@
/*
* Blog Share – BASE stylesheet (layout/components, palette-independent).
* All colors are var(...) driven; per-palette overrides live in blog_share_theme_*.css.
*/
/* ---------- Header: Logo durch Laptop-Emoji ---------- */
#header-logo img {
display: none;
}
#header-logo::before {
content: "💻";
font-size: 1.5em;
line-height: 1;
margin-right: 8px;
display: inline-block;
vertical-align: middle;
}
/* ---------- Buy Me a Coffee (original, lokal) ---------- */
@font-face {
font-family: "Cookie";
src: url(/api/notes/__COOKIE_FONT_ID__/download) format("woff2");
font-weight: 400;
font-display: swap;
}
#bmc-links {
margin-top: auto;
padding: 8px 25px 4px;
background: var(--background-secondary);
display: flex;
flex-direction: column;
gap: 2px;
}
.bmc-link {
display: flex;
align-items: center;
gap: 8px;
padding: 4px 6px 4px 24px;
border-radius: 6px;
color: var(--text-heading);
text-decoration: none;
font-size: 0.9em;
transition: background-color 150ms ease, color 150ms ease;
}
.bmc-link:hover {
background: var(--background-highlight);
color: var(--text-heading);
text-decoration: none;
}
.bmc-link .tn-icon {
color: var(--text-link);
}
/* ---------- Reading time ---------- */
.reading-time {
font-size: 0.8em;
color: var(--text-menu);
margin: -0.9em 0 1.25em;
}
/* ---------- Blog pagination ---------- */
.blog-pagination {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin: 1.5em 0 0;
padding-top: 1em;
border-top: 1px solid var(--background-highlight);
}
.blog-pagination .blog-page-num {
font-size: 0.85em;
color: var(--text-menu);
}
/* ---------- Share footer navigation (built-in prev/next) ausblenden ---------- */
#content-footer .navigation {
display: none;
}
/* ---------- Prev/Next ---------- */
.blog-prevnext {
display: flex;
justify-content: space-between;
gap: 12px;
margin: 1.5em 0 0;
padding-top: 1em;
border-top: 1px solid var(--background-highlight);
}
.blog-pn {
display: flex;
flex-direction: column;
gap: 2px;
max-width: 45%;
color: var(--text-heading);
text-decoration: none;
transition: color 150ms ease;
}
.blog-pn.next {
margin-left: auto;
align-items: flex-end;
text-align: right;
}
.blog-pn-label {
font-size: 0.72em;
text-transform: uppercase;
letter-spacing: 0.04em;
color: var(--text-menu);
}
.blog-pn:hover {
color: var(--text-link);
text-decoration: none;
}
.blog-pn.empty {
display: none;
}
/* ---------- Search ---------- */
.blog-search {
margin: 0.5em 0 1em;
}
.blog-search-input {
width: 100%;
box-sizing: border-box;
padding: 10px 14px;
border-radius: 8px;
border: 1px solid var(--background-highlight);
background: var(--background-secondary);
color: var(--text-heading);
font-size: 1em;
}
.blog-search-input:focus {
outline: none;
border-color: var(--text-link);
}
.blog-search-list {
list-style: none;
padding: 0;
margin: 1em 0 0;
}
.blog-search-hit {
display: flex;
flex-direction: column;
gap: 2px;
padding: 8px 12px;
border-radius: 8px;
border: 1px solid var(--background-highlight);
background: var(--blog-card-bg);
color: var(--text-heading);
text-decoration: none;
margin-bottom: 8px;
transition: border-color 150ms ease;
}
.blog-search-hit:hover {
border-color: var(--text-link);
text-decoration: none;
}
.blog-search-path {
font-size: 0.8em;
color: var(--text-menu);
}
.blog-search-none {
color: var(--text-menu);
}
/* ---------- Blog index (generated article list) ---------- */
.blog-post {
padding: 1.2em 1.4em;
margin-bottom: 1.25em;
border: 1px solid var(--background-highlight);
border-radius: 10px;
background: var(--blog-card-bg);
transition: border-color 150ms ease, box-shadow 150ms ease;
cursor: pointer;
}
.blog-post:last-child {
margin-bottom: 0;
}
.blog-post:hover {
border-color: var(--text-link);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
#content .blog-post:first-of-type {
margin-top: 1.5em;
}
/* ---------- Blog post thumbnails (Bild links, Teaser rechts) ---------- */
.blog-post-inner {
display: flex;
gap: 16px;
align-items: stretch;
}
.blog-thumb-link {
flex: 0 0 auto;
width: min(256px, 35%);
text-decoration: none;
}
.blog-thumb {
display: block;
width: 100%;
height: 100%;
max-height: 256px;
object-fit: cover;
border-radius: 8px;
border: 1px solid var(--background-highlight);
}
.blog-post-body {
flex: 1;
min-width: 0;
}
.blog-post-title {
margin: 0 0 0.25em;
}
.blog-post-title a {
color: var(--text-heading);
text-decoration: none;
transition: color 150ms ease;
}
.blog-post-title a:hover {
color: var(--text-link);
text-decoration: none;
}
.blog-post-meta {
display: flex;
gap: 12px;
font-size: 0.85em;
color: var(--text-menu);
margin-bottom: 0.5em;
}
.blog-post-date {
font-variant-numeric: tabular-nums;
opacity: 0.85;
}
.blog-post-category {
background: var(--background-highlight);
border-radius: 8px;
padding: 1px 10px;
color: var(--text-heading);
font-weight: 600;
}
.blog-post-summary {
margin: 0 0 0.5em;
color: var(--text-primary);
}
.blog-post-tags {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.tag {
font-size: 0.78em;
color: var(--text-link);
background: var(--background-secondary);
border: 1px solid var(--background-highlight);
border-radius: 8px;
padding: 1px 8px;
}
a.tag {
text-decoration: none;
transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
a.tag:hover {
background: var(--background-highlight);
border-color: var(--text-link);
color: var(--text-heading);
text-decoration: none;
}
/* ---------- Article meta (date/category on individual pages) ---------- */
.article-meta {
display: flex;
gap: 12px;
font-size: 0.9em;
color: var(--text-menu);
margin-bottom: 1em;
padding-bottom: 1em;
border-bottom: 1px solid var(--background-highlight);
}
/* ---------- Eingebettete Bilder: Radius wie Code-Blöcke (8px) ---------- */
#content figure.image {
margin: 1.25em auto;
}
#content figure img,
#content img:not(.blog-thumb) {
border-radius: 8px;
}
/* ---------- Category subcategories ---------- */
.blog-subcategories {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin: 0 0 1.25em;
}
.blog-subcategory {
display: inline-flex;
align-items: center;
gap: 6px;
background: var(--background-secondary);
border: 1px solid var(--background-highlight);
border-radius: 8px;
padding: 4px 12px;
color: var(--text-heading);
text-decoration: none;
font-weight: 600;
transition: background-color 150ms ease, border-color 150ms ease;
}
.blog-subcategory i {
color: var(--text-link);
}
.blog-subcategory:hover {
background: var(--background-highlight);
border-color: var(--text-link);
color: var(--text-heading);
text-decoration: none;
}
/* ---------- Digital Garden note table ---------- */
.blog-garden-table {
width: 100%;
}
.blog-garden-table tbody td:first-child {
background: transparent !important;
font-weight: normal;
}
.note-type {
display: inline-block;
font-size: 0.8em;
padding: 2px 10px;
border-radius: 8px;
background: var(--background-highlight);
color: var(--text-heading);
font-weight: 600;
text-transform: capitalize;
white-space: nowrap;
}
/* ---------- Code: line numbers + copy button ---------- */
pre.code-processed {
position: relative;
display: flex;
align-items: flex-start;
line-height: 1.6;
}
pre.code-processed .code-wrap {
flex: 1;
min-width: 0;
overflow-x: auto;
border-radius: 8px;
}
pre.code-processed .code-wrap code {
display: block;
line-height: inherit;
padding: 0;
margin: 0;
}
pre.code-processed .code-lines {
flex-shrink: 0;
user-select: none;
text-align: right;
padding: 0 12px 0 0;
margin: 0 12px 0 0;
border-right: 1px solid var(--background-highlight);
color: var(--text-menu);
white-space: pre;
font-family: "JetBrains Mono", Consolas, monospace;
font-size: 1em;
line-height: inherit;
}
pre.code-processed .code-copy-btn,
.mermaid-source pre .code-copy-btn {
position: absolute;
top: 6px;
right: 6px;
z-index: 2;
font-size: 0.75em;
padding: 2px 10px;
border-radius: 6px;
border: 1px solid var(--background-highlight);
background: var(--background-secondary);
color: var(--text-heading);
cursor: pointer;
opacity: 0.6;
transition: opacity 150ms ease;
}
pre.code-processed:hover .code-copy-btn,
.mermaid-source pre:hover .code-copy-btn {
opacity: 1;
}
pre.code-processed .code-copy-btn:hover,
.mermaid-source pre .code-copy-btn:hover {
border-color: var(--text-link);
opacity: 1;
}
/* ---------- Scrollbars ---------- */
::-webkit-scrollbar {
width: 12px;
height: 12px;
}
::-webkit-scrollbar-track {
background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
background: var(--scrollbar-thumb);
border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--scrollbar-hover);
}
* {
scrollbar-width: thin;
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
/* ---------- Mobile: Menu always on top (above 3D viewer overlays) ---------- */
@media (max-width: 48em) {
#left-pane,
#toc-pane {
z-index: 1000;
}
#header {
position: relative;
z-index: 1000;
}
}
/* ---------- Palette preview images: subtle frame so bars stay visible on any background ---------- */
#content figure.image img.palette-img {
border: 1px solid var(--background-highlight);
border-radius: 6px;
}
/* ---------- Tall images: cap height so long screenshots don't dominate the reader ---------- */
#content figure.image img:not(.palette-img) {
max-height: 85vh;
width: auto;
}
/* ---------- a11y: consistent keyboard focus ring ---------- */
#content a:focus-visible,
#menu a:focus-visible,
#childLinks a:focus-visible,
#site-header input:focus-visible,
.blog-search-header-input:focus-visible,
#header button:focus-visible,
.theme-selection .switch input:focus-visible + .slider {
outline: 2px solid var(--text-link);
outline-offset: 2px;
border-radius: 6px;
}
/* ---------- a11y: skip link ---------- */
.skip-link{position:absolute;left:-9999px;top:0;z-index:2000;background:var(--background-active);color:var(--background-secondary);padding:8px 14px;border-radius:0 0 8px 0;font-size:.9em;text-decoration:none}
.skip-link:focus{left:0}