Skip to content

CSS reload strategy that reloads any style tag with @import directives#172

Merged
josevalim merged 1 commit into
phoenixframework:mainfrom
cblavier:main
Jul 23, 2025
Merged

CSS reload strategy that reloads any style tag with @import directives#172
josevalim merged 1 commit into
phoenixframework:mainfrom
cblavier:main

Conversation

@cblavier

@cblavier cblavier commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

Resolves #171

Improves the current CSS reload strategy:

  • detects <style/> tags with @import in their body
  • detects the imported URL (supporting different formats or URL and optional parameters)
  • updates the URL with a ?vsn param and triggers a repaint

CSS import spec: https://developer.mozilla.org/en-US/docs/Web/CSS/@import

@cblavier cblavier force-pushed the main branch 3 times, most recently from 592f403 to 885408f Compare July 21, 2025 15:26
@josevalim josevalim merged commit 1c5c150 into phoenixframework:main Jul 23, 2025
1 of 2 checks passed
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

please give it a try and we can ship a new version if it all works as expected.

@cblavier

Copy link
Copy Markdown
Contributor Author

Thanks
Let’s wait for @woylie to test it when he returns next week.

@woylie

woylie commented Jul 28, 2025

Copy link
Copy Markdown

Thanks Let’s wait for @woylie to test it when he returns next week.

Live reload works with the main branch and phoenix_storybook 0.9.1. Thank you for this update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Live reloading @import CSS files

3 participants