bigskysoftware / bigskysoftware/htmx-extensions
htmx-head extension not appending inline style element
- Dominant language
- JavaScript
- Stars
- 284
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Description
My use case is to send custom style script after retrieving it from the Django backend. Here is the setup I have
*base.html*
```html
{% load i18n %}
{% load compress %}
{% load static %}
{% translate 'Processing...' %}
.powered-by {
display: block;
}
#page-content:has(.content) + .powered-by {
display: none;
}
{% block content %}
{% endblock content %}
```
and the response content is
*response.html*
```html
Test Title
body {
background-color: #ffcccc;
}
#main-body {
padding: 20px;
font-size: 1.5rem;
color: #333;
}
Content Here
```
This is working fine to put `` from head to the base page and the `main-body` content also, however it fails to put `<style>` element to the base html
Contributor guide
Research direction
Reproduce the issue with base.html and response.html, loading htmx-ext-head-support-2.0.2.js and the shown hx-head="re-eval" style element. Inspect the head-support extension entry point and verify that the response's inline style is appended to the base page while the title and out-of-band body swap continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100