AnswerDotAI / AnswerDotAI/fasthtml

Live Reload is not loading custom style in header

Open
#507 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Jupyter Notebook
Stars
7k
Forks
319
Avg merge
28m
Merged PRs (30d)
3

Description

**Important Notice**
We do not provide support through GitHub issues. For community-based help, please use either:
- GitHub Discussions tab
- Our [Discord channel](https://discord.gg/qcXvcxMhdP)

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.

```python
# 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.