Skip to content

fix(desktop): remove applied custom CSS when the preference is cleared - #5633

Merged
Jocs merged 2 commits into
marktext:developfrom
woahwhattheheck:astra7ca6/marktext375-custom-css-clear-20261005
Oct 6, 2026
Merged

Jocs merged 2 commits into
marktext:developfrom
woahwhattheheck:astra7ca6/marktext375-custom-css-clear-20261005

Conversation

@woahwhattheheck

@woahwhattheheck woahwhattheheck commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Refs #375 (scoped renderer fix; not the general plugin/theme architecture the issue discusses).

The renderer watches the customCss preference and calls addCustomStyle when it changes. Previously, falsy customCss values returned before reaching the #custom-styles node, so clearing applied CSS left the old stylesheet active in the running window.

The current change consolidates removal into the existing falsy-value guard as requested in review: if customCss is falsy, remove #custom-styles when present and return. Nonempty CSS keeps the existing create/replace path. No preference, dependency or IPC surface changes.

Verification: exact current source at e738cf2, with the consolidated falsy-value branch and unchanged nonempty path inspected. No Electron/DOM execution, typecheck or test suite was run.

Original-contributor compensation request

This merged PR is the canonical original @woahwhattheheck implementation submitted for IssueHunt-funded issue #375. I request recognition of this contribution, confirmation of eligibility and allocation from the current provider-displayed $30 funded pool, confirmation of the payable amount, and the payout or withdrawal steps and timing.

Please keep compensation attached to this merged carrier, #5633. PR #5659 was closed as a duplicate and should not replace this canonical contribution record. Provider allocation, award, invoice, settlement, and received payment remain distinct records to confirm through the applicable IssueHunt process.


IssueHunt Summary

Handle the explicit empty-string customCss value before the existing early return so the #custom-styles node is removed when the preference is cleared.
@Jocs
Jocs merged commit ceda0f4 into marktext:develop Oct 6, 2026
12 checks passed
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