In an HTML form (form_template.html), the text inside a top-level <style> or <script> element is dropped when the app runs.
The designer preview shows the CSS applied, but in the running app DevTools shows <style></style> with 0 characters.
Classic YAML HtmlTemplate forms on the same page keep their <style> content, so it is specific to the new HTML form templates.
To reproduce
- Create a new app.
- Add an HTML form whose
form_template.htmlis a top-level<style>followed by a<div>:<style>.x{color:red}</style> <div class="x">hello</div> - Open the form in the designer: “hello” is red.
- Run the app: “hello” is black, and the
<style>element in DevTools is empty. - Put the same markup in a classic
HtmlTemplateYAML form: it works.
Expected: the <style> text reaches the browser and the rule applies at runtime, as it does in the designer.
Actual: the element is emitted as <style></style>; all text inside <style>/<script> is lost.
Workaround: move the CSS into theme.css (or a theme asset referenced by <link>) instead of an inline <style>.
Seen 16 Sep 2026 on a hosted app, anvil CLI 0.7.2.