Files
Andreas Reinhold / reiniandClaude Sonnet 5 f21943746e Delete Tailwind's half and build the Workbench without it
Plan step 39 (parts 1-3, folded into one commit: PHP tests read the
deleted files directly, so they cannot land apart from it). Tailwind
leaves the whole stack:

- Delete resources/css/tailwind.css, tokens/theme.css and
  tokens/utilities.css. Neither token file declared an --md-sys-*
  custom property of its own (both only referenced tokens declared
  elsewhere), so nothing loses a value; the md-* interaction and text
  classes already mirror utilities.css's declarations exactly
  (foundation/interaction.css, text.css).
- npm uninstall tailwindcss @tailwindcss/vite; vite.config.js drops the
  plugin and its import; composer.json drops the tailwindcss keyword
  (no lock change — keywords are outside Composer's content hash).
- The Workbench now builds one CSS entry, workbench/resources/css/app.css
  (all.css, showcase.css and the scheme; package.css is folded in and
  removed) instead of two, used by ErrorPage::assets() and every
  browser-test probe page's raw @vite() call; the showcase's own pages
  still take their CSS from the bundle route.
- TokensTest and StylesheetsTest: the two facts theme.css and
  utilities.css carried (every scheme role becomes a colour, resolved
  on the element; md-type-* matches the type-* utilities) are asserted
  directly against the scheme and text.css now that there is no second
  copy to cross-check; StylesheetsTest gained a full-tree scan (every
  .css file under resources/css/ is reached from all.css or
  showcase.css, no exclusions left for Tailwind); the Workbench-entry
  test and every "moved out of tailwind.css" assertion updated for the
  single entry and its removal.
- DesignGuard.php's comments and the development skill's setup section
  no longer name the deleted files or a second Tailwind entry.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
2026-09-15 06:49:03 +02:00

48 lines
1.9 KiB
PHP

<?php
namespace Workbench\App\Providers;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\ServiceProvider;
use function Orchestra\Testbench\workbench_path;
class WorkbenchServiceProvider extends ServiceProvider
{
/**
* Point the showcase at the Workbench's own Vite entries and dev server.
*
* Set in boot() rather than register(): config merging is shallow, so a nested key
* written before the package merges its defaults would replace the whole
* `showcase` array.
*/
public function boot(): void
{
config(['livewire-material.showcase.vite' => [
// The package's whole CSS in the Workbench's one entry now that Tailwind is gone
// (plan step 39), and the JavaScript.
'workbench/resources/css/app.css',
'workbench/resources/js/app.js',
]]);
// Three colour profiles, generated into workbench/resources/css/material-scheme.css with
// `vendor/bin/testbench material:scheme --output=workbench/resources/css/material-scheme.css`.
// Baseline is the package's own default, so the stylesheet draws it as before; the showcase
// offers the others. Tests start without profiles and point at the file when they need it.
config([
'livewire-material.profiles' => [
'baseline' => ['label' => 'Baseline', 'seed' => '#6750a4', 'variant' => 'tonal-spot'],
'teal' => ['label' => 'Teal', 'seed' => '#00897b', 'variant' => 'vibrant'],
'rose' => ['label' => 'Rose', 'seed' => '#c2185b', 'variant' => 'vibrant'],
],
'livewire-material.profile' => 'baseline',
]);
if (! $this->app->runningUnitTests()) {
config(['livewire-material.scheme' => workbench_path('resources/css/material-scheme.json')]);
}
Vite::useHotFile(workbench_path('public/hot'));
}
}