mirror of
https://github.com/kbenestad/mdcms.git
synced 2026-06-18 07:24:31 +00:00
Merge branch 'main' of http://127.0.0.1:45849/git/kbenestad/mdcms into development
This commit is contained in:
commit
51cb68c4f9
2 changed files with 20 additions and 10 deletions
|
|
@ -17,6 +17,10 @@ Only two branches exist in this repository: **`main`** and **`development`**. No
|
|||
|
||||
In practice: check out `development`, do the work, push to `development`, PR `development` → `main` when ready to release.
|
||||
|
||||
## Unreleased changelog
|
||||
|
||||
`docs/unreleased.md` is a living document that tracks every fix or feature on `development` that has not yet been merged to `main`. Keep it current: whenever a change lands on `development`, add or update an entry in `unreleased.md` in the same commit (or a follow-up commit to `development`). When a batch of changes is merged to `main` and released, clear the entries that were released and leave the file in place for the next round of work.
|
||||
|
||||
## What this project is
|
||||
|
||||
MD-CMS is a markdown-based static site system with two distinct parts:
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ if ('serviceWorker' in navigator) {
|
|||
--link-visited-colour: #7C3AED;
|
||||
--link-decoration: underline;
|
||||
--link-hover-decoration: underline;
|
||||
--link-hover-weight: 700;
|
||||
--link-hover-weight: normal;
|
||||
--link-visited-decoration: underline;
|
||||
--search-bg: #FFFFFF;
|
||||
--search-border: #E2E8F0;
|
||||
|
|
@ -113,7 +113,7 @@ if ('serviceWorker' in navigator) {
|
|||
--link-visited-colour: #A78BFA;
|
||||
--link-decoration: underline;
|
||||
--link-hover-decoration: underline;
|
||||
--link-hover-weight: 700;
|
||||
--link-hover-weight: normal;
|
||||
--link-visited-decoration: underline;
|
||||
--search-bg: #1E293B;
|
||||
--search-border: #334155;
|
||||
|
|
@ -448,7 +448,7 @@ body {
|
|||
border: none;
|
||||
cursor: pointer;
|
||||
padding: 0.4rem;
|
||||
color: var(--font-colour);
|
||||
color: var(--nav-link-colour, var(--font-colour));
|
||||
z-index: 150;
|
||||
}
|
||||
.hamburger svg { width: 22px; height: 22px; }
|
||||
|
|
@ -627,17 +627,17 @@ body {
|
|||
padding: 0.55rem 0.85rem;
|
||||
cursor: pointer;
|
||||
font-size: 0.88rem;
|
||||
color: var(--font-colour);
|
||||
color: var(--nav-link-colour, var(--font-colour));
|
||||
border-bottom: 1px solid var(--divider);
|
||||
transition: background 0.1s;
|
||||
}
|
||||
.category-option:last-child { border-bottom: none; }
|
||||
.category-option:hover { background: var(--nav-hover-bg); }
|
||||
.category-option.active { background: var(--nav-active-bg); color: var(--accent); font-weight: 600; }
|
||||
.category-option.active { background: var(--nav-active-bg); color: var(--nav-link-active-colour, var(--accent)); font-weight: 600; }
|
||||
.category-option .secondary {
|
||||
display: block;
|
||||
font-size: 0.75rem;
|
||||
color: var(--font-colour-muted);
|
||||
color: var(--nav-section-heading-colour, var(--font-colour-muted));
|
||||
margin-top: 0.15rem;
|
||||
}
|
||||
|
||||
|
|
@ -1094,9 +1094,16 @@ body {
|
|||
|
||||
async function maybeLoadCategoryFont(code) {
|
||||
const cat = categoriesByCode[code];
|
||||
if (!cat || !cat.font || loadedFonts.has(cat.font)) return;
|
||||
showFontLoadingBanner();
|
||||
if (!cat || !cat.font) {
|
||||
document.body.style.fontFamily = '';
|
||||
return;
|
||||
}
|
||||
const family = 'mdcms-cat-' + code;
|
||||
if (loadedFonts.has(cat.font)) {
|
||||
document.body.style.fontFamily = `"${family}", ${getComputedStyle(document.documentElement).getPropertyValue('--font-body').trim()}`;
|
||||
return;
|
||||
}
|
||||
showFontLoadingBanner();
|
||||
const css = `@font-face { font-family: "${family}"; src: url("assets/fonts/${cat.font}"); }`;
|
||||
const style = document.createElement('style');
|
||||
style.textContent = css;
|
||||
|
|
@ -1106,8 +1113,7 @@ body {
|
|||
await face.load();
|
||||
document.fonts.add(face);
|
||||
loadedFonts.add(cat.font);
|
||||
// Apply font to body for this session
|
||||
document.body.style.fontFamily = `"${family}", ${getComputedStyle(document.body).fontFamily}`;
|
||||
document.body.style.fontFamily = `"${family}", ${getComputedStyle(document.documentElement).getPropertyValue('--font-body').trim()}`;
|
||||
} catch (e) {
|
||||
console.warn('Font load failed:', e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue