From ade156c6f3ab60f95c4d8631fa700b9477a5c871 Mon Sep 17 00:00:00 2001 From: Shephard Tseisi Date: Thu, 18 Jun 2026 12:05:24 +0200 Subject: [PATCH 1/7] docs(README): update quick start instructions and clarify CLI usage Revised the README to emphasize the importance of the CLI tool for obtaining styled components. Added a clear warning about the package's limitations without the CLI, streamlined the quick start section, and provided detailed commands for initializing and adding components. Removed outdated installation steps and clarified the future support for standalone NuGet package usage. --- src/ShellUI.Components/README.md | 120 +++++------------- .../ShellUI.Components.csproj | 4 - 2 files changed, 33 insertions(+), 91 deletions(-) diff --git a/src/ShellUI.Components/README.md b/src/ShellUI.Components/README.md index 6b49708..a24e278 100644 --- a/src/ShellUI.Components/README.md +++ b/src/ShellUI.Components/README.md @@ -11,119 +11,65 @@ Beautiful, accessible Blazor components inspired by shadcn/ui. A CLI-first compo - ๐Ÿ“ฑ **Responsive design** - Mobile-first approach - ๐Ÿ”ง **Fully customizable** - Copy components to your project for full control -## Quick Start +## โš ๏ธ Read this first -### Option 1: CLI Tool (Recommended) +This package ships the component DLLs, JS interop, and helpers (`Shell.Cn`). **It does not produce styled components on its own.** Tailwind v4 builds CSS by scanning `.razor` source files at compile time โ€” the component source lives inside this DLL, so Tailwind never sees the utility classes used inside ShellUI components. -The CLI tool provides the best developer experience with automatic setup: - -#### 1. Install the CLI tool +The supported way to get styled components is the **`ShellUI.CLI` global tool**: ```bash dotnet tool install -g ShellUI.CLI +shellui init # sets up Tailwind, theme CSS, patches App.razor +shellui add button card dialog # copies component source so Tailwind can scan it ``` -#### 2. Initialize ShellUI in your project - -```bash -dotnet shellui init -``` - -This automatically: -- โœ… Downloads Tailwind CSS CLI (standalone, no Node.js required) -- โœ… Creates CSS files and configuration -- โœ… Sets up MSBuild integration for auto-building -- โœ… Creates component folders - -#### 3. Add components - -```bash -# Add a button component -dotnet shellui add button - -# Add multiple components -dotnet shellui add input card dialog - -# List available components -dotnet shellui list -``` - -### Option 2: NuGet Package +`shellui add` copies the `.razor` files into your project, where Tailwind picks up the classes. From then on, components render styled. -For manual setup or existing projects: +A future release (`v0.4.x`) will support installing this NuGet package by itself โ€” by shipping a pre-compiled stylesheet โ€” without needing the CLI for setup. Until then, **install the CLI**. -#### 1. Install the package +## When is this NuGet package useful on its own? -```bash -dotnet add package ShellUI.Components -``` +- You're building a library that re-exports ShellUI components or extends them with custom variants +- You want to reference `Shell.Cn` (the class-name combiner) from your own helpers +- You want the JS interop registration (`shellui.js`) provided as a `_content/ShellUI.Components/` static asset -#### 2. Set up Tailwind CSS +Otherwise: start with the CLI. -Choose one of these methods: +## CLI quick start -**Method A: Tailwind CLI (Recommended)** ```bash -# Download Tailwind CLI (standalone) -curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-windows-x64.exe -# Or for Linux/Mac: tailwindcss-linux-x64 or tailwindcss-macos-x64 - -# Create input.css -echo '@import "tailwindcss";' > wwwroot/input.css - -# Create tailwind.config.js -echo 'module.exports = { - content: ["./**/*.{razor,html,cs}"], - theme: { extend: {} }, - plugins: [] -}' > tailwind.config.js - -# Build CSS -./tailwindcss -i wwwroot/input.css -o wwwroot/app.css +dotnet tool install -g ShellUI.CLI +shellui init # one-time +shellui add button # any time you want more components +shellui list # see what's available ``` -**Method B: npm (if you prefer Node.js)** -```bash -# Install Tailwind CSS -npm install -D tailwindcss -npx tailwindcss init - -# Update tailwind.config.js -echo 'module.exports = { - content: ["./**/*.{razor,html,cs}"], - theme: { extend: {} }, - plugins: [] -}' > tailwind.config.js - -# Create input.css -echo '@import "tailwindcss/base"; -@import "tailwindcss/components"; -@import "tailwindcss/utilities";' > wwwroot/input.css - -# Build CSS -npx tailwindcss -i wwwroot/input.css -o wwwroot/app.css -``` +`shellui init` automatically: +- Downloads Tailwind CSS CLI (standalone, no Node.js required) or uses your existing npm install +- Writes the full default theme to `wwwroot/input.css` (`:root` / `.dark` / `@theme inline` blocks) +- Patches `Components/App.razor` (or `wwwroot/index.html` for WASM) with `@rendermode`, a theme-bootstrap `