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

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

上级 bcb27c0d
......@@ -993,11 +993,17 @@
"navigationBarTitleText": "Scale"
}
},
{
"path": "pages/CSS/transform/rotate",
"style": {
"navigationBarTitleText": "Rotate"
}
{
"path": "pages/CSS/transform/rotate",
"style": {
"navigationBarTitleText": "Rotate"
}
},
{
"path": "pages/CSS/variable/variable",
"style": {
"navigationBarTitleText": "css 变量"
}
},
{
"path": "pages/tabBar/template",
......
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>
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1">
<!-- #endif -->
<!-- #endif -->
<view class="uni-container">
<view class="uni-header-logo">
<image class="uni-header-image" src="/static/cssIndex.png"></image>
......@@ -24,7 +24,7 @@
</template>
</uni-collapse>
</view>
<!-- #ifdef APP -->
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
......@@ -83,22 +83,22 @@
{
name: 'border-radius',
url: '/pages/CSS/border/border-radius',
},
{
name: 'border-top',
url: '/pages/CSS/border/border-top',
},
{
name: 'border-bottom',
url: '/pages/CSS/border/border-bottom',
},
{
name: 'border-left',
url: '/pages/CSS/border/border-left',
},
{
name: 'border-right',
url: '/pages/CSS/border/border-right',
},
{
name: 'border-top',
url: '/pages/CSS/border/border-top',
},
{
name: 'border-bottom',
url: '/pages/CSS/border/border-bottom',
},
{
name: 'border-left',
url: '/pages/CSS/border/border-left',
},
{
name: 'border-right',
url: '/pages/CSS/border/border-right',
},
{
name: 'border属性复合示例',
......@@ -203,10 +203,10 @@
{
name: 'width',
url: '/pages/CSS/layout/width',
},
{
name: 'z-index',
url: '/pages/CSS/layout/z-index',
},
{
name: 'z-index',
url: '/pages/CSS/layout/z-index',
},
{
name: 'visibility',
......@@ -265,16 +265,16 @@
url: '/pages/CSS/padding/padding',
},
] as Page[],
},
{
id: 'overflow',
name: 'overflow',
pages: [
{
name: 'overflow',
url: '/pages/CSS/overflow/overflow',
},
] as Page[],
},
{
id: 'overflow',
name: 'overflow',
pages: [
{
name: 'overflow',
url: '/pages/CSS/overflow/overflow',
},
] as Page[],
},
{
id: 'text',
......@@ -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.
先完成此消息的编辑!
想要评论请 注册