Skip to content

docs(embedding): fix the troubleshooting row that denies the shadow root - #265

Merged
sydevs-bot merged 1 commit into
mainfrom
claude/docs-261-shadow-root-troubleshooting
Oct 9, 2026
Merged

sydevs-bot merged 1 commit into
mainfrom
claude/docs-261-shadow-root-troubleshooting

Conversation

@sydevs-bot

Copy link
Copy Markdown
Contributor

Summary

Change outline

Contract — docs/embedding.md, Troubleshooting

One row of the Troubleshooting table, paraphrased as rules. The diff is one line; this is what it asserts.

 Row: "The widget looks wrong on your site only"
-  your global CSS is reaching into the widget
-  the widget has no shadow DOM to keep your CSS out
+  a selector of yours cannot match inside the shadow root
+  an inherited property the widget does not restate on its own root reaches its text
+  your root `font-size` rescales the calendar's rem-sized grid, and nothing else
+  the `sahaj-atlas-fonts` `<style>` is absent from your `<head>`
+  → see "What the widget does to your page" for each mechanism

The three replacement paths were read off the shipped stylesheet, not the source. pnpm build, then grep -o '\.sy-atlas{[^}]*}' dist/assets/sheet-*.js, emits two root rules carrying color, font-family, letter-spacing, text-align, text-transform, word-spacing and line-height.

Preview

The deploy carries no part of this change — the diff is a documentation file, which neither build output includes. The row renders on the branch:

Test results

  • Lean gate: ✓ lint + typecheck + test:run (136 files, 1682 tests)
  • Targeted specs: none — no spec reads docs/embedding.md as text
  • Build: ✓ pnpm build, including assert:css and assert:maps

Manual verification

  1. Read the new row against the section it links, ## What the widget does to your page — the row should add no mechanism that section does not explain.
  2. Confirm the third path reads consistently with "sahaj-atlas-fonts stays in your document on purpose" under ### The style-tag ids.

Notes for reviewer

Nothing a host can observe changed, so CHANGELOG.md is untouched per the ticket's fourth criterion, and the in-tree consumers (WeMeditateWeb/lib/atlas-embed.ts, the WordPress templates) need nothing.

No spec was added. A spec could only pin a literal phrasing, not the claim — docs/testing.md's vacuous-assertion rule is the argument against one, since the next wrong sentence would word itself differently and pass.

Three findings filed on the way, all #236's unswept blast radius:

Detail

Two wordings were corrected before the push, both caught by checking the build output rather than the source.

The first draft offered line-height as an example of an inherited property that crosses. It does not: Tailwind's preflight collapses html, :host onto .sy-atlas, so the shipped sheet carries .sy-atlas{line-height:1.5}. The guide's own list at the "Two things still cross" paragraph names six restated properties and omits that seventh, which is why the final row names no examples at all — a list here would be the complement of a list maintained elsewhere and already incomplete.

::part was considered and dropped. The ticket's approach offered it as a remaining path. Nothing in src/ sets a part attribute and nothing sets exportparts, so a host cannot reach the widget that way at all.

The third path deliberately does not say what removes the font <style>. The review pass argued CSP is a likelier cause than an optimizer, and it is right about the mechanism — src/styles/sheet.ts:74-85 constructs the sheet, so sahaj-atlas-fonts (src/styles/fonts.ts:131) is the only inline <style> the widget still puts in the host document. But 'unsafe-inline' also licenses style attributes, which this widget sets everywhere, so what a host actually sees needs a browser rather than a source read. That is #263, not this PR.

Review pass: /simplify and /code-review high — the pr-review-toolkit plugin is not installed in a routine session, which ListPlugins confirms. The quality pass ran as one agent covering all four angles rather than four, because the diff is a single line of prose with no code for the reuse, efficiency or altitude lenses to act on. Its findings on cell length and the duplicated property list were applied; the compressed cell is 322 characters against the table's existing widest of 336, so the next prettier --write on this file pads the rows to the same width as before. The file is not Prettier-clean on main either, so it was left unformatted.

Security review: skipped, correctly — docs/embedding.md matches no alternative in securityReview.triggerPattern.

comment-lint.mjs --base origin/main: 0 changed files, no banned comment added.

Closes #261


Generated by Claude Code

The "looks wrong on your site only" row told integrators their global CSS
was reaching into the widget and that there was no shadow DOM to keep it
out. Both halves stopped being true at #236, and five other passages in
the same file say the opposite — so the row sent a host looking for a
cause that cannot exist.

It now points at the three paths that survive an open shadow root: an
inherited property the widget does not restate on its own root, the host's
root `font-size` reaching the calendar's rem-sized grid, and the
`sahaj-atlas-fonts` `<style>`, the one rule that cannot live inside the
root because an `@font-face` registered there is never applied.

The cell names each path and links the section that explains it, rather
than re-explaining all three. Every mechanism already has a home under
"What the widget does to your page", and a duplicate in a triage column is
the copy nobody updates. Keeping it at 322 characters also keeps it under
the table's existing widest cell, so the next `prettier --write` on this
file still pads the rows to 336 rather than rewriting all 25.

Which inherited properties the widget restates is deliberately left to
that section. The shipped `.sy-atlas` rules carry `line-height` — from
Tailwind's preflight, not `host-reset.css` — on top of the six the section
lists, so an example list here would be the complement of a list that is
maintained elsewhere and already incomplete.

`::part` is absent because nothing in `src/` sets a `part` attribute, so a
host cannot reach the widget that way at all.

Guide accuracy only, so `CHANGELOG.md` is untouched — nothing a host can
observe changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying sahajatlas with  Cloudflare Pages  Cloudflare Pages

Latest commit: 473353f
Status: ✅  Deploy successful!
Preview URL: https://e5e18e24.sahajatlas.pages.dev
Branch Preview URL: https://claude-docs-261-shadow-root.sahajatlas.pages.dev

View logs

@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Adversarial review skipped: 1 file(s), 2 changed line(s), under review.skipWhen. Say @sydevs-bot review to force one.

🤖 sydevs dispatcher

@sydevs-bot
sydevs-bot added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit 727cf34 Oct 9, 2026
21 checks passed
@sydevs-bot
sydevs-bot deleted the claude/docs-261-shadow-root-troubleshooting branch October 9, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

docs(embedding): fix the troubleshooting row that denies the shadow root

3 participants