refactor(header): unify top icon-cards on single zib-widget path

This commit is contained in:
2026-08-19 21:46:37 +08:00
parent 21c9634178
commit 304d0bde74
9 changed files with 17 additions and 176 deletions
@@ -14,25 +14,24 @@ test('icon card renderers keep vertical and horizontal Zibll DOM contracts separ
const header = read('inc/helpers/homepage/header-components.php');
assert.match(helper, /<div class="icon-card /);
assert.match(helper, /<div class="icon-cover-card aksrt-icon-cover-card flex ac /);
assert.match(helper, /<div class="icon-cover-card flex ac /);
assert.match(helper, /icon-cover-icon badg cir/);
assert.match(helper, /icon-cover-desc ml10 flex1 px12-sm/);
assert.match(helper, /aksrt-icon-cover-card/);
assert.doesNotMatch(helper, /aksrt-icon-cover-card/);
assert.match(widgets, /'customize_icon' => \$card\['customize_icon'\] \?\? ''/);
assert.match(widgets, /'custom_icon'\s+=> \$card\['custom_icon'\] \?\? ''/);
assert.match(widgets, /'icon_image'\s+=> \$card\['icon_image'\] \?\? ''/);
assert.match(header, /empty\(\$card\['custom_icon'\]\)/);
});
test('homepage horizontal cards use the shared compact card contract and retain Zibll responsive rules', () => {
const css = read('assets/css/frontend/header-cards.css');
test('homepage horizontal cards render fully from Zibll CSS with no dedicated stylesheet', () => {
const baseCss = read('assets/css/frontend/base.css');
const widgetCss = read('assets/widgets/frontend.css');
const scripts = read('src/Core/ScriptsPart1b.php');
assert.match(baseCss, /\.icon-cover-card\.aksrt-icon-cover-card\s*\{\s*padding:\s*10px;\s*font-size:\s*16px;/);
assert.match(css, /\.icon-cover-card\.zib-widget[\s\S]*?padding:\s*10px;/);
assert.match(css, /\.icon-cover-card\.padding-10[\s\S]*?padding:\s*2px;/);
assert.doesNotMatch(css, /\.header-slider-card \.icon-cover-icon\.badg\.cir/);
assert.doesNotMatch(css, /\.header-slider-card \.icon-cover-icon img/);
assert.equal(fs.existsSync(path.join(root, 'assets/css/frontend/header-cards.css')), false);
assert.doesNotMatch(baseCss, /\.icon-cover-card\.aksrt-icon-cover-card/);
assert.doesNotMatch(baseCss, /\.header-components-card/);
assert.doesNotMatch(scripts, /header-cards/);
assert.doesNotMatch(widgetCss, /aksrt-widget-icon-cards \.icon-cover-card/);
});