Skip to content

[v4] Expose CSS properties also to :host #14478

Closed
@lubomirblazekcz

Description

@lubomirblazekcz

What version of Tailwind CSS are you using?

For example: v4.0.0-alpha.21

Describe your issue

Currently the @theme CSS properties are exposed to :root, which is great but it would be also good to expose it to :host, like this :root, :host {}. This way the CSS properties are also available in web components.

Lets say you have a widget as web component <custom-widget></custom-widget> and inside there is CSS and tailwindcss classes in shadowroot, :root will not work - in this scenario the :host is the :root for the web component.

Eg. how it's done in Winduum here - https://github.com/winduum/winduum/blob/main/src/theme/default.css

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions