Skip to content

fix(renderer): clear applied custom CSS when preference is emptied - #5659

Closed
woahwhattheheck wants to merge 1 commit into
marktext:developfrom
woahwhattheheck:swe14/custom-css-clear-20261008
Closed

woahwhattheheck wants to merge 1 commit into
marktext:developfrom
woahwhattheheck:swe14/custom-css-clear-20261008

Conversation

@woahwhattheheck

Copy link
Copy Markdown
Contributor

Refs #375.

app.vue watches the customCss preference and calls addCustomStyle on change. The preference defaults to the empty string; previously addCustomStyle returned at if (!customCss) before touching the #custom-styles node, so clearing the preference left the old stylesheet applied. The new branch handles the explicit empty string first and removes the node.

Verification: postimage theme.ts (7,955 bytes, blob 91fe3751) reconstructed from the pinned preimage b9405317 at develop 0d8dba02; patch is one hunk, +4 lines. No runtime execution performed.

Compensation request

Please register this submission under issue #375's advertised IssueHunt funding for whatever scope the maintainers award; acceptance and payment per IssueHunt's ordinary process.

addCustomStyle returned early on the empty string before reaching the #custom-styles node, leaving the previous stylesheet active after clearing. Handle the explicit empty case by removing the node.
@Jocs

Jocs commented Oct 8, 2026

Copy link
Copy Markdown
Member

Why submit the same PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants