提交 9c917b5b 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

feat(css): css 变量示例及测试

上级 bcb27c0d
......@@ -999,6 +999,12 @@
"navigationBarTitleText": "Rotate"
}
},
{
"path": "pages/CSS/variable/variable",
"style": {
"navigationBarTitleText": "css 变量"
}
},
{
"path": "pages/tabBar/template",
"style": {
......
describe('css-variable', () => {
let page;
beforeAll(async () => {
page = await program.reLaunch('/pages/CSS/variable/variable');
await page.waitFor('view');
});
it('screenshot', async () => {
const image = await program.screenshot({
fullPage: true
})
expect(image).toMatchImageSnapshot()
});
});
<template>
<view class="page">
<view class="status-bar-height">
<text>status bar height</text>
</view>
<view class="window-top">
<text>window top</text>
</view>
<view class="window-bottom">
<text>window bottom</text>
</view>
</view>
</template>
<style>
.status-bar-height {
height: var(--status-bar-height);
background-color: red;
}
.window-top {
height: var(--window-top);
background-color: green;
}
.window-bottom {
height: var(--window-bottom);
background-color: blue;
}
</style>
......@@ -349,6 +349,16 @@
url: '/pages/CSS/transition/transition',
},
] as Page[],
},
{
id: 'variable',
name: 'variable',
pages: [
{
name: 'variable',
url: '/pages/CSS/variable/variable',
},
] as Page[],
}
] as ListItem[],
arrowUpIcon: '/static/icons/arrow-up.png',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册