Let a single column sit in a section and give buttons an alignment

A column may now live directly in a section, not only in a row - the way
to centre or narrow a button or a short text without a one-column row.
The align design token applies to buttons; because a button is
inline-flex, auto margins never centred it, so site.css turns an aligned
button into a fit-content block per device. The Drews seed uses the
token for its centred buttons.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
kantarciandClaude Fable 5.1 committed 2026-09-15 14:49:37 +02:00
1 parent 533e181590
commit 232e6fe6dc
6 files changed
+41 -7

No files matched your search

+11 -1
View File
@@ -182,11 +182,21 @@ $button = static function (string $id, string $text, string $href, string $fassu
$css .= "\n& span{margin-left:6px}";
}
$block = ['id' => $id, 'type' => 'button', 'props' => ['text' => $text, 'href' => $href], 'css' => $css];
// Ein Button zentriert sich nicht über auto-Ränder (er ist inline-flex); dafür gibt es die
// Ausrichtung als Design-Token, dieselbe, die der Editor unter „Ausrichtung“ anbietet.
$rand = $style['desktop']['margin'] ?? [];
if ('auto' === ($rand['left'] ?? '') && 'auto' === ($rand['right'] ?? '')) {
unset($style['desktop']['margin']['left'], $style['desktop']['margin']['right']);
if ([] === $style['desktop']['margin']) {
unset($style['desktop']['margin']);
}
$block['layout'] = ['design' => ['desktop' => ['align' => 'center']]];
}
if ([] !== $style) {
$block['style'] = $style;
}
if ('large' !== $groesse) {
$block['layout'] = ['button' => ['desktop' => ['size' => $groesse]]];
$block['layout'] = [...($block['layout'] ?? []), 'button' => ['desktop' => ['size' => $groesse]]];
}
return $block;