Skip to content

Fix extension load inconsistencies and improve CSS scoping with dark mode support#10

Merged
navidshad merged 9 commits intomainfrom
dev
Apr 30, 2026
Merged

Fix extension load inconsistencies and improve CSS scoping with dark mode support#10
navidshad merged 9 commits intomainfrom
dev

Conversation

@navidshad
Copy link
Copy Markdown
Collaborator

@navidshad navidshad commented Apr 30, 2026

🏷️ PR Title:
Fix extension load inconsistencies and improve CSS scoping with dark mode support

📋 Summary

This PR addresses several issues related to the extension's styling and loading behavior. It improves popup styling by applying new CSS scoping to isolate styles, fixes the login view for the light theme, and scopes the extension CSS to prevent Tailwind preflight styles from affecting host pages. Additionally, it applies dark mode styles within the scoped extension wrapper and classifies the Netflix scope wrapper before insertion to ensure proper document scoping. The MS Teams integration has been removed, and content-script matches have been tightened to improve performance and reliability.

🔗 Related Tasks

#86exa5j3c - Fix extension load inconsistency on YouTube, scope Netflix wrapper, apply dark mode inside scoped extension wrapper, and tighten content-script matches

📝 Additional Details

  • Removed Microsoft Teams integration to streamline the extension.
  • Merged code changes improving extension stability and UI consistency across different themes and platforms.

📜 Commit List

  • 0740c55 fix: improve the popup style with new scoping.
  • d9343c6 fix: login view light theme
  • 5f25ccc chore: remove MS Teams integration and tighten content-script matches #86exa5j3c
  • 0014974 fix: classify Netflix scope wrapper before insertion and document scoping #86exa5j3c
  • 3562faf fix: apply dark mode inside the scoped extension wrapper #86exa5j3c
  • 451c452 fix: scope extension CSS to prevent Tailwind preflight bleeding onto host pages

navidshad and others added 9 commits April 30, 2026 16:15
…host pages

Tailwind preflight from src/tailwind.css and @codebridger/lib-vue-components was being injected into document.head, where its universal selectors (`*, ::before, ::after`, `button`, `img`, ...) reset host-page styles. On YouTube this broke icon rendering and prevented the profile page video grid from loading.

Add postcss-prefix-selector to scope every selector under `.subturtle-scope` and tag all mount roots (#subturtle-app, #subturtle-popup) and teleport target wrappers with that class. The transform is idempotent (node_modules CSS was visited more than once) and drops `body` rules so the library's page-level background/font do not paint our wrapper.

#86exa5j3c
…ping #86exa5j3c

The Netflix initializer inserted #subturtle-app into the DOM before adding
the `subturtle-scope` class, so the MutationObserver in the settings store
saw an unclassed element and skipped theme application — leaving Netflix
without dark mode and any observer-based scope handling. Reorder so the
id, classes, and inline styles are set before insertion, matching YouTube
and MS Teams.

Add clarifying comments where the WHY is non-obvious:
- postcss.config.js: top-level overview of the scoping strategy plus
  inline notes on the idempotency guard, body/html/:root drops, and the
  .dark compound rewrite.
- settings store: explain why dark/light lives on .subturtle-scope
  elements (compound selector rewrite) instead of <html>, and why the
  MutationObserver is needed for teleport wrappers mounted after init.
- Teleport wrappers (WordSelectionRectangle, YouTube/MS Teams Index.vue):
  flag that the teleport target escapes #subturtle-app.
- _support-template initializer: canonical note describing the role of
  the subturtle-scope class for new surfaces.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… #86exa5j3c

The MS Teams surface relied on a Trusted-Types monkey-patch that was
suspected of breaking YouTube but turned out to be a non-issue once the
Tailwind preflight bleed was fixed. With no active MS Teams users on the
extension, drop the integration to reduce surface area.

- Delete src/subtitle/ms-team (Index.vue, components, initializer, static).
- Remove the msTeam initializer import and the trusted-types-polyfill
  side-effect import from src/main.ts.
- Drop https://teams.microsoft.com from manifest content_scripts and
  tighten the YouTube match to https://www.youtube.com/watch?* so the
  bundle only loads on actual watch pages.
- Update src/subtitle/README.md to remove MS Teams references.

Keep src/trusted-types-polyfill.ts in the tree (now unimported) with a
generalized doc comment, since it remains the canonical workaround for
hosts with strict Trusted Types CSP and may be opted into by future
content scripts that need to run on such sites.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…d-inconsistency-on-youtube_Navid-Shad

 Remove MS Teams integration and scope extension styles and scripts #86exa5j3c
@navidshad
Copy link
Copy Markdown
Collaborator Author

@navidshad navidshad changed the title Dev Fix extension load inconsistencies and improve CSS scoping with dark mode support Apr 30, 2026
@navidshad navidshad merged commit 2b22b6d into main Apr 30, 2026
1 check 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.

1 participant