Skip to content

8.0.0-beta.3 - Issue with stylesheets #1139

@meneerprins

Description

@meneerprins

For some context, I am using a Ruby on Rails app with Vite Ruby. Now with the latest beta version this PR is included: Remove unused stylesheets when navigating. That solves the issue of overlapping styles when switching between layouts (when you remove the data-turbo-track="reload" attribute) but it also causes some issues:

  • When the Vite dev server is on, during a Turbo navigation, all the styles disappear (probably because the stylesheets gets injected)
  • In my case, many stimulus controllers are lazy loaded and when you import the styles of a library inside the stimulus controller for example import '@splidejs/splide/dist/css/splide-core.min.css';, the styles also get removed.

Anyone has an idea for a solution for this? (I saw there is some patch for Trix here https://github.com/hotwired/turbo/pull/1133/files to add data-turbo-permanent but in many cases you have no control over the tags when they are injected by either tools or 3rd party libraries).

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