Skip to content

Fix custom theme not applying after YouTube CSS changes#3791

Merged
ImprovedTube merged 1 commit intocode-charity:masterfrom
veerlakshay:fix/custom-theme-3784
Apr 16, 2026
Merged

Fix custom theme not applying after YouTube CSS changes#3791
ImprovedTube merged 1 commit intocode-charity:masterfrom
veerlakshay:fix/custom-theme-3784

Conversation

@veerlakshay
Copy link
Copy Markdown
Contributor

Fixes #3784

Custom theme was using html, [dark] as its CSS selector, which allowed YouTube's own stylesheets to override the custom CSS variables. Changed to html[it-theme=custom], html[it-theme=custom] [dark] for higher specificity and proper scoping.

Also scoped the masthead background-color rule to html[it-theme=custom], and moved the injected <style> from document.documentElement to document.head.

Root cause: All other themes (black, plain, night, etc.) use static extension CSS in styles.css with html[it-theme=X] selectors. Custom theme was the only one relying entirely on a JS-injected <style> with the broad html, [dark] selector — making it vulnerable to being overridden by YouTube's own stylesheets.

@ImprovedTube ImprovedTube merged commit 3efce0e into code-charity:master Apr 16, 2026
@ImprovedTube
Copy link
Copy Markdown
Member

Thank you! @veerlakshay
reproduced and tested? (else @CegooK @dobbs68 may want to test)

@ImprovedTube ImprovedTube added the important Critical or common. Thus to prioritize label Apr 16, 2026
@ImprovedTube
Copy link
Copy Markdown
Member

ImprovedTube commented Apr 16, 2026

  • We may shorten the whole static themes CSS and inject the majority of details via JS (performance for all users)
    • other than background color and text color which should be added first of all, view CSS too and including the custom theme ( To minimize potential disturbance through background color flashing; Speed & Redundance )

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

Labels

important Critical or common. Thus to prioritize

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🐞custom theme not working in improve youtube extension

2 participants