-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8.0.0-beta.3 - Issue with stylesheets #1139
Comments
afcapel
added a commit
that referenced
this issue
Jan 25, 2024
To track stylesheets and styles that we can dynamically remove when navigating. We introduced this behaviour in #1128 and thought it would be a good default to avoid full page reloads when styles change. However, it seems it's quite common for libraries to add stylesheets and styles to the head that they want to keep around. For example, see - #1133 - #1139 So let's make this behaviour opt-in by adding a `data-turbo-track="dynamic"` attribute to stylesheets and styles that we want to dynamically remove when they are no longer in a new page navigation. This avoids any breaking changes for existing apps.
We've thought about this and, to avoid breaking changes, we're are going to make the behavior to remove unused stylesheets opt-in, instead of the new default. See #1140 |
afcapel
pushed a commit
that referenced
this issue
Jan 25, 2024
To track stylesheets and styles that we can dynamically remove when navigating. We introduced this behaviour in #1128 and thought it would be a good default to avoid full page reloads when styles change. However, it seems it's quite common for libraries to add stylesheets and styles to the head that they want to keep around. For example, see - #1133 - #1139 So let's make this behaviour opt-in by adding a `data-turbo-track="dynamic"` attribute to stylesheets and styles that we want to dynamically remove when they are no longer in a new page navigation. This avoids any breaking changes for existing apps.
@meneerprins thanks for reporting. This was fixed in #1140 We'll release a new beta version soon. |
domchristie
pushed a commit
to domchristie/turbo
that referenced
this issue
Jul 20, 2024
To track stylesheets and styles that we can dynamically remove when navigating. We introduced this behaviour in hotwired#1128 and thought it would be a good default to avoid full page reloads when styles change. However, it seems it's quite common for libraries to add stylesheets and styles to the head that they want to keep around. For example, see - hotwired#1133 - hotwired#1139 So let's make this behaviour opt-in by adding a `data-turbo-track="dynamic"` attribute to stylesheets and styles that we want to dynamically remove when they are no longer in a new page navigation. This avoids any breaking changes for existing apps.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: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).The text was updated successfully, but these errors were encountered: