You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
3.2 KiB
PHP
62 lines
3.2 KiB
PHP
<?php
|
|
|
|
$root = dirname(__DIR__);
|
|
$assert = static function ($condition, string $message): void {
|
|
if (!$condition) {
|
|
throw new RuntimeException($message);
|
|
}
|
|
};
|
|
$read = static fn (string $path): string => file_get_contents($root . '/' . $path);
|
|
|
|
$clientStyles = $read('public/cloud/client.css');
|
|
$accountStyles = $read('public/cloud/account.css');
|
|
$cloudLayout = $read('resources/views/venix/cloud/page.tpl');
|
|
$userLayout = $read('resources/views/venix/user/layout_header.tpl');
|
|
$authLayout = $read('resources/views/venix/auth/layout_header.tpl');
|
|
$adminLayout = $read('resources/views/venix/admin/static_header.tpl');
|
|
$assets = $read('resources/views/venix/layout_assets.tpl');
|
|
|
|
$assert(str_contains($cloudLayout, '/cloud/client.css')
|
|
&& str_contains($userLayout, '/cloud/client.css')
|
|
&& str_contains($userLayout, '/cloud/account.css')
|
|
&& str_contains($authLayout, '/cloud/account.css'),
|
|
'Every customer-facing shell must load the borderless form-control styles.');
|
|
$assert(!str_contains($adminLayout, '/cloud/client.css')
|
|
&& !str_contains($adminLayout, '/cloud/account.css'),
|
|
'Customer form-control styling must not leak into administrator pages.');
|
|
|
|
$assert(str_contains($clientStyles, 'body[data-cloud-page] :where(')
|
|
&& str_contains($clientStyles, 'border-color: transparent;')
|
|
&& str_contains($clientStyles, 'body[data-cloud-page] select:not([multiple])')
|
|
&& str_contains($clientStyles, 'appearance: none;'),
|
|
'Cloud customer controls must remove neutral browser borders and native select chrome.');
|
|
|
|
$assert(substr_count($accountStyles, 'border: 1px solid transparent;') >= 2
|
|
&& str_contains($accountStyles, "body.vu-body :where(\n .vu-input,")
|
|
&& str_contains($accountStyles, "body.vu-body :where(\n .vu-input:focus,")
|
|
&& !str_contains($accountStyles,
|
|
'body.vu-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus')
|
|
&& str_contains($accountStyles, 'body.vu-body select:not([multiple])')
|
|
&& str_contains($accountStyles, 'body.venix-auth select:not([multiple])')
|
|
&& str_contains($accountStyles,
|
|
'body.venix-auth.virsh-auth .auth-field :where(input, select, textarea)')
|
|
&& str_contains($accountStyles, 'border-color: transparent;'),
|
|
'Account and authentication controls must use the same borderless treatment.');
|
|
|
|
foreach (['checkbox', 'radio', 'hidden', 'submit', 'button', 'image', 'file', 'range', 'color'] as $type) {
|
|
$assert(str_contains($clientStyles, ':not([type="' . $type . '"])'),
|
|
'Specialised control must be excluded from the Cloud text-control override: ' . $type);
|
|
}
|
|
|
|
$assert(str_contains($clientStyles,
|
|
'.panel-user-dialog-verification.is-matched input { border-color: #76b99a; }')
|
|
&& str_contains($clientStyles,
|
|
'.panel-user-dialog-verification.is-matched input:focus { border-color: #42916d;')
|
|
&& str_contains($accountStyles, 'box-shadow: 0 0 0 4px rgba(25, 179, 187, .11);'),
|
|
'Border removal must retain semantic validation and accessible focus feedback.');
|
|
$assert(preg_match("/venix_asset_version value='([0-9]+)'/", $assets, $version) === 1
|
|
&& (int) $version[1] >= 2026102701,
|
|
'Shared asset version must advance when customer form styles change.');
|
|
|
|
echo "User form-control visual contract passed.\n";
|