Skip to content

Add scoped custom element registry example - #463

Open
jpzwarte wants to merge 28 commits into
oddbird:fix/shadow-options-and-packagingfrom
jpzwarte:add-scoped-custom-element-registry-example
Open

Add scoped custom element registry example#463
jpzwarte wants to merge 28 commits into
oddbird:fix/shadow-options-and-packagingfrom
jpzwarte:add-scoped-custom-element-registry-example

Conversation

@jpzwarte

@jpzwarte jpzwarte commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

As i said in #459 (comment), i don't think this example currently adds anything. There are no browsers that don't support CSS Anchor Positioning v1, but do support Scoped Custom Element Registries.

jpzwarte and others added 28 commits July 25, 2026 12:17
`position-area` in a `:host` rule positions the shadow host, which lives
in the outer tree, but the generated `--pa-value-*` mapping rule was
inserted into the roots being polyfilled. A `<style>` in a shadow root
never matches that root's own host, so the values stayed undefined and
the host was left unpositioned.

Record the style container of each target while the rules are generated,
and insert the stylesheet into those containers instead. Targets inside a
polyfilled shadow root resolve to the same container as before.

Refs oddbird#444

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…-host

fix: insert position-area mapping styles into each target's own root
fix: inline styles were not being shifted to custom properties
@netlify

netlify Bot commented Aug 16, 2026

Copy link
Copy Markdown

Deploy Preview for anchor-position-wpt canceled.

Name Link
🔨 Latest commit d502c29
🔍 Latest deploy log https://app.netlify.com/projects/anchor-position-wpt/deploys/6a81815a1b7d690008696ed8

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.

3 participants