matyunya / smelte

UI framework with material components built with Svelte and Tailwind CSS
https://smeltejs.com/
MIT License
1.53k stars 114 forks source link

Tailwind classes are not exported to global.css #252

Open AgarwalPragy opened 3 years ago

AgarwalPragy commented 3 years ago

Issue: Not all the required tailwind classes are exported to public/global.css, which leads to unstyled components

Steps to reproduce:

  1. Initialize project from official svelte template
    npx degit sveltejs/template svelte-app
    cd svelte-app
    node scripts/setupTypescript.js
  2. Install smelte
    npm i smelte
  3. Add the Smelte Rollup plugin (after svelte but before css).
  4. Include material icons in your template (public/index.html)
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
  5. Update src/App.svelte to the following

    <script lang="ts">
        import "smelte/src/tailwind.css";
    </script>
    
    <main>
        <div class="bg-red-200">This isn't working</div>
        <div class="bg-blue-200">This works!</div>
        <div class="bg-green-200">This isn't working either</div>
    </main>
  6. run the project & goto localhost:5000/
    npm run dev

Result: image

Expected: The 3 divs should have a background color of red, blue and green respectively.

wktdev commented 2 years ago

Is there a solution for this? I am having the same problem