Skip to content
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

Hot Reload for component CSS #21

Closed
raystubbs opened this issue Apr 22, 2024 · 1 comment
Closed

Hot Reload for component CSS #21

raystubbs opened this issue Apr 22, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@raystubbs
Copy link
Owner

Currently hot reload for CSS URL's found in components will only work if the same URL is also referenced from the top level DOM. This is because those top level links are the only ones that shadow-cljs and figwheel will hot reload; so we observe them to determine when to update the component CSS.

But I have an idea that may work to enable hot reload for CSS not referenced in the top level.

The Idea:
For any CSS URLs referenced from a component and not the top level, dynamically add a link in the top level, with a media query that always fails. This will give the hot reload engine and Zero a node to synchronize on, without affecting the styling of the top level document.

@raystubbs raystubbs added the enhancement New feature or request label Apr 22, 2024
@raystubbs
Copy link
Owner Author

Closed by #22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant