Skip to content

Commit 1ea9a9c

Browse files
committed
style: modify component style.
1 parent 8d4688f commit 1ea9a9c

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

core/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const Demo = () => {
2929
<div>这里是示例展示</div>
3030
</Preview>
3131
<Toolbar>Code Example</Toolbar>
32-
<Code>
32+
<Code tagName="pre">
3333
{code}
3434
</Code>
3535
</CodeLayout>
@@ -57,7 +57,7 @@ const Demo = () => {
5757
<div>这里是示例展示</div>
5858
</Preview>
5959
<Toolbar>Code Example</Toolbar>
60-
<Code>
60+
<Code tagName="pre">
6161
{code}
6262
</Code>
6363
</CodeLayout>
@@ -84,7 +84,7 @@ const Demo = () => (
8484
<div>示例内容</div>
8585
</Preview>
8686
<Toolbar>Code Example</Toolbar>
87-
<Code>
87+
<Code tagName="pre">
8888
{code}
8989
</Code>
9090
</CodeLayout>
@@ -110,7 +110,7 @@ const Demo = () => (
110110
<div>示例内容</div>
111111
</Preview>
112112
<Toolbar>Code Example</Toolbar>
113-
<Code>
113+
<Code tagName="pre">
114114
{code}
115115
</Code>
116116
</CodeLayout>
@@ -137,7 +137,7 @@ const Demo = () => {
137137
<div>示例内容</div>
138138
</Preview>
139139
<Toolbar extra={<div>按钮</div>}>Code Example</Toolbar>
140-
<Code>
140+
<Code tagName="pre">
141141
{code}
142142
</Code>
143143
</CodeLayout>
@@ -170,7 +170,7 @@ const Demo = ()=> {
170170
<div>示例内容</div>
171171
</Preview>
172172
<Toolbar visible={visible} collapse={!visible}>Code Example</Toolbar>
173-
<Code>
173+
<Code tagName="pre">
174174
{code}
175175
</Code>
176176
</CodeLayout>
@@ -248,7 +248,7 @@ const Demo = () => (
248248
<Toolbar text={code} visibleButton={false} extra={extra}>
249249
Code Example
250250
</Toolbar>
251-
<Code>{code}</Code>
251+
<Code tagName="pre">{code}</Code>
252252
</CodeLayout>
253253
);
254254
export default Demo;
@@ -266,7 +266,7 @@ import CodeLayout from "react-code-preview-layout"
266266
<CodeLayout.Toolbar text={code} visibleButton={false} extra={extra}>
267267
Code Example
268268
</CodeLayout.Toolbar>
269-
<CodeLayout.Code>{code}</CodeLayout.Code>
269+
<CodeLayout.Code tagName="pre">{code}</CodeLayout.Code>
270270
</CodeLayout>
271271
```
272272

core/src/styles.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
}
1616
.w-rcpl.w-bordered > .w-rcpl-code:not(.w-hidden) {
1717
border-top: 1px dashed var(--color-border-muted);
18+
border-radius: 0 0 6px 6px;
1819
}
1920

2021
.w-rcpl {
@@ -35,6 +36,7 @@
3536
overflow: auto;
3637
border-top-left-radius: 0px;
3738
border-top-right-radius: 0px;
39+
margin-bottom: 0 !important;
3840
}
3941
.w-rcpl-code > * {
4042
padding: 0 !important;

0 commit comments

Comments
 (0)