fasthtml icon indicating copy to clipboard operation
fasthtml copied to clipboard

Live Reload is not loading custom style in header

Open johnkflam opened this issue 4 months ago • 0 comments

Important Notice We do not provide support through GitHub issues. For community-based help, please use either:

If you're reporting a bug, please continue with this template.

Describe the bug A clear and concise description of what the bug is.

Minimal Reproducible Example Provide a minimal code snippet that reproduces the issue. This is crucial for us to understand and fix the bug quickly.

# Your code here

Expected behavior this line, kwargs["hdrs"] = [*(kwargs.get("hdrs") or []), self.LIVE_RELOAD_HEADER], in live_reload.py is not putting the custom style defined with fast_app() in the header section.

For example: css = Style('h2 {color: red;}') app, rt = fast_app(pico=True,hdrs=(css), live=True)

is putting the CSS as well as the injected reload codes in the body of the page.

Environment Information Please provide the following version information:

  • fastlite version:
  • fastcore version:
  • fasthtml version: version = "0.6.9" from .core import *

Confirmation Please confirm the following:

  • [ ] I have read the FAQ (https://docs.fastht.ml/explains/faq.html)
  • [ ] I have provided a minimal reproducible example
  • [ ] I have included the versions of fastlite, fastcore, and fasthtml
  • [ ] I understand that this is a volunteer open source project with no commercial support.

Additional context Add any other context about the problem here.

Screenshots If applicable, add screenshots to help explain your problem.

johnkflam avatar Oct 09 '24 16:10 johnkflam