Skip to content

Feature request: global option to disable Shadow DOM #41

Description

@boustanihani

It would be great to have a global configuration option to disable Shadow DOM for all components, something like:

import component from 'alpinejs-component'
Alpine.plugin(component.configure({ shadowDOM: false }))

Why this would be useful:

  • Many projects use x-component as a partials/include mechanism, not for encapsulation. Shadow DOM is overhead in that case.
  • Global styles (Tailwind, design system tokens, resets) don't penetrate shadow DOM. x-component-styles helps but it's a workaround, not a solution.
  • $refs don't resolve across shadow roots.

A global toggle would keep the current behavior as default while giving projects that don't need encapsulation a clean opt-out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions