vimeshjs / vimesh-ui

Vimesh UI is an ultra lightweight library to build UI components for Alpine.js
MIT License
125 stars 5 forks source link

tailwind styles are dropped with x-include ? #7

Open bakman2 opened 10 months ago

bakman2 commented 10 months ago

Example:

<template x-if="user == ''">
   <div x-include="user.html"></div>
</template>

user.html

<div class="w-full py-8 space-y-4">
  <div class="rounded p-4 text-white bg-blue-500 text-center text-xl font-medium">User</div>
  <template x-for="name in users">
    <div class="rounded p-4 text-white bg-gray-700 cursor-pointer hover:bg-blue-600" @click="user = name.username">
      <div>
        <div x-text="name.display"></div>
        <div class="text-xs text-gray-400" x-text="name.username"></div>
      </div>
    </div>
  </template>
</div>

Issue: Some styles are rendered, others are not ? (ie. there is no "bg-blue-500" and the "space-y-4" is being ignored, very strange behaviour ?

image
bakman2 commented 10 months ago

I am using tailwind via cdn, which is javascript, perhaps the styles are not applied when new files are coming in ?

xinjie-zhang commented 10 months ago

I could not reproduce your issue. Please check https://stackblitz.com/edit/web-platform-4hvvxb?file=index.html