fix:顶部横版卡片

This commit is contained in:
2026-08-19 17:01:27 +08:00
parent d1f700c3d1
commit 0375a11adc
8 changed files with 56 additions and 84 deletions
@@ -0,0 +1,36 @@
'use strict';
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const test = require('node:test');
const root = path.resolve(__dirname, '..', '..');
const read = (file) => fs.readFileSync(path.join(root, file), 'utf8');
test('icon card renderers keep vertical and horizontal Zibll DOM contracts separate', () => {
const helper = read('inc/helpers/aksrt-icon-cards.php');
const widgets = read('src/WidgetSystem/Renderers/GeneralRenderer.php');
const header = read('inc/helpers/homepage/header-components.php');
assert.match(helper, /<div class="icon-card /);
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.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 only use Zibll surface and responsive padding rules', () => {
const css = read('assets/css/frontend/header-components/dark-theme.css');
const widgetCss = read('assets/widgets/frontend.css');
assert.match(css, /\.header-slider-card \.icon-cover-card\.zib-widget \{\s*padding: 10px;/);
assert.match(css, /\.header-slider-card \.icon-cover-card\.padding-10 \{\s*padding: 2px;/);
assert.doesNotMatch(css, /\.header-slider-card \.icon-cover-icon\.badg\.cir/);
assert.doesNotMatch(css, /\.header-slider-card \.icon-cover-icon img/);
assert.doesNotMatch(widgetCss, /aksrt-widget-icon-cards \.icon-cover-card/);
});