jacob-8 / kitbook

Documentation, Prototyping, Inspection & Testing Workbench Tool for Svelte (SvelteKit Storybook alternative)
https://kitbook.vercel.app/
MIT License
59 stars 4 forks source link

integration with tailwindcss #13

Closed yellowmachine closed 7 months ago

yellowmachine commented 1 year ago

Is it possible to see my components with tailwindcss classes applied?

yellowmachine commented 1 year ago

I have a file app.css:

@tailwind base;
@tailwind components;
@tailwind utilities;

I have added it in my .mdfile:

import "@/app.css";

and it's not exactly what I see in my app but very similar.

yellowmachine commented 1 year ago

This is my DateInput.md:

<script lang="ts">
  import "@/app.css";
  import { Story } from 'kitbook';
  import DateInput from './DateInput.svelte';

  let date = new Date()
</script>

# DateInput

<Story name="show date input" knobs={{label: "Date of birth"}} let:knobs={{label}}>
  <div class="bg-white font-medium text-asteamur-400">  
    <DateInput name={"date"} bind:value={date} {label}  />
    {date}
  </div>
</Story>

Maybe I could have a Wrap compoent:

<Wrap>
    <DateInput name={"date"} bind:value={date} {label}  />
    {date}
</Wrap>

that importsapp.css and set the style. Is there a better way? Thanks

yellowmachine commented 1 year ago

Sorry, there's documentation about this;

jacob-8 commented 7 months ago

Sorry for the long delay. I never responded as the API was changing but wasn't ready yet. If you read through the docs again you'll see that Kitbook is now part of the main app and so Tailwind styles (or any other) will just work.