feat: 参考原型图 ui优化提交 个人端-用户中心 相关的页面
This commit is contained in:
@@ -22,7 +22,7 @@ import { readFileSync } from 'node:fs';
|
||||
import test from 'node:test';
|
||||
import postcss from 'postcss';
|
||||
|
||||
const css = readFileSync(new URL('../src/index.css', import.meta.url), 'utf8');
|
||||
const css = readFileSync(new URL('../src/styles/prototype.css', import.meta.url), 'utf8');
|
||||
const root = postcss.parse(css);
|
||||
|
||||
const normalizeSelector = (selector) => selector.replace(/\s+/g, ' ').trim();
|
||||
@@ -52,7 +52,7 @@ const declarations = (rule) =>
|
||||
|
||||
test('standard modal bodies only scroll vertically', () => {
|
||||
const rule = findRule(
|
||||
'.semi-modal-content:not(.semi-modal-content-fullScreen) > .semi-modal-body-wrapper > .semi-modal-body',
|
||||
'.ant-modal:not(.viewport-preview-modal) .ant-modal-body',
|
||||
);
|
||||
assert.deepEqual(
|
||||
{
|
||||
@@ -64,23 +64,13 @@ test('standard modal bodies only scroll vertically', () => {
|
||||
});
|
||||
|
||||
test('fixed-width modal shells stay inside the viewport', () => {
|
||||
assert.equal(declarations(findRule('.semi-modal'))['max-width'], '100%');
|
||||
const gutterRule = findRule(
|
||||
'.semi-modal:not(:has(> .semi-modal-content-fullScreen))',
|
||||
);
|
||||
assert.equal(declarations(gutterRule)['max-width'], 'calc(100% - 32px)');
|
||||
assert.equal(gutterRule.parent.type, 'atrule');
|
||||
assert.equal(gutterRule.parent.name, 'supports');
|
||||
assert.match(gutterRule.parent.params, /selector\(:has\(\*\)\)/);
|
||||
assert.equal(
|
||||
declarations(findRule('.viewport-preview-modal .semi-modal'))['max-width'],
|
||||
'100%',
|
||||
);
|
||||
assert.equal(declarations(findRule('.ant-modal'))['max-width'], 'calc(100vw - 32px)');
|
||||
assert.equal(declarations(findRule('.viewport-preview-modal.ant-modal'))['max-width'], '100vw');
|
||||
});
|
||||
|
||||
test('headerless viewport previews override standard body overflow', () => {
|
||||
const rule = findRule(
|
||||
'.viewport-preview-modal .semi-modal-content:not(.semi-modal-content-fullScreen) > .semi-modal-body-wrapper > .semi-modal-body',
|
||||
'.viewport-preview-modal .ant-modal-body',
|
||||
);
|
||||
assert.deepEqual(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user