Skip to content

Fixed: Scope injected styles to Diva's root to prevent global style leak - #565

Merged
ahankinson merged 1 commit into
DDMAL:developfrom
etosphere:fix/global-style-leak
Aug 13, 2026
Merged

Fixed: Scope injected styles to Diva's root to prevent global style leak#565
ahankinson merged 1 commit into
DDMAL:developfrom
etosphere:fix/global-style-leak

Conversation

@etosphere

Copy link
Copy Markdown
Contributor

Problem

diva.js injects its stylesheet into document.head as <style id="diva-inline-styles">. Two rules in it were unscoped and therefore affected the entire embedding page, not just Diva:

  • * { box-sizing: border-box } — reapplied the border-box model to every element on the host page, shifting the layout of any component that relied on the default content-box.
  • :root { color-scheme: light } — forced the document's color scheme, overriding host dark mode and changing native control rendering.

Fix

Scope both rules to Diva's own root (src/styles/app.css):

  • box-sizing is now applied to .diva-app and its descendants only;
  • color-scheme: light moved from :root onto the .diva-app rule.

The injected <style id="diva-inline-styles"> element carried two
page-wide rules — `* { box-sizing: border-box }` and
`:root { color-scheme: light }` — that altered every element and the
color scheme of the host page. Scope both to the .diva-app tree.
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a078d683-bb45-40ec-9d9b-cf8074b594ab

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@ahankinson

Copy link
Copy Markdown
Member

I’m fixing this in a separate bit of work. I’ll keep this open to remind me tho

@ahankinson
ahankinson merged commit 0d55149 into DDMAL:develop Aug 13, 2026
2 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