Skip to content

passing string into is:inline style tag doesn't render said string as child text #11167

@matthewp

Description

@matthewp

Astro Info

❯ npx astro info
Astro                    v4.9.2
Node                     v18.20.3
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

<style is:inline>{` h1 { color: ${color}; } `}></style>

Renders the code instead.

What's the expected result?

I was sort of expecting it to put the string child in there. Maybe there's a security consideration and set:html is better?

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-ncpwkk?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions