Files
Toiminnanohjaus/app/Providers/AppServiceProvider.php
T
petriandClaude Opus 5.5 f4b58f6b1d Darken the dark canvas, add customer colours, the ongoing status and the board model
- Dark theme page background is #5a5e60; text on it is lifted to zinc-200 /
  primary-100 and TallStackUI's dark labels, hints and checkbox labels are
  lightened so everything stays at 4.5:1.
- Shared HexColor picks white or black text by the higher WCAG contrast; a
  native-dialog colour picker and a large work dialog component.
- Customers get a header colour (customers.header_color), set on the
  customer page.
- New job status Jatkuvat / Kausi (ongoing): open, never late, billed
  monthly like running jobs.
- Kanban model: board columns and views, urgent threshold, per-user board
  preferences (density, column colours and sort), card positions, tasks of
  continuing jobs pinned to the board, MoveBoardCard and board queries with
  logged hours from TimeTracking.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 06:11:49 +02:00

109 lines
4.4 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();
$this->styleTables();
}
/**
* Tables as cards: a white (dark: zinc-900) surface with a soft shadow, an indigo-tinted header row and a
* row hover. Cell text is zinc-700 / zinc-200 (well over 4.5:1) instead of the package's gray-500.
*/
private function styleTables(): void
{
TallStackUi::customize()
->table()
->block('wrapper', 'overflow-hidden rounded-xl bg-white shadow-sm ring-1 ring-zinc-200 dark:bg-zinc-900 dark:ring-zinc-700')
->block('table.wrapper', 'relative soft-scrollbar overflow-auto bg-white dark:bg-zinc-900')
->block('table.base', 'min-w-full divide-y divide-zinc-200 dark:divide-zinc-700')
->block('table.th', 'px-3 py-3 text-xs font-semibold tracking-wide text-primary-900 dark:text-primary-100')
->block('table.th-compact', 'px-3 py-2 text-xs font-semibold tracking-wide text-primary-900 dark:text-primary-100')
->block('table.thead.normal', 'bg-primary-50 dark:bg-primary-950/70')
->block('table.tbody', 'divide-y divide-zinc-200 bg-white dark:divide-zinc-700/70 dark:bg-zinc-900')
->block('table.tr', 'transition-colors hover:bg-primary-50/50 dark:hover:bg-white/5')
->block('table.td', 'whitespace-nowrap px-3 py-3 text-sm text-zinc-700 dark:text-zinc-200')
->block('table.td-compact', 'whitespace-nowrap px-3 py-2 text-sm text-zinc-700 dark:text-zinc-200')
->block('empty', 'col-span-full whitespace-nowrap px-3 py-4 text-sm text-zinc-700 dark:text-zinc-200');
}
/**
* 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', 'dark:text-dark-400' => 'dark:text-dark-200']);
// Checkbox, radio and toggle labels are dark-400 (#999) in dark mode: 2.3:1 on the dark canvas.
TallStackUi::customize()
->wrapper('radio')
->block('label.text')
->replace('dark:text-dark-400', 'dark:text-dark-200');
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');
// Chart axis captions are gray-500 at 10 px, 4.4:1 on the page background.
foreach (['axis.y.label', 'axis.y.right.label', 'axis.x.label'] as $block) {
TallStackUi::customize('chart')
->block($block)
->replace(['text-gray-500' => 'text-gray-700', 'dark:text-dark-400' => 'dark:text-dark-200', 'text-[0.65rem]' => 'text-xs']);
}
}
}