fix(widgets): restore the 20px bottom gap under the quote and search widgets
The reference wraps these two widgets in a middle .theme-box layer (widget-container > .theme-box > title + card), which is what supplies the 20px bottom margin. Our outer .jio-widget-box-wrap is only a transparent layout container, so dropping .theme-box left the quote card flush against the following module. - search/quote: emit the reference .theme-box middle layer; the card itself stays margin-free like the reference, so the gap is exactly 20px - keep the generic .widget-content branch for user_card/author_card and the other reference widgets untouched (the string is contract-tested) - contract test now pins the .theme-box layer and asserts the quote card carries no margin class of its own Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
f80ca1e27d
commit
3c07ef7a8d
3 files changed
+15
-9
No files matched your search
@@ -124,13 +124,17 @@ final class FrontendRenderer {
|
||||
$style = self::style($instance);
|
||||
$affix_attr = !empty($instance['sidebar_affix']) ? ' data-affix="true"' : '';
|
||||
echo '<div class="' . esc_attr(implode(' ', $classes)) . '" data-jio-widget="' . esc_attr($definition->slug()) . '" data-widget-id="' . esc_attr((string) $widget->id) . '"' . $affix_attr . ($style !== '' ? ' style="' . esc_attr($style) . '"' : '') . '>';
|
||||
if ($own_card) {
|
||||
// 参考主题:搜索框/一言的中间层是 .theme-box,承载 20px 底部间距与入场动画。
|
||||
echo '<div class="widget-container"><div class="theme-box' . esc_attr($animation) . '">';
|
||||
echo self::reference_title($instance); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo '</div></div></div>';
|
||||
return;
|
||||
}
|
||||
echo '<div class="widget-container"><div>';
|
||||
echo self::reference_title($instance); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
if ($own_card) {
|
||||
echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
} else {
|
||||
echo '<div class="widget-content' . esc_attr($animation) . '">' . $content . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
echo '<div class="widget-content' . esc_attr($animation) . '">' . $content . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo '</div></div></div>';
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ final class GeneralRenderer {
|
||||
return '';
|
||||
}
|
||||
// 参考主题:.yiyan-box 既是卡片也是点击切换的根元素,内部只有 .yiyan。
|
||||
// 20px 底部间距由外层 .theme-box 提供(与参考主题一致),卡片自身不带边距。
|
||||
return jio_get_yiyan_markup([
|
||||
'class' => 'yiyan-box main-bg text-center box-body radius8 main-shadow',
|
||||
]);
|
||||
|
||||
Reference in new issue
Block a user