# Default template contents

**URL:** <https://discourse.nodered.org/t/default-template-contents/90970>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [14 September 2024 12:11 UTC](https://discourse.nodered.org/t/default-template-contents/90970 "2024-09-14T12:11:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [14 September 2024 12:11 UTC](https://discourse.nodered.org/t/default-template-contents/90970/1 "2024-09-14T12:11:56Z")

</div>

When a ui-template widget is dragged onto the editor, it has a default type of` Widget (Group-Scoped)` and default content, including `<template>`, `<script>` and `<style>` sections.

I can put CSS in the style section and it is applied as expected.

However, if I change the widget type to `CSS (Single Page)` or `CSS (All Pages)` the presence of `<template>`, `<script>` or `<style>` tags breaks the CSS.

Shouldn't CSS be accepted in a CSS type template even if it is within `<style> ... </style>` tags?

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [14 September 2024 15:24 UTC](https://discourse.nodered.org/t/default-template-contents/90970/2 "2024-09-14T15:24:13Z")

</div>

Technically speaking `<style>` is not valid CSS, its HTML. CSS is the content within the tags. We pass the contents through a CSS parser, hence it breaks.

From a UX perspective though, I understand the frustration. Not sure I want us to get into a habit though of just ignoring user's content (e.g. the template/script)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 October 2024 15:25 UTC](https://discourse.nodered.org/t/default-template-contents/90970/3 "2024-10-14T15:25:05Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
