Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

slides: every chrome use of the brand yellow reads the --accent token (#497)

nyblnet22582bdf912d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2f977d92..a99f42ea 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,13 @@ pre-1.0.
## [Unreleased]
+- **One brand yellow.** Ten places in the editor chrome — the speaker view's
+ timer, buttons and current thumbnail, the show's link, selection and
+ progress colours, the follow chip, and the path editor's anchor dots —
+ carried their own copy of the accent instead of reading the chrome's
+ `--accent` token. They read the token now; nothing looks different. The
+ slide-list highlight already did. The deck's own `theme.accent` is a
+ separate thing and stays separate: chrome does not recolour per deck.
- **A deck opens inside Teams and SharePoint again.** Their viewer refuses
the way 1.1.0's file started itself (a script loaded from a `blob:` URL).
The file now starts the way nothing refuses: the runtime is inserted as an
diff --git a/slides/src/editor/patheditor.ts b/slides/src/editor/patheditor.ts
index 01b3fe64..a5392c78 100644
--- a/slides/src/editor/patheditor.ts
+++ b/slides/src/editor/patheditor.ts
@@ -414,7 +414,10 @@ export class PathEditor {
dot.setAttribute('cy', String(p.y))
dot.setAttribute('r', String(rad))
}
- dot.setAttribute('fill', i === 0 ? '#f7a600' : sel ? '#5b8def' : '#fff')
+ // the rest-position anchor wears the chrome accent (a CSS token, so it
+ // is set as a style, not an attribute — attributes cannot take var())
+ dot.style.fill = i === 0 ? 'var(--accent)' : sel ? 'var(--blue)' : '#fff'
+ dot.removeAttribute('fill')
dot.setAttribute('stroke', sel ? '#2f6df6' : '#31445c')
dot.setAttribute('stroke-width', String((sel ? 2.4 : 1.6) * k))
dot.classList.add('ed-pe-anchor')
@@ -457,7 +460,7 @@ export class PathEditor {
const dur = loop?.duration ?? 3
const preview = mk('circle')
preview.setAttribute('r', String(4.5 * k))
- preview.setAttribute('fill', '#f7a600')
+ preview.style.fill = 'var(--accent)' // chrome token, as a style (attributes cannot take var())
preview.style.pointerEvents = 'none'
preview.classList.add('ed-pe-dot')
svg.appendChild(preview)
diff --git a/slides/src/styles.css b/slides/src/styles.css
index f8254dc1..a148cda2 100644
--- a/slides/src/styles.css
+++ b/slides/src/styles.css
@@ -874,11 +874,11 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
--r-background-color: #000;
--r-main-color: #fff;
--r-main-font-size: 32px;
- --r-link-color: #f7a600;
+ --r-link-color: var(--accent);
--r-link-color-hover: #ffc23e;
- --r-selection-background-color: #f7a600;
+ --r-selection-background-color: var(--accent);
--r-controls-color: rgb(255 255 255 / 0.6);
- --r-progress-color: #f7a600;
+ --r-progress-color: var(--accent);
--r-overlay-element-bg-color: 255, 255, 255;
--r-overlay-element-fg-color: 0, 0, 0;
}
@@ -985,7 +985,7 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is
}
.bento-present-overlay .bento-el[data-link] { cursor: pointer; }
.bento-present-overlay .bento-el[data-link]:hover {
- outline: 2.5px solid var(--bento-accent, #f7a600);
+ outline: 2.5px solid var(--bento-accent, var(--accent));
outline-offset: 3px;
border-radius: 999px;
}
@@ -1615,7 +1615,7 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
font-variant-numeric: tabular-nums;
cursor: pointer;
}
-.sv-timer:hover { color: #f7a600; }
+.sv-timer:hover { color: var(--accent); }
.sv-clock { font-size: 15px; color: #9fb0c3; }
.sv-count { font-size: 15px; color: #9fb0c3; font-variant-numeric: tabular-nums; }
.sv-ctrls { margin-left: auto; display: flex; align-items: center; gap: 6px; }
@@ -1635,7 +1635,7 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
}
.sv-btn:hover:not([disabled]) { background: #2a323c; color: #fff; }
.sv-btn[disabled] { opacity: 0.35; cursor: default; }
-.sv-btn.active { background: #f7a600; border-color: #f7a600; color: #14181d; }
+.sv-btn.active { background: var(--accent); border-color: var(--accent); color: #14181d; }
.sv-main { display: flex; gap: 22px; padding: 14px 22px; align-items: flex-start; flex: 1; min-height: 0; }
.sv-frame {
position: relative;
@@ -1696,7 +1696,7 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
overflow: hidden;
}
.sv-thumb:hover { border-color: #4a5a72; }
-.sv-thumb.current { border-color: #f7a600; }
+.sv-thumb.current { border-color: var(--accent); }
.sv-thumb .sv-frame { box-shadow: none; border-radius: 0; }
.sv-thumb-n {
position: absolute;
@@ -1712,7 +1712,7 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
line-height: 1.4;
text-align: center;
}
-.sv-thumb.current .sv-thumb-n { background: #f7a600; color: #14181d; }
+.sv-thumb.current .sv-thumb-n { background: var(--accent); color: #14181d; }
.sv-grid {
position: fixed;
inset: 0;
@@ -1781,7 +1781,7 @@ body.ed-col-resizing { cursor: col-resize; user-select: none; }
opacity: 0.85;
}
.bento-follow-chip:hover { opacity: 1; }
-.bento-follow-chip.following { border-color: var(--bento-accent, #f7a600); }
+.bento-follow-chip.following { border-color: var(--bento-accent, var(--accent)); }
.bento-follow-chip[disabled] { cursor: default; opacity: 0.7; }
/* Status card: waiting for the presenter / the show has ended / ticket dead. */
.bento-show-card {