fix(legal): wrap the privacy table's first column, top-align cells
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 21s
CI / ui (pull_request) Successful in 1m13s
CI / conformance (pull_request) Successful in 11s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m54s

The shared legal-page template inherited the offer's shrink-to-fit product-name column (width:1% + white-space:nowrap), which stopped the privacy data table's long prose first column from wrapping and blew the table out horizontally. Scope that rule to the offer (body.offer) and top-align all legal-table cells for the multi-line privacy rows.
This commit is contained in:
Ilia Denisov
2026-07-13 13:00:40 +02:00
parent 1d77ee83b3
commit 7df078f5ed
2 changed files with 20 additions and 6 deletions
+10 -6
View File
@@ -15,7 +15,7 @@ import { marked } from 'marked';
* page carries its own minimal light/dark styling so it needs neither the app bundle
* nor `app.css`.
*/
export function renderLegalHtml(markdown: string, opts: { title: string; canonical: string }): string {
export function renderLegalHtml(markdown: string, opts: { title: string; canonical: string; bodyClass?: string }): string {
const body = marked.parse(markdown, { async: false }) as string;
return `<!doctype html>
<html lang="ru">
@@ -94,11 +94,14 @@ export function renderLegalHtml(markdown: string, opts: { title: string; canonic
td {
border: 1px solid var(--cell-border);
padding: 6px 10px;
/* Top-align: the privacy data table's prose cells differ in height per row. */
vertical-align: top;
}
/* The product-name column shrinks to its content and never wraps; the price columns share the
rest of the width (width:1% is the shrink-to-fit idiom paired with the table's width:100%). */
th:first-child,
td:first-child {
/* Offer only: the product-name column shrinks to its content and never wraps; the price columns
share the rest of the width (width:1% is the shrink-to-fit idiom paired with width:100%). Other
legal tables (the privacy data table) keep the default auto layout so their prose cells wrap. */
.offer th:first-child,
.offer td:first-child {
width: 1%;
white-space: nowrap;
}
@@ -110,7 +113,7 @@ export function renderLegalHtml(markdown: string, opts: { title: string; canonic
}
</style>
</head>
<body>
<body${opts.bodyClass ? ' class="' + opts.bodyClass + '"' : ''}>
<main>
${body}
</main>
@@ -127,5 +130,6 @@ export function renderOfferHtml(markdown: string): string {
return renderLegalHtml(markdown, {
title: 'Публичная оферта — Эрудит',
canonical: 'https://erudit-game.ru/offer/',
bodyClass: 'offer',
});
}