Styles not applied to previously used components of other pages #571
-
|
This might just be a symptom of something else that is going on When SWUP transitions to a new page, some of the specific styles that need to be applied to components that existed in a previous page do not have their new styles applied: Example - on the home page I have a couple of featured websites - When I transition to the website page - where these components are used again the new styles applied to them are not being used: If I reload the page then the correct styles are applied - It might be worth noting that the CSS styles being used for these two components are different - on the home page it uses flex and on the transition to page it uses grid I cannot image this might be an issue but worth noting. This is also happening in other places such as the header were page specific css is being applied. My gut feeling says that this is a caching issue. Any thoughts? Context and environment I am running a website using a CMS (Craft CMS) I am using the JS CND to load SWUP in the footer of my website I have wrapped my page in a div that applies the SWUP transition - the CSS is in the head of the page outside of this div I did try to destroy the page cache using the SWUP API but this did not work: Any thoughts would be great - thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
Update: the Head Plugin now supports waiting for new stylesheets to load before showing the next page. Previous answer for swup 2:
|
Beta Was this translation helpful? Give feedback.
-
|
@wallythewebdev would you mind creating a reduced test case of your issue by forking our template over at CodeSandbox? That way we will know exactly what your issue is. |
Beta Was this translation helpful? Give feedback.



Update: the Head Plugin now supports waiting for new stylesheets to load before showing the next page.
Previous answer for swup 2: