Search code examples
visual-studio-codehandlebars.jstailwind-cssinline-scripting

Tailwind CSS IntelliSense in Visual Studio Code does not provide suggestions in an inline script?


I am trying to get the TailwindCSS IntelliSense working inside an inline script. I am using handlebars in a simple One-Pager, however the autocompletion doesn't work in side the script tag.

<div id="template" class="w-4/5 swiper-wrapper lg:w-2/3">
  <script id="output" type="text/x-handlebars-template">
    {{#each images}}
      <div class="swiper-slide">
        <div class="swiper-carousel-animate-opacity">
          <img class="bg-red" src="{{url}}" alt="{{alt}}" />
        </div>
      </div>
    {{/each}}
  </script>
</div>

I tried all the suggestions in the following thread (Tailwind CSS IntelliSense does not provide suggestions in a ReactJS project?) but it doesn't work for the script. Would be nice, if someone could help.


Solution

  • The issue is now fixed.

    https://github.com/tailwindlabs/tailwindcss-intellisense/issues/722

    0.9.8

    • Fix invalidTailwindDirective linting with CRLF file endings (#723)
    • Add support for Handlebars template scripts (<script type="text/x-handlebars-template">) (#726)
    • Improve JavaScript comment detection (#727)
    • Add modifier completions for @apply and classRegex setting (#732)
    • Add bundled version of @tailwindcss/container-queries (#733)
    • Support InitializeParams.rootUri (#725)
    • Add htmldjango to default supported languages (#721)