#Selecting `<i>` element and styling with `@apply` using `set:html`

2 messages · Page 1 of 1 (latest)

atomic river
#

I am using a Git CMS that returns plain HTML in a JSON file.

{
  "text": "<i>Hello</i> World"
}

I am inserting the HTML strings with the set:html template directive.

<h1 set:html={html}></h1>

When I am trying to select the <i>tag using the @apply method with the tailwind integration the styling is not working.

<style>
  h1 i {
    @apply text-red-500;
  }
</style>

I created a demo that shows the issue:
https://stackblitz.com/edit/github-tjp1qz?file=src/pages/index.astro

dawn current