The header and its menu popovers always use the dark theme colours, the light theme body is zinc-100 and Kanban columns zinc-200 so they still stand out. The theme toggle icon follows the page theme through a new page-dark variant, and TallStackUI hint and selection group description texts are one shade darker to keep 4.5:1 contrast on the grey background. Co-Authored-By: Claude Opus 5.5 <[email protected]>
74 lines
2.1 KiB
PHP
74 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
use TallStackUi\Facades\TallStackUi;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
$this->meetContrastRequirements();
|
|
}
|
|
|
|
/**
|
|
* TallStackUI uses red-500 for error text, which is 3.8:1 on white and
|
|
* below the 4.5:1 WCAG 2.2 AA requires. Darker red in light mode, lighter
|
|
* red in dark mode. The typed value of a field in error is red-600, which is
|
|
* 3.8:1 on the dark input background, so inputs and selects change too.
|
|
*/
|
|
private function meetContrastRequirements(): void
|
|
{
|
|
TallStackUi::customize()
|
|
->form('error')
|
|
->block('text')
|
|
->replace('text-red-500', 'text-red-700 dark:text-red-400');
|
|
|
|
TallStackUi::customize()
|
|
->form('label')
|
|
->block('error')
|
|
->replace(['text-red-600' => 'text-red-700', 'dark:text-red-500' => 'dark:text-red-400']);
|
|
|
|
TallStackUi::customize()
|
|
->form('label')
|
|
->block('asterisk')
|
|
->replace('text-red-500', 'text-red-700 dark:text-red-400');
|
|
|
|
TallStackUi::customize()
|
|
->form('input')
|
|
->block('error')
|
|
->replace('text-red-600!', 'text-red-700! dark:!text-red-400');
|
|
|
|
TallStackUi::customize()
|
|
->form('hint')
|
|
->block('text')
|
|
->replace('text-gray-500', 'text-gray-600');
|
|
|
|
foreach (['radio.group', 'checkbox.group'] as $selectionGroup) {
|
|
foreach (['content.description', 'content.aside'] as $block) {
|
|
TallStackUi::customize()
|
|
->form($selectionGroup)
|
|
->block($block)
|
|
->replace('text-gray-500', 'text-gray-600');
|
|
}
|
|
}
|
|
|
|
TallStackUi::customize()
|
|
->select('native')
|
|
->block('error')
|
|
->replace('text-red-600!', 'text-red-700! dark:!text-red-400');
|
|
}
|
|
}
|