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

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

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