area17 / blast

Storybook for Laravel Blade πŸš€
https://dev.to/area17/getting-started-with-blast-storybook-for-laravel-blade-c5c
Apache License 2.0
268 stars 39 forks source link

Implement Automatic UI Docs for Tailwind Config #19

Closed mrtimbrook closed 2 years ago

mrtimbrook commented 2 years ago

Work in progress

The Plan

Add a task to parse the tailwind config and automatically generate stories for each section of the tailwind docs (color, typography, grid, etc). Build in a way to add support for other UI frameworks in the future?

Users should be able to:

In Progress

Added

Todo:

mrtimbrook commented 2 years ago

To use the color component - use <x-ui-colors />. It supports a type prop which supports the values - bg or background, text, border. If no type is defined it will load all colors in one block.

For Example:

@storybook([
    'layout' => 'fullscreen',
    'args' => []
])

<x-docs-page
    title="Colors"
    label="Blast"
    description="Documentation for the project's colors"
>
  <h2 class="blast-mt-10 blast-text-4xl blast-font-bold">Background (bg) Colors</h2>
  <x-ui-colors type="bg" class="blast-mt-3" />

  <h2 class="blast-mt-10 blast-text-4xl blast-font-bold">Background (background) Colors</h2>
  <x-ui-colors type="background" class="blast-mt-3" />

  <h2 class="blast-mt-10 blast-text-4xl blast-font-bold">Text Colors</h2>
  <x-ui-colors type="text" class="blast-mt-3" />

  <h2 class="blast-mt-10 blast-text-4xl blast-font-bold">Border Colors</h2>
  <x-ui-colors type="border" class="blast-mt-3" />

  <h2 class="blast-mt-10 blast-text-4xl blast-font-bold">All Colors</h2>
  <x-ui-colors type="all" class="blast-mt-3" />
</x-docs-page>
mrtimbrook commented 2 years ago

I've updated it so that we use a task to generate the documentation. It'll work in a similar way to the blast:demo task where it copies files to the stories directory with the app's other components. The benefits of this are: