Replace the single tenant avatar with a pair of theme-scoped brand logos.
Render only the theme-matching <img> server-side and swap src on theme
toggle via a JS hook — no reload, no double request, no CSS tricks.
Tenant logos
- TenantLogoService (ImageUploadTrait) with theme whitelist and per-theme
storage storage/tenants/{uuid}/logo/{light|dark}/, SIZES 128/256/512
- Public serving endpoint auth/tenant-logo-file so login can show the
logo pre-auth; matching authenticated admin preview endpoint
- appTenantLogoUrl(?size, ?theme) with 4-step fallback cascade; PDF +
mail always request 'light'
- Admin tenant edit: avatar block replaced by "Tenant logos" details
block inside the Master-data tab, two side-by-side slots via Pico
.grid with the core app-file-upload partial
- Policy rename ABILITY_ADMIN_TENANTS_AVATAR_VIEW -> LOGO_VIEW, action
routes logo / logo-delete / logo-file with theme body/query param
- API endpoint path kept (backward compat), internals on new service
- CLI tenant:logo-migrate-avatars moves legacy avatar/ -> logo/light/
idempotently (--dry-run, --yes, --cleanup)
- i18n "Tenant image" removed, 12 new keys synced across de/en
File upload component
- Full-width preview + filename/actions below (3D stack layout)
- Fixed 16:9 aspect ratio with 1rem inner padding for consistent
preview size across any logo aspect
- Transparency checker pattern as background so black logos stay
visible on dark mode and white logos on light mode
- form="" + deleteFormId support so the partial works with barrier
forms inside another form
Buttons
- width:100% dropped from button[type="submit"]; scoped back via
.login-main for the auth-flow primary CTA
- .outline base rule now tints background via color-mix of --app-color
so secondary/primary/danger outlines all gain a subtle surface
- .outline.secondary restyled Stripe-style in both themes: solid white
chip with soft shadow in light, solid elevated dark chip with white
text in dark; neutral border replaces role-colored border
- .app-action-success/.app-action-danger outlines get color-mix bg +
theme-aware outline-text tokens for stronger contrast
- Filled .primary/.app-action-success/.app-action-danger get raised
box-shadow (inset highlight + drop) — opt-in via class so chrome
buttons stay flat
- Dropped the legacy .secondary utility that was clobbering the
custom-property cascade with a hardcoded muted color
Theme swap
- Logo img carries data-src-light + data-src-dark; theme-toggle JS
swaps src when data-theme changes, keeping the topbar/login logo in
sync without a page reload
Quality gates: PHPUnit (2045), PHPStan L5, CS-Fixer, docs link/drift,
codex skills sync — all green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
357 lines
7.2 KiB
CSS
357 lines
7.2 KiB
CSS
@layer pages {
|
|
.login-card header {
|
|
background: transparent;
|
|
}
|
|
|
|
/* Login forms rely on a full-width primary submit button as the main CTA.
|
|
Global button[type="submit"] no longer defaults to width:100%, so we
|
|
restore that specifically for the auth flow. */
|
|
.login-main form > button[type="submit"],
|
|
.login-main form > .grid > button[type="submit"] {
|
|
width: 100%;
|
|
}
|
|
|
|
/* ── Logo ── */
|
|
|
|
.login-logo {
|
|
margin-bottom: 1.25rem;
|
|
}
|
|
|
|
|
|
|
|
.login-logo-link:focus-visible {
|
|
outline: 2px solid var(--app-primary-focus);
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
.login-logo-img {
|
|
max-height: 2.5rem;
|
|
max-width: 10rem;
|
|
object-fit: contain;
|
|
}
|
|
|
|
/* ── Password toggle ── */
|
|
|
|
.login-password-wrapper {
|
|
position: relative;
|
|
display: block;
|
|
}
|
|
|
|
.login-password-wrapper > input {
|
|
padding-right: 2.75rem;
|
|
}
|
|
|
|
.login-password-toggle {
|
|
position: absolute;
|
|
right: 0.5rem;
|
|
top: calc(50% - 8px);
|
|
transform: translateY(-50%);
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 2rem;
|
|
height: 2rem;
|
|
padding: 0;
|
|
margin: 0;
|
|
background: transparent;
|
|
border: 0;
|
|
color: var(--app-muted-color);
|
|
cursor: pointer;
|
|
font-size: var(--text-base);
|
|
border-radius: var(--app-border-radius);
|
|
transition: color 0.15s ease;
|
|
}
|
|
|
|
.login-password-toggle:hover {
|
|
color: var(--app-contrast);
|
|
}
|
|
|
|
.login-password-toggle:focus-visible {
|
|
outline: 2px solid var(--app-primary-focus);
|
|
outline-offset: 1px;
|
|
}
|
|
|
|
main.login-main {
|
|
min-height: 100dvh;
|
|
display: grid;
|
|
align-content: center;
|
|
gap: 0.75rem;
|
|
padding-block: 1rem 2rem;
|
|
}
|
|
|
|
.login-content-container.container-small {
|
|
width: min(300px, calc(100vw - 2rem));
|
|
max-width: none;
|
|
}
|
|
|
|
.login-content-container {
|
|
position: relative;
|
|
z-index: 1;
|
|
}
|
|
|
|
.login-card {
|
|
border: 1px solid color-mix(in srgb, var(--app-border) 75%, transparent);
|
|
box-shadow: none;
|
|
}
|
|
|
|
.login-tenant-select-form {
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.login-tenant-fieldset {
|
|
border: 0;
|
|
margin: 0 0 1rem;
|
|
padding: 0;
|
|
}
|
|
|
|
.login-tenant-select-label {
|
|
display: block;
|
|
margin-bottom: 0.5rem;
|
|
font-weight: var(--font-semibold);
|
|
}
|
|
|
|
.login-tenant-choice-grid {
|
|
display: grid;
|
|
gap: 0.625rem;
|
|
margin-bottom: 2rem;
|
|
}
|
|
.login-tenant-choice {
|
|
align-items: stretch;
|
|
margin: 0;
|
|
width: 100%;
|
|
padding: 0.625rem 0.75rem;
|
|
border: 1px solid var(--app-border);
|
|
border-radius: var(--app-border-radius);
|
|
background: var(--app-card-background-color);
|
|
justify-content: space-between;
|
|
transition:
|
|
border-color 0.15s ease,
|
|
box-shadow 0.15s ease,
|
|
background-color 0.15s ease;
|
|
flex-direction: row-reverse;
|
|
}
|
|
|
|
.login-tenant-choice:hover {
|
|
border-color: var(--app-primary);
|
|
}
|
|
|
|
.login-tenant-choice:has(input[type="radio"]:checked) {
|
|
border-color: var(--app-primary);
|
|
box-shadow: 0 0 0 1px var(--app-primary);
|
|
background: color-mix(
|
|
in srgb,
|
|
var(--app-primary) 8%,
|
|
var(--app-card-background-color)
|
|
);
|
|
}
|
|
|
|
.login-tenant-choice:has(input[type="radio"]:focus-visible) {
|
|
outline: 2px solid var(--app-primary-focus);
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
.login-tenant-choice input[type="radio"] {
|
|
align-self: center;
|
|
}
|
|
|
|
.login-tenant-choice-body {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
width: 100%;
|
|
}
|
|
|
|
.login-tenant-choice-avatar {
|
|
width: 5rem;
|
|
height: 2rem;
|
|
display: block;
|
|
object-fit: contain;
|
|
object-position: left center;
|
|
justify-self: start;
|
|
}
|
|
|
|
.login-tenant-choice-avatar-placeholder {
|
|
width: 8rem;
|
|
height: 3rem;
|
|
border-radius: var(--app-border-radius);
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
padding-left: 0.5rem;
|
|
font-size: var(--text-sm);
|
|
font-weight: var(--font-semibold);
|
|
color: var(--app-contrast);
|
|
}
|
|
|
|
.login-alt-separator {
|
|
position: relative;
|
|
margin: 1rem 0;
|
|
text-align: center;
|
|
}
|
|
|
|
.login-alt-separator::before {
|
|
content: "";
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 0;
|
|
right: 0;
|
|
border-top: 1px solid var(--app-border);
|
|
transform: translateY(-50%);
|
|
}
|
|
|
|
.login-alt-separator span {
|
|
position: relative;
|
|
z-index: 1;
|
|
display: inline-block;
|
|
padding: 0 0.75rem;
|
|
font-size: var(--text-sm);
|
|
color: var(--app-muted-color);
|
|
background: var(--app-card-background-color);
|
|
}
|
|
|
|
.login-microsoft-link {
|
|
display: block;
|
|
width: 100%;
|
|
text-align: center;
|
|
}
|
|
|
|
.login-methods-stack {
|
|
display: grid;
|
|
gap: 0.7rem;
|
|
margin-block: 0.2rem 0.45rem;
|
|
}
|
|
|
|
.login-password-form {
|
|
margin-top: 0.25rem;
|
|
}
|
|
|
|
.login-password-form > p:last-of-type {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.login-tenant-context {
|
|
margin-bottom: 1rem;
|
|
display: grid;
|
|
gap: 0.75rem;
|
|
border: 1px solid var(--app-border);
|
|
border-radius: var(--app-border-radius);
|
|
padding: calc(var(--app-spacing) * 0.5);
|
|
}
|
|
|
|
.login-tenant-context-main {
|
|
display: flex;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.login-tenant-context-avatar,
|
|
.login-tenant-context-avatar-placeholder {
|
|
width: 7.5rem;
|
|
height: 3.25rem;
|
|
object-fit: contain;
|
|
object-position: left center;
|
|
}
|
|
|
|
.login-tenant-context-avatar-placeholder {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: var(--text-sm);
|
|
font-weight: var(--font-bold);
|
|
color: var(--app-primary);
|
|
}
|
|
|
|
.login-tenant-context-avatar-placeholder--name {
|
|
width: auto;
|
|
max-width: 18rem;
|
|
height: auto;
|
|
justify-content: flex-start;
|
|
text-align: left;
|
|
font-weight: var(--font-bold);
|
|
color: var(--app-color);
|
|
}
|
|
|
|
.login-tenant-context-text {
|
|
min-width: 0;
|
|
overflow-wrap: anywhere;
|
|
}
|
|
|
|
.login-tenant-context-name {
|
|
margin: 0;
|
|
font-size: var(--text-xs);
|
|
white-space: nowrap;
|
|
text-overflow: ellipsis;
|
|
max-width: 130px;
|
|
display: block;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.login-tenant-context-form {
|
|
margin: 0;
|
|
}
|
|
|
|
.login-tenant-context-form button {
|
|
width: 100%;
|
|
}
|
|
|
|
.login-help-links {
|
|
margin: 1.4rem 0 0.35rem;
|
|
padding-top: 0.2rem;
|
|
}
|
|
.login-help-links-list {
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
gap: 10px;
|
|
|
|
font-size: var(--text-xs);
|
|
}
|
|
|
|
.login-help-links-item {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
.login-security-note {
|
|
font-size: var(--text-xs);
|
|
margin-bottom: 1px;
|
|
color: color-mix(in srgb, var(--app-contrast) 78%, var(--app-muted-color));
|
|
}
|
|
|
|
.login-security-note i {
|
|
color: var(--app-primary);
|
|
font-size: var(--text-sm);
|
|
}
|
|
|
|
.login-security-note-detail {
|
|
width: 100%;
|
|
display: block;
|
|
font-size: var(--text-2xs);
|
|
color: color-mix(in srgb, var(--app-muted-color) 75%, transparent);
|
|
}
|
|
|
|
form[aria-busy="true"] button[type="submit"],
|
|
button[data-submit-state="loading"] {
|
|
opacity: 0.75;
|
|
cursor: wait;
|
|
}
|
|
|
|
@media (min-width: 600px) {
|
|
main.login-main {
|
|
min-height: 90vh;
|
|
place-content: center;
|
|
}
|
|
|
|
.login-tenant-context {
|
|
grid-template-columns: 1fr auto;
|
|
align-items: center;
|
|
}
|
|
|
|
.login-tenant-context-form button {
|
|
width: auto;
|
|
}
|
|
}
|
|
}
|