fix: replace hardcoded colors with Obsidian CSS variables for theme compatibility

Community plugin review requires theme-aware colors. Also document why
SOP loading uses Node fs instead of the Vault API (absolute paths may
point outside the vault).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
liyachen 2026-07-18 16:45:28 -04:00
parent b42b5722e6
commit 47ec3d5956
2 changed files with 7 additions and 5 deletions

View file

@ -126,7 +126,9 @@ export default class VaultAutopilotPlugin extends Plugin {
create: async (p, content) => { await this.app.vault.create(p, content); },
readFileSync: (p) => {
// sopPath accepts both absolute paths and vault-relative ones (the
// Customize button fills vault-relative paths).
// Customize button fills vault-relative paths). Absolute paths may
// point outside the vault, which the Vault API cannot read — hence
// Node fs instead of this.app.vault.adapter.
const abs = nodePath.isAbsolute(p)
? p
: nodePath.join((this.app.vault.adapter as FileSystemAdapter).getBasePath(), p);

View file

@ -42,7 +42,7 @@
.vap-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vap-body { padding: 10px 12px 12px; }
.vap-creator { font-size: 11px; color: #e05a2b; font-weight: 500; display: block; margin-bottom: 4px; }
.vap-creator { font-size: 11px; color: var(--color-orange); font-weight: 500; display: block; margin-bottom: 4px; }
.vap-title {
font-size: 13px; font-weight: 600; line-height: 1.4; margin-bottom: 6px;
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
@ -52,17 +52,17 @@
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vap-footer { display: flex; justify-content: space-between; }
.vap-views { font-size: 11px; color: #22863a; font-weight: 500; }
.vap-views { font-size: 11px; color: var(--color-green); font-weight: 500; }
.vap-date { font-size: 11px; color: var(--text-faint); }
.vap-deep-badge {
position: absolute; top: 7px; left: 7px;
font-size: 10px; font-weight: 600;
background: #6c3fcc; color: white;
background: var(--interactive-accent); color: var(--text-on-accent);
padding: 2px 7px; border-radius: 4px;
pointer-events: none;
}
.vap-card-deep { border-left: 3px solid #6c3fcc; }
.vap-card-deep { border-left: 3px solid var(--interactive-accent); }
/* Video embeds the plugin writes into notes render wide at 16:9 instead of
the cramped default. Scoped to the two platforms we embed.