Skip to content

Commit f84b83f

Browse files
committed
fix: 样式变量无法生效
1 parent 670f567 commit f84b83f

File tree

16 files changed

+79
-105
lines changed

16 files changed

+79
-105
lines changed

src/packages/button/button.scss

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -101,22 +101,6 @@
101101

102102
&-round {
103103
border-radius: $button-border-radius;
104-
105-
&-xlarge {
106-
border-radius: $button-xlarge-border-radius;
107-
}
108-
109-
&-large {
110-
border-radius: $button-large-border-radius;
111-
}
112-
113-
&-small {
114-
border-radius: $button-small-border-radius;
115-
}
116-
117-
&-mini {
118-
border-radius: $button-mini-border-radius;
119-
}
120104
}
121105

122106
&-default {
@@ -155,7 +139,7 @@
155139
height: $button-xlarge-height;
156140
padding: $button-xlarge-padding;
157141
font-size: $button-xlarge-font-size;
158-
border-radius: $radius-base;
142+
border-radius: $button-xlarge-border-radius;
159143

160144
.nut-button-text {
161145
margin-left: $button-xlarge-text-icon-margin;
@@ -178,7 +162,7 @@
178162
height: $button-large-height;
179163
padding: $button-large-padding;
180164
font-size: $button-large-font-size;
181-
border-radius: $radius-s;
165+
border-radius: $button-large-border-radius;
182166

183167
.nut-button-text {
184168
margin-left: $button-xlarge-text-icon-margin;
@@ -202,7 +186,7 @@
202186
height: $button-small-height;
203187
padding: $button-small-padding;
204188
font-size: $button-small-font-size;
205-
border-radius: $radius-xs;
189+
border-radius: $button-small-border-radius;
206190

207191
.nut-icon {
208192
font-size: $button-small-font-size;
@@ -219,7 +203,7 @@
219203
height: $button-mini-height;
220204
padding: $button-mini-padding;
221205
font-size: $button-mini-font-size;
222-
border-radius: $radius-xs;
206+
border-radius: $button-mini-border-radius;
223207

224208
.nut-icon {
225209
font-size: $button-mini-font-size;

src/packages/button/demo.tsx

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react'
22
import { useTranslate } from '@/sites/assets/locale'
3-
import Cell from '../cell'
43
import Demo1 from './demos/h5/demo1'
54
import Demo2 from './demos/h5/demo2'
65
import Demo3 from './demos/h5/demo3'
@@ -54,41 +53,23 @@ const ButtonDemo = () => {
5453
<>
5554
<div className="demo">
5655
<h2>{translated.ce5c5446}</h2>
57-
<Cell style={{ flexWrap: 'wrap' }}>
58-
<Demo1 />
59-
</Cell>
56+
<Demo1 />
6057
<h2>{translated.e51e4582}</h2>
61-
<Cell style={{ flexWrap: 'wrap' }}>
62-
<Demo2 />
63-
</Cell>
58+
<Demo2 />
6459
<h2>{translated['0aaad622']}</h2>
65-
<Cell style={{ flexWrap: 'wrap' }}>
66-
<Demo3 />
67-
</Cell>
60+
<Demo3 />
6861
<h2>{translated['7db1a8b2']}</h2>
69-
<Cell style={{ flexWrap: 'wrap' }}>
70-
<Demo4 />
71-
</Cell>
62+
<Demo4 />
7263
<h2>{translated.ce5c5447}</h2>
73-
<Cell style={{ flexWrap: 'wrap' }}>
74-
<Demo5 />
75-
</Cell>
64+
<Demo5 />
7665
<h2>{translated.a52bef0c}</h2>
77-
<Cell style={{ flexWrap: 'wrap' }}>
78-
<Demo6 />
79-
</Cell>
66+
<Demo6 />
8067
<h2>{translated['0aaad620']}</h2>
81-
<Cell style={{ flexWrap: 'wrap' }}>
82-
<Demo7 />
83-
</Cell>
68+
<Demo7 />
8469
<h2>{translated.c9e6df49}</h2>
85-
<Cell>
86-
<Demo8 />
87-
</Cell>
70+
<Demo8 />
8871
<h2>{translated.customColor}</h2>
89-
<Cell style={{ flexWrap: 'wrap' }}>
90-
<Demo9 />
91-
</Cell>
72+
<Demo9 />
9273
</div>
9374
</>
9475
)

src/packages/button/demos/h5/demo1.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from 'react'
2-
import { Button } from '@nutui/nutui-react'
2+
import { Button, Cell } from '@nutui/nutui-react'
33

44
const Demo1 = () => {
55
const marginStyle = { margin: 8 }
66
return (
7-
<>
7+
<Cell style={{ flexWrap: 'wrap' }}>
88
<Button type="primary" style={marginStyle}>
99
Primary
1010
</Button>
@@ -23,7 +23,7 @@ const Demo1 = () => {
2323
<Button type="success" style={marginStyle}>
2424
Success
2525
</Button>
26-
</>
26+
</Cell>
2727
)
2828
}
2929
export default Demo1

src/packages/button/demos/h5/demo2.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from 'react'
2-
import { Button } from '@nutui/nutui-react'
2+
import { Button, Cell } from '@nutui/nutui-react'
33

44
const Demo2 = () => {
55
const marginStyle = { margin: 8 }
66
return (
7-
<>
7+
<Cell style={{ flexWrap: 'wrap' }}>
88
<Button type="primary" fill="solid" style={marginStyle}>
99
Solid
1010
</Button>
@@ -17,7 +17,7 @@ const Demo2 = () => {
1717
<Button fill="none" style={marginStyle}>
1818
None
1919
</Button>
20-
</>
20+
</Cell>
2121
)
2222
}
2323
export default Demo2

src/packages/button/demos/h5/demo3.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from 'react'
22
import { Star, Plus } from '@nutui/icons-react'
3-
import { Button } from '@nutui/nutui-react'
3+
import { Button, Cell } from '@nutui/nutui-react'
44

55
const Demo3 = () => {
66
const marginStyle = { margin: 8 }
77
return (
8-
<>
8+
<Cell style={{ flexWrap: 'wrap' }}>
99
<Button
1010
type="primary"
1111
icon={<Star />}
@@ -115,7 +115,7 @@ const Demo3 = () => {
115115
>
116116
Button
117117
</Button>
118-
</>
118+
</Cell>
119119
)
120120
}
121121
export default Demo3

src/packages/button/demos/h5/demo4.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from 'react'
22
import { Star, Plus } from '@nutui/icons-react'
3-
import { Button } from '@nutui/nutui-react'
3+
import { Button, Cell } from '@nutui/nutui-react'
44

55
const Demo4 = () => {
66
const marginStyle = { margin: 8 }
77
return (
8-
<>
8+
<Cell style={{ flexWrap: 'wrap' }}>
99
<Button
1010
disabled
1111
type="primary"
@@ -111,7 +111,7 @@ const Demo4 = () => {
111111
>
112112
Disabled
113113
</Button>
114-
</>
114+
</Cell>
115115
)
116116
}
117117
export default Demo4
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import React from 'react'
2-
import { Button } from '@nutui/nutui-react'
2+
import { Button, Cell } from '@nutui/nutui-react'
33

44
const Demo5 = () => {
55
const marginStyle = { margin: 8 }
66
return (
7-
<>
7+
<Cell style={{ flexWrap: 'wrap' }}>
88
<Button style={marginStyle} type="primary" shape="square">
99
Square Button
1010
</Button>
1111
<Button style={marginStyle} type="primary">
1212
Round Button
1313
</Button>
14-
</>
14+
</Cell>
1515
)
1616
}
1717
export default Demo5

src/packages/button/demos/h5/demo6.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, { useState } from 'react'
2-
import { Button } from '@nutui/nutui-react'
2+
import { Button, Cell } from '@nutui/nutui-react'
33

44
const Demo6 = () => {
55
const [loading, setLoading] = useState(false)
66
const marginStyle = { margin: 8 }
77
return (
8-
<>
8+
<Cell style={{ flexWrap: 'wrap' }}>
99
<Button loading type="warning" style={marginStyle}>
1010
Loading
1111
</Button>
@@ -22,7 +22,7 @@ const Demo6 = () => {
2222
>
2323
Click Me!
2424
</Button>
25-
</>
25+
</Cell>
2626
)
2727
}
2828
export default Demo6
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
import React from 'react'
2-
import { Button } from '@nutui/nutui-react'
2+
import { Button, Cell } from '@nutui/nutui-react'
33

44
const App = () => {
55
const marginStyle = { margin: 8 }
66
return (
7-
<>
8-
<Button type="primary" style={marginStyle}>
9-
Normal
7+
<Cell style={{ flexWrap: 'wrap' }}>
8+
<Button size="mini" style={marginStyle} type="primary">
9+
Mini
1010
</Button>
11-
<Button style={marginStyle}>Normal</Button>
1211
<Button size="small" style={marginStyle} type="primary">
1312
Small
1413
</Button>
15-
<Button size="mini" style={marginStyle} type="primary">
16-
Mini
14+
<Button type="primary" style={marginStyle}>
15+
Normal
1716
</Button>
1817
<Button size="large" type="primary" style={marginStyle}>
1918
Large
2019
</Button>
2120
<Button size="xlarge" type="primary" style={marginStyle}>
2221
XLarge
2322
</Button>
24-
</>
23+
</Cell>
2524
)
2625
}
2726
export default App
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import React from 'react'
2-
import { Button } from '@nutui/nutui-react'
2+
import { Button, Cell } from '@nutui/nutui-react'
33

44
const Demo8 = () => {
55
return (
6-
<Button block type="primary">
7-
Block Button
8-
</Button>
6+
<Cell style={{ flexWrap: 'wrap' }}>
7+
<Button block type="primary">
8+
Block Button
9+
</Button>
10+
</Cell>
911
)
1012
}
1113
export default Demo8

0 commit comments

Comments
 (0)