Skip to content

Commit 32fe333

Browse files
committed
feat: improve card style
1 parent 766bda1 commit 32fe333

3 files changed

Lines changed: 71 additions & 32 deletions

File tree

src/tool-stack/index.module.scss

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// L - Large screens: three cards per row
2-
@media screen and (min-width: 1001px) {
2+
@media screen and (min-width: 1101px) {
33
.tools {
44
.tool {
55
min-width: calc(33.33% - 21.33px);
@@ -10,7 +10,7 @@
1010
}
1111

1212
// M - Medium screens: two cards per row
13-
@media screen and (min-width: 601px) and (max-width: 1000px) {
13+
@media screen and (min-width: 601px) and (max-width: 1100px) {
1414
.tools {
1515
.tool {
1616
min-width: calc(50% - 16px);
@@ -34,25 +34,27 @@
3434
html:not(.dark) {
3535
--rs-tool-stack-shadow-color: #f9f9f9;
3636
--rs-tool-stack-title-color: #0b0c0e;
37-
--rs-tool-stack-desc-color: #6b7075;
37+
--rs-tool-stack-desc-color: #8fa1b9;
3838

39-
--rs-tool-stack-card-stroke: rgba(226, 232, 240, 0.5);
39+
--rs-tool-stack-card-stroke: rgba(143, 161, 185, 0.3);
4040
--rs-tool-stack-card-gradient: linear-gradient(
4141
135deg,
4242
rgba(255, 255, 255, 1),
4343
rgba(249, 249, 249, 0.5)
4444
);
45+
--rs-tools-stack-url-color: #f93920;
4546
}
4647
html.dark {
4748
--rs-tool-stack-shadow-color: #23272f;
4849
--rs-tool-stack-title-color: white;
49-
--rs-tool-stack-desc-color: #c6cacd;
50+
--rs-tool-stack-desc-color: #8fa1b9;
5051
--rs-tool-stack-card-stroke: #23272f;
5152
--rs-tool-stack-card-gradient: linear-gradient(
5253
135deg,
5354
rgba(255, 255, 255, 0),
5455
rgba(255, 255, 255, 0.03)
5556
);
57+
--rs-tools-stack-url-color: #f93920;
5658
}
5759
}
5860

@@ -74,43 +76,72 @@
7476
box-sizing: border-box;
7577

7678
flex-direction: column;
77-
align-items: center;
78-
gap: 16px;
79+
align-items: start;
80+
gap: 8px;
7981
align-self: stretch;
8082

8183
// style
8284
border-radius: 10px;
8385
border: 1px solid var(--rs-tool-stack-card-stroke);
8486
background: var(--rs-tool-stack-card-gradient);
85-
box-shadow: 0px -2px 10px 0px var(--rs-tool-stack-shadow-color);
8687
transition: all 0.2s ease-out;
88+
8789
&:hover {
88-
transform: scale3d(1.04, 1.04, 1.04);
90+
transform: scale3d(1.03, 1.03, 1.03);
8991
}
9092

9193
.logo {
92-
height: 90px;
94+
width: 52px;
95+
height: 52px;
96+
object-fit: contain;
9397
flex-shrink: 0;
9498
}
9599

100+
.toolContent {
101+
display: flex;
102+
flex-direction: column;
103+
align-items: flex-start;
104+
gap: 8px;
105+
}
106+
96107
.toolTitle {
97108
color: var(--rs-tool-stack-title-color);
98109
text-align: center;
99110

100-
font-size: 22px;
111+
font-size: 19px;
101112
font-style: normal;
102113
font-weight: 600;
103-
line-height: 32px; /* 145.455% */
114+
line-height: 24px;
115+
margin-top: 4px;
104116
}
105117

106118
.toolDescription {
107119
color: var(--rs-tool-stack-desc-color);
108-
text-align: center;
120+
text-align: left;
121+
height: 48px;
109122

110123
font-size: 14px;
111124
font-style: normal;
112125
font-weight: 400;
113126
line-height: 24px;
114127
margin: 0;
115128
}
129+
130+
.toolUrl {
131+
color: var(--rs-tools-stack-url-color);
132+
font-size: 15px;
133+
font-style: normal;
134+
font-weight: 400;
135+
line-height: 24px;
136+
text-decoration: none;
137+
display: block;
138+
text-align: left;
139+
width: 100%;
140+
}
141+
}
142+
143+
@keyframes rotate {
144+
100% {
145+
transform: rotate(1turn);
146+
}
116147
}

src/tool-stack/index.tsx

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,50 +14,56 @@ export const ToolStack: React.FC<{ lang: string }> = memo(({ lang }) => {
1414
{
1515
name: 'Rspack',
1616
desc: isEn
17-
? 'A high performance JavaScript bundler written in Rust, with a webpack-compatible API'
17+
? 'A high performance JavaScript bundler written in Rust, with webpack-compatible API'
1818
: '基于 Rust 编写的高性能 JavaScript 打包工具,具备与 webpack 兼容的 API',
1919
logo: 'https://assets.rspack.dev/rspack/rspack-logo.svg',
2020
url: 'https://rspack.dev',
21+
urlText: 'rspack.dev',
2122
},
2223
{
2324
name: 'Rsbuild',
2425
desc: isEn
25-
? 'An Rspack-based build tool that provides out-of-the-box setup for enjoyable development experience'
26+
? 'An Rspack-based build tool that provides out-of-the-box setup'
2627
: '基于 Rspack 的构建工具,包含开箱即用的预设配置,带来愉悦的开发体验',
2728
logo: 'https://assets.rspack.dev/rsbuild/rsbuild-logo.svg',
2829
url: 'https://rsbuild.dev',
30+
urlText: 'rsbuild.dev',
31+
},
32+
{
33+
name: 'Rslib',
34+
desc: isEn
35+
? 'A Rsbuild-based library development tool for creating libraries and UI components'
36+
: '基于 Rsbuild 的库开发工具,以简单的方式创建 JavaScript 库和 UI 组件库',
37+
logo: 'https://assets.rspack.dev/rslib/rslib-logo.svg',
38+
url: 'https://lib.rsbuild.dev',
39+
urlText: 'lib.rsbuild.dev',
2940
},
3041
{
3142
name: 'Rspress',
3243
desc: isEn
33-
? 'A static site generator based on Rsbuild and MDX for creating elegant documentation sites'
34-
: '基于 Rsbuild 和 MDX 的静态站点生成器,用于创建优雅的文档站点',
44+
? 'An Rsbuild-based static site generator for creating documentation sites'
45+
: '基于 Rsbuild 的静态站点生成器,用于创建优雅的文档站点',
3546
logo: 'https://assets.rspack.dev/rspress/rspress-logo-480x480.png',
3647
url: 'https://rspress.dev',
48+
urlText: 'rspress.dev',
3749
},
3850
{
3951
name: 'Rsdoctor',
4052
desc: isEn
41-
? 'A one-stop, intelligent build analyzer that makes the build process transparent, predictable, and optimizable'
42-
: '一站式、智能化的构建分析工具,使构建流程变得透明、可预测和可优化',
53+
? 'A one-stop build analyzer that makes the build process transparent'
54+
: '一站式的构建分析工具,使构建流程变得透明、可预测和可优化',
4355
logo: 'https://assets.rspack.dev/rsdoctor/rsdoctor-logo-480x480.png',
4456
url: 'https://rsdoctor.dev',
45-
},
46-
{
47-
name: 'Rslib',
48-
desc: isEn
49-
? 'A Rsbuild-based library development tool for creating JavaScript libraries in a simple and intuitive way'
50-
: '基于 Rsbuild 的库开发工具,以简单直观的方式创建 JavaScript 库',
51-
logo: 'https://assets.rspack.dev/rslib/rslib-logo.svg',
52-
url: 'https://lib.rsbuild.dev',
57+
urlText: 'rsdoctor.dev',
5358
},
5459
{
5560
name: 'Rstest',
5661
desc: isEn
57-
? 'An Rspack-based testing framework that provides comprehensive, first-class support for the Rspack ecosystem'
62+
? 'An testing framework that provides first-class support for Rspack ecosystem'
5863
: '基于 Rspack 的测试框架,为 Rspack 生态提供全面、一流的支持',
5964
logo: 'https://assets.rspack.dev/rstest/rstest-logo.svg',
6065
url: 'https://github.com/web-infra-dev/rstest',
66+
urlText: 'web-infra-dev/rstest',
6167
},
6268
];
6369

@@ -68,16 +74,16 @@ export const ToolStack: React.FC<{ lang: string }> = memo(({ lang }) => {
6874
<p className={descStyle}>
6975
{isEn
7076
? 'A unified JavaScript toolchain built around Rspack, with consistent architecture and ultimate performance'
71-
: '围绕 Rspack 打造的统一 JavaScript 工具链,一致的底层架构,极致的性能体验'}
77+
: '围绕 Rspack 打造的 JavaScript 统一工具链,一致的底层架构,极致的性能体验'}
7278
</p>
7379
</div>
7480
<div className={styles.tools}>
75-
{tools.map(({ name, desc, logo, url }) => {
81+
{tools.map(({ name, desc, logo, url, urlText }) => {
7682
return (
7783
<a
7884
target="_blank"
7985
rel="noreferrer"
80-
className={styles.tool}
86+
className={[styles.tool, styles.rainbow].join(' ')}
8187
key={name}
8288
href={url}
8389
>
@@ -89,6 +95,7 @@ export const ToolStack: React.FC<{ lang: string }> = memo(({ lang }) => {
8995
/>
9096
<div className={styles.toolTitle}>{name}</div>
9197
<p className={styles.toolDescription}>{desc}</p>
98+
<div className={styles.toolUrl}>{urlText}</div>
9299
</a>
93100
);
94101
})}

stories/index.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
}
5454

5555
:root {
56-
--rp-font-family-base: 'Inter var experimental', 'Inter var', -apple-system,
56+
--rp-font-family-base:
57+
'Open Sans', 'Inter var experimental', 'Inter var', -apple-system,
5758
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
5859
'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
5960
--rp-font-family-mono: Menlo, Monaco, Consolas, 'Courier New', monospace;

0 commit comments

Comments
 (0)