Skip to content

Commit cd02261

Browse files
authored
docs: unify homepage footer layout (#487)
1 parent db3dd6f commit cd02261

5 files changed

Lines changed: 35 additions & 49 deletions

File tree

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
.copyRight {
2-
bottom: 0;
3-
width: 100%;
4-
margin-top: 3rem;
5-
padding: 2rem 1.5rem;
6-
border-top: 1px solid var(--rp-c-divider-light);
7-
8-
@media (min-width: 640px) {
9-
padding: 2rem;
10-
}
11-
}
12-
13-
.copyRightInner {
14-
width: 100%;
15-
margin: 0 auto;
16-
text-align: center;
17-
}
18-
19-
.copyRightText {
2+
margin: 0;
203
color: var(--rp-c-text-2);
214
font-size: 0.875rem;
225
font-weight: 400;
236
line-height: 1.8;
247

25-
p {
26-
margin: 0;
8+
a {
9+
color: inherit;
10+
white-space: nowrap;
11+
12+
&:hover {
13+
text-decoration: underline;
14+
}
2715
}
2816
}

website/theme/components/Copyright.tsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ import styles from './Copyright.module.scss';
22

33
export const CopyRight = () => {
44
return (
5-
<footer className={styles.copyRight}>
6-
<div className={styles.copyRightInner}>
7-
<div className={styles.copyRightText}>
8-
<p>
9-
Rstack CLI is free and open source software released under the MIT
10-
license.
11-
</p>
12-
<p>© 2026 Rstack contributors.</p>
13-
</div>
14-
</div>
15-
</footer>
5+
<p className={styles.copyRight}>
6+
© 2026 Rstack contributors ·{' '}
7+
<a
8+
href="https://github.com/rstackjs/rstack-cli/blob/main/LICENSE"
9+
target="_blank"
10+
rel="noopener noreferrer"
11+
>
12+
MIT License
13+
</a>
14+
</p>
1615
);
1716
};

website/theme/components/HomeFooter.module.scss

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
.footer {
2-
display: none;
3-
flex-direction: column;
4-
align-items: center;
2+
width: 100%;
3+
max-width: 72rem;
4+
margin: 0 auto;
5+
padding: 5rem 2rem 3rem;
56

6-
@media (min-width: 640px) {
7-
display: flex;
7+
@media (max-width: 640px) {
8+
padding-inline: 1.25rem;
89
}
910
}
1011

11-
.container {
12-
display: flex;
12+
.links {
13+
display: none;
1314
justify-content: space-between;
1415
gap: 2rem;
15-
width: 100%;
16-
max-width: 72rem;
17-
padding: 3rem 2rem 1rem;
16+
margin-bottom: 5rem;
1817

19-
@media (max-width: 640px) {
20-
padding-inline: 1.25rem;
18+
@media (min-width: 640px) {
19+
display: flex;
2120
}
2221
}
2322

@@ -27,7 +26,7 @@
2726
align-items: flex-start;
2827

2928
h2 {
30-
margin: 1rem 0;
29+
margin: 0 0 1rem;
3130
font-size: 1.125rem;
3231
font-weight: 600;
3332
line-height: 1.75rem;

website/theme/components/HomeFooter.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useI18n, useLang } from '@rspress/core/runtime';
22
import { Link } from '@rspress/core/theme-original';
33
import { memo } from 'react';
4+
import { CopyRight } from './Copyright';
45
import styles from './HomeFooter.module.scss';
56

67
function useFooterData() {
@@ -116,8 +117,8 @@ export const HomeFooter = memo(() => {
116117
const footerData = useFooterData();
117118

118119
return (
119-
<div className={styles.footer}>
120-
<div className={styles.container}>
120+
<footer className={styles.footer}>
121+
<div className={styles.links}>
121122
{footerData.map((item) => (
122123
<div key={item.title} className={styles.column}>
123124
<h2>{item.title}</h2>
@@ -133,6 +134,7 @@ export const HomeFooter = memo(() => {
133134
</div>
134135
))}
135136
</div>
136-
</div>
137+
<CopyRight />
138+
</footer>
137139
);
138140
});

website/theme/pages/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Commands } from '../components/Commands';
2-
import { CopyRight } from '../components/Copyright';
32
import { GetStarted } from '../components/GetStarted';
43
import { Hero } from '../components/Hero';
54
import { HomeFooter } from '../components/HomeFooter';
@@ -11,7 +10,6 @@ export function HomeLayout() {
1110
<Commands />
1211
<GetStarted />
1312
<HomeFooter />
14-
<CopyRight />
1513
</>
1614
);
1715
}

0 commit comments

Comments
 (0)