feat(web): unify site branding across pages
parent
06faa2dc30
commit
e118365157
@ -0,0 +1,21 @@
|
||||
/* Canonical site mark shared by public, authentication, user and admin pages. */
|
||||
.site-brand-mark {
|
||||
position: relative;
|
||||
width: 31px;
|
||||
height: 31px;
|
||||
display: inline-block;
|
||||
flex: 0 0 auto;
|
||||
color: #2de2c2;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.site-brand-mark i {
|
||||
position: absolute;
|
||||
display: block;
|
||||
border: 6px solid currentColor;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.site-brand-mark i:first-child { inset: 2px 11px 11px 2px; }
|
||||
.site-brand-mark i:last-child { inset: 11px 2px 2px 11px; opacity: .58; }
|
||||
@ -0,0 +1 @@
|
||||
<span class="site-brand-mark" aria-hidden="true"><i></i><i></i></span>
|
||||
@ -1,2 +1,2 @@
|
||||
{* Shared Venix CSS/JS cache key. Increment whenever a shared browser asset changes. *}
|
||||
{assign var=venix_asset_version value='2026102416' scope='global'}
|
||||
{assign var=venix_asset_version value='2026102417' scope='global'}
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
$root = dirname(__DIR__, 2);
|
||||
$read = static function (string $path) use ($root): string {
|
||||
$content = file_get_contents($root . '/' . $path);
|
||||
if ($content === false) {
|
||||
throw new RuntimeException('Cannot read ' . $path);
|
||||
}
|
||||
return $content;
|
||||
};
|
||||
$assert = static function (bool $condition, string $message): void {
|
||||
if (!$condition) {
|
||||
throw new RuntimeException($message);
|
||||
}
|
||||
};
|
||||
|
||||
$partialPath = 'web/resources/views/venix/components/site_brand_mark.tpl';
|
||||
$partial = $read($partialPath);
|
||||
$style = $read('web/public/theme/venix/css/site-brand.css');
|
||||
$assert(str_contains($partial, 'class="site-brand-mark"')
|
||||
&& substr_count($partial, '<i></i>') === 2,
|
||||
'The shared site-brand partial is not the approved two-square mark.');
|
||||
$assert(str_contains($style, 'transform: rotate(45deg)')
|
||||
&& str_contains($style, 'border: 6px solid currentColor')
|
||||
&& str_contains($style, 'color: #2de2c2'),
|
||||
'The shared site-brand style drifted from the landing-page mark.');
|
||||
|
||||
$layouts = [
|
||||
'web/resources/views/venix/home/layout_header.tpl',
|
||||
'web/resources/views/venix/auth/layout_header.tpl',
|
||||
'web/resources/views/venix/user/layout_header.tpl',
|
||||
'web/resources/views/venix/user/layout_plain_header.tpl',
|
||||
'web/resources/views/venix/cloud/page.tpl',
|
||||
'web/resources/views/venix/admin/static_header.tpl',
|
||||
];
|
||||
foreach ($layouts as $layout) {
|
||||
$assert(str_contains($read($layout), '/theme/venix/css/site-brand.css?v='),
|
||||
$layout . ' does not load the canonical site-brand stylesheet.');
|
||||
}
|
||||
|
||||
$presenters = [
|
||||
'web/resources/views/venix/home/site_header.tpl' => 1,
|
||||
'web/resources/views/venix/home/site_footer.tpl' => 1,
|
||||
'web/resources/views/venix/auth/layout_header.tpl' => 1,
|
||||
'web/resources/views/venix/user/panel_sidebar.tpl' => 1,
|
||||
'web/resources/views/venix/user/disable.tpl' => 1,
|
||||
'web/resources/views/venix/admin/static_header.tpl' => 4,
|
||||
];
|
||||
foreach ($presenters as $template => $expectedIncludes) {
|
||||
$assert(substr_count($read($template), "include file='components/site_brand_mark.tpl'") === $expectedIncludes,
|
||||
$template . ' does not render the canonical site-brand mark.');
|
||||
}
|
||||
|
||||
$templates = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(
|
||||
$root . '/web/resources/views/venix',
|
||||
FilesystemIterator::SKIP_DOTS
|
||||
));
|
||||
foreach ($templates as $template) {
|
||||
if (!$template->isFile() || $template->getExtension() !== 'tpl') {
|
||||
continue;
|
||||
}
|
||||
$content = file_get_contents($template->getPathname());
|
||||
$assert($content !== false, 'Cannot read ' . $template->getPathname());
|
||||
$assert(!str_contains($content, 'class="brand-mark"')
|
||||
&& !str_contains($content, 'landing-brand-mark')
|
||||
&& !preg_match('/logo-(?:sm|light|dark)\.png/', $content),
|
||||
'A legacy visible site logo remains in ' . $template->getPathname());
|
||||
}
|
||||
|
||||
$assets = $read('web/resources/views/venix/layout_assets.tpl');
|
||||
$assert(str_contains($assets, "value='2026102417'"),
|
||||
'The shared asset version was not updated for the canonical logo.');
|
||||
|
||||
echo "Shared site-brand contract passed across public, auth, user, cloud and admin layouts.\n";
|
||||
Loading…
Reference in New Issue