Skip to content

Missing classes with Stencil Hydrate #29

Description

@mayerraphael

As this plugin is a rollup plugin (no pluginType: 'css'), this is run AFTER the stencil hydrate plugin is run.

The problem:

Stencil hydrate adds comments to the css classes so the scoped classes can later be rewritten to work hydrated component again.

Now with this plugin, all tailwind inline-classes and utility classes, which generate more classes (:hover, lg:, md: and so on) are added AFTER the comments for the hydrate package have been created. Resulting in broken styles with SSR.

We have created our own plugin thanks to your source code (and searching the tailwindcss source) which runs as a css plugin, fully creating all css classes BEFORE any Stencil plugin runs.

One drawback is that we need to load the tsx file manually (like tailwindcss does with changedContent) and don't have any _sourceTsx already set (has same content as sourceCss), as the plugin is run only on css files.

Thanks for all your hard work.

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