Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/sites/assets/styles/highlight.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ code {
overflow-x: auto;
color: $nutui-doc-code-color;
font-weight: 400;
font-size: 14px;
font-size: 13px;
font-family: $nutui-doc-code-font-family;
line-height: 26px;
line-height: 1.8;
white-space: pre-wrap;
word-wrap: break-word;
-webkit-font-smoothing: auto;
background-color: #fafafa;
border-radius: 16px;
border-radius: 4px;
border: 1px solid #eee;

span {
font-family: $nutui-doc-code-font-family;
Expand All @@ -29,9 +30,7 @@ pre {

.hljs {
display: block;
padding: 30px;
overflow-x: auto;
background: #f7f8fa;
}

.hljs-comment,
Expand Down
29 changes: 9 additions & 20 deletions src/sites/assets/styles/md-style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
h5,
h6 {
color: $nutui-doc-black;
font-weight: bold;
font-weight: 600;
line-height: 1.5;
}

Expand All @@ -61,7 +61,6 @@
font-weight: bold;
position: relative;
margin-bottom: 56px;
// display: none;
&:after {
content: '';
position: absolute;
Expand All @@ -81,26 +80,23 @@

h3 {
margin: 16px 0px;
font-weight: 400;
font-size: 18px;
}

h4 {
margin: 24px 0 12px;
font-weight: 600;
font-size: 16px;
}

h5 {
margin: 24px 0 12px;
font-weight: 600;
font-size: 15px;
}

p {
color: $nutui-doc-text-color;
font-size: 14px;
line-height: 22px;
line-height: 2;
}

strong {
Expand All @@ -112,36 +108,33 @@

table {
width: 100%;
margin-top: 12px;
margin: 12px 0;
color: $nutui-doc-text-color;
font-size: 14px;
line-height: 1.5;
border-collapse: collapse;
border: 1px solid #eee;

th {
padding: 8px 20px;
padding: 8px 12px;
font-weight: 600;
text-align: left;
border-left: 1px solid #e9e9e9;
background-color: #f7f8fa;
// &:first-child {
// padding-left: 0;
// }

&:last-child {
padding-right: 0;
}
}

td {
padding: 8px 20px;
padding: 8px 12px;
border-top: 1px solid $nutui-doc-code-background-color;
border-left: 1px solid #e9e9e9;

&:first-child {
// padding-left: 0;
border-left: 0px;
font-weight: 600;
// version tag
code {
margin: 0;
Expand All @@ -153,10 +146,6 @@
border-radius: 20px;
}
}

&:last-child {
padding-right: 0;
}
}

em {
Expand All @@ -177,10 +166,10 @@
ol li {
position: relative;
margin: 5px 0 5px 10px;
padding-left: 15px;
padding-left: 14px;
color: $nutui-doc-text-color;
font-size: 15px;
line-height: 26px;
font-size: 14px;
line-height: 2;

&::before {
position: absolute;
Expand Down
4 changes: 2 additions & 2 deletions src/sites/sites-react/doc-taro/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $doc-title-height: 137px;

.doc {
&-content {
margin-left: 290px;
margin-left: 270px;
display: flex;
flex-direction: column;
background: #fff;
Expand Down Expand Up @@ -164,7 +164,7 @@ $doc-title-height: 137px;
transition: opacity 0.8s;

&.fixed {
width: calc(100% - 290px);
width: calc(100% - 270px);
position: fixed;
padding: 24px 48px;
z-index: 999;
Expand Down
5 changes: 2 additions & 3 deletions src/sites/sites-react/doc/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $doc-title-height: 137px;

.doc {
&-content {
margin-left: 290px;
margin-left: 270px;
display: flex;
flex-direction: column;
background: #fff;
Expand Down Expand Up @@ -85,7 +85,6 @@ $doc-title-height: 137px;
background-color: #000;
border-radius: 5px;
position: absolute;
/* min-width:150px; */
white-space: nowrap;
top: -200%;
transform: translateX(-55%);
Expand Down Expand Up @@ -164,7 +163,7 @@ $doc-title-height: 137px;
transition: opacity 0.8s;

&.fixed {
width: calc(100% - 290px);
width: calc(100% - 270px);
position: fixed;
padding: 24px 48px;
z-index: 999;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.qa-container {
margin: 0;
border: 1px solid #eee;
border-radius: 4px;
padding: 16px;
font-size: 14px;
.qa-list {
&-item {
text-decoration: none;
color: rgba(0, 115, 255, 0.7);
line-height: 2;
}
.version-tag {
font-size: 12px;
color: #c2c4cc;
background-color: #f5f5f5;
padding: 0 4px;
margin-left: 2px;
border-radius: 4px;
}
}
.qa-tips {
color: #666;
margin-top: 16px;
&-link {
color: rgba(0, 115, 255, 0.6);
text-decoration: none;
}
}
}
70 changes: 26 additions & 44 deletions src/sites/sites-react/doc/components/contribution/contribution.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { FunctionComponent } from 'react'
import data from './contribution.json'
import './contribution.scss'

interface ContributionMDXProps {
name: string
Expand All @@ -12,33 +13,23 @@ const Contribution: FunctionComponent<ContributionMDXProps> = (props) => {
return (
<>
<h3>Bugs & Tips</h3>
<div style={{ margin: 0 }}>
<div className='qa-container'>
{issues[name].map((item) => (
<div key={item.number} style={{ margin: 2 }}>
<div key={item.number} className='qa-list'>
<a
href={item.url}
target="_blank"
style={{
display: 'block',
textDecoration: 'none',
color: '#576b95',
fontSize: 14,
}}
className='qa-list-item'
>
{item.title}
</a>
</div>
))}
{logs[name].map((item) => (
<div key={item.version} style={{ margin: 2 }}>
<div key={item.version} className='qa-list'>
<a
href={item.content.match(/\(\[(#\d+)\]\(([^)]+)\)\)/)?.[2]}
style={{
display: 'inline',
textDecoration: 'none',
color: '#576b95',
fontSize: 14,
}}
className='qa-list-item'
>
{item.content
.replace(/@[^\s]+$/, '')
Expand All @@ -49,40 +40,31 @@ const Contribution: FunctionComponent<ContributionMDXProps> = (props) => {
''
)}
</a>
<span
style={{
fontSize: 14,
color: '#666',
backgroundColor: '#f5f5f5',
padding: '0 4px',
borderRadius: 5,
}}
>
<span className='version-tag'>
{item.version}
</span>
</div>
))}

<div className='qa-tips'>
<span>查看更多 </span>
<a
href={`https://github.com/jdf2e/nutui-react/issues?q=is%3Aissue%20state%3Aclosed%20${name.toLowerCase()}`}
className='qa-tips-link'
>
issues
</a>
<span> and </span>
<a
href={`https://github.com/jdf2e/nutui-react/releases?q=${name.toLowerCase()}&expanded=true`}
className='qa-tips-link'
>
releases
</a>
,欢迎提交 PR。
</div>
</div>
{issues[name].length > 0 ||
(logs[name].length > 0 && (
<div style={{ fontSize: '14px', color: '#666', marginTop: '16px' }}>
<span>View more resolved </span>
<a
href={`https://github.com/jdf2e/nutui-react/issues?q=is%3Aissue%20state%3Aclosed%20${name.toLowerCase()}`}
style={{ color: '#1677ff', textDecoration: 'none' }}
>
issues
</a>
<span> and </span>
<a
href={`https://github.com/jdf2e/nutui-react/releases?q=${name.toLowerCase()}&expanded=true`}
style={{ color: '#1677ff', textDecoration: 'none' }}
>
releases
</a>
<span> for {name}</span>
</div>
))}

</>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const modules = import.meta.glob(`@/packages/**/demos/**/*.tsx`, {

const CodeBlock: FunctionComponent = (props: { src?: string }) => {
const ctx = useContext(APPContext)
const path = `${ctx.path}/doc.md`
const originCode = modules[`${ctx.path}/demos/${props.src}`]
try {
const highlightedCode = hljs.highlightAuto(originCode, ['jsx']).value
Expand Down
16 changes: 9 additions & 7 deletions src/sites/sites-react/doc/components/nav/nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
bottom: 0;
z-index: 1;
background: $white;
width: 290px;
width: 270px;
height: 100vh;
border-right: 1px solid #eee;
overflow: auto;
Expand All @@ -33,12 +33,12 @@
}

li {
height: 48px;
line-height: 48px;
height: 40px;
line-height: 40px;
font-size: 14px;
color: $doc-default-nav-color;
position: relative;
font-weight: bold;
font-weight: 600;

&.active {
font-weight: bold;
Expand All @@ -47,7 +47,7 @@
&::before {
position: absolute;
content: '';
left: 0;
left: -12px;
top: 50%;
width: 22px;
margin-top: -5px;
Expand All @@ -61,10 +61,12 @@

> ul {
li {
padding-left: 29px;
padding-left: 12px;
height: 36px;
line-height: 36px;
cursor: pointer;
height: 100%;
font-weight: bold;
font-weight: 500;

&:hover {
&:visited {
Expand Down
2 changes: 1 addition & 1 deletion src/sites/sites-react/doc/components/nav/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const Nav = () => {
}
to={`${lang ? `/${lang}` : ''}/component/${cp.name}`}
>
{cp.name}&nbsp;&nbsp;
{cp.name}&nbsp;
<b>{lang === 'zh-CN' && cp.cName}</b>
</NavLink>
</li>
Expand Down
Loading