Skip to content

Commit 14d6d59

Browse files
committed
update with less demo
1 parent b2fc275 commit 14d6d59

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

examples/with-less/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"next": "^12.1.5",
4242
"react": "^17.0.0",
4343
"react-dom": "^17.0.0",
44-
"tarojs-plugin-platform-nextjs": "/Users/bytedance/Documents/github/tarojs-plugin-platform-nextjs/packages/nextjs"
44+
"tarojs-plugin-platform-nextjs": "latest"
4545
},
4646
"devDependencies": {
4747
"@babel/core": "^7.8.0",
Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1-
.main {
2-
background-color: red;
1+
// mixins
2+
.bordered {
3+
border-top: dotted 1px black;
4+
border-bottom: solid 2px black;
5+
}
6+
7+
.a {
8+
color: #111;
9+
.bordered();
10+
}
11+
12+
// functions
13+
@base: #f04615;
14+
@width: 1;
15+
16+
.functions {
17+
width: percentage(@width);
18+
color: saturate(@base, 5%);
19+
background-color: spin(lighten(@base, 25%), 8);
320
}

examples/with-less/src/pages/index/view.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import {View} from '@tarojs/components'
22
import styles from './index.module.less';
33

44
const IndexView = () => (
5-
<View className={styles.main}>
6-
Hello, world!
7-
</View>
5+
<>
6+
<View className={styles.a}>混合(Mixins)</View>
7+
<View className={styles.functions}>函数(Functions)</View>
8+
</>
89
);
910

1011
export default IndexView

0 commit comments

Comments
 (0)