docs: revamp homepage and switch to custom GitHub buttons

- Make the docs English-only by removing all zh-cn content, the language switcher UI, and related JS/config

- Rework homepage feature cards (Safe & Typed, Pure JavaScript, Shopify & Jekyll, Streaming) and refresh section colors/layout

- Replace buttons.github.io with custom Star/Sponsor buttons featuring a live star count and dark-mode support

- Drop the buttons.js script and tidy banner, header, footer, and share partials

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Yang Jun
2026-06-06 23:39:06 +08:00
co-authored by Cursor
parent 09bfe13f65
commit be18f33e20
138 changed files with 166 additions and 5969 deletions
+67 -9
View File
@@ -80,12 +80,70 @@ logo-size = 36px
@media mq-normal
display: block
#lang-select
opacity: 0
position: absolute
top: 0
left: 0
width: 100%
height: 100%
-webkit-appearance: menulist-button
font-size: inherit
@media mq-normal
.github-buttons-wrap
display: flex
align-items: center
line-height: normal
opacity: 1
span
display: inline-flex
align-items: center
.gh-star
display: inline-flex
margin-right: 12px
.gh-btn
border-radius: 0.25em 0 0 0.25em
.gh-btn, .gh-count
font: 600 12px/16px -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif
box-sizing: content-box
display: inline-flex
align-items: center
height: 16px
padding: 5px 10px
border: 1px solid #d1d9e0
color: #25292e
white-space: nowrap
.gh-btn
border-radius: 0.25em
background-color: #ebf0f4
background-image: linear-gradient(180deg, #f6f8fa, #ebf0f4 90%)
span
margin-left: 4px
&:hover, &:focus
color: #25292e
text-decoration: none
background-color: #e5eaee
background-image: linear-gradient(180deg, #eff2f5, #e5eaee 90%)
.gh-btn-icon
fill: currentColor
.gh-count
border-left: 0
border-radius: 0 0.25em 0.25em 0
background-color: #fff
&:hover, &:focus
color: #0969da
text-decoration: none
&:empty
display: none
@media (prefers-color-scheme: dark)
.gh-btn, .gh-count
border-color: #3d444d
color: #f0f6fc
.gh-btn
background-color: #1a2026
background-image: linear-gradient(180deg, #212830, #1a2026 90%)
&:hover, &:focus
color: #f0f6fc
background-color: #1f242c
background-image: linear-gradient(180deg, #262c36, #1f242c 90%)
.gh-count
background-color: #0d1117
&:hover, &:focus
color: #388bfd
+35 -81
View File
@@ -23,10 +23,12 @@
#banner-start
text-align: center
padding: 40px 0
padding: 40px 0 48px
line-height: 47px;
@media mq-tablet
padding-bottom: 64px
@media mq-normal
padding: 60px 0
padding-top: 60px
font-size: 18px
#banner-start-command
@@ -51,52 +53,15 @@
#banner-share
display: block
padding-bottom: 60px
#intro-news-list
background-color: var(--color-news-bg)
margin: -1px 0
#intro-news-flex
display: flex
flex-flow: column
@media mq-normal
flex-flow: row wrap
.intro-news-wrap
padding: 24px 30px
text-decoration: none
&:first-child
padding-left: 0
&:last-child
padding-right: 0
&:hover
background-color: var(--color-link-hover)
@media mq-normal
flex: 0 0 50%
padding: 36px 30px
@media screen and (min-width: 960px)
flex: 0 0 25%
.intro-news-time
font-size: 14px
color: rgba(255,255,255,.6)
.intro-news-wrap:hover .intro-news-time
color: rgba(255,255,255,.8)
.intro-news-title
padding-top: 4px
font-size: 15px
line-height: 1.2;
color: #fff
padding-top: 24px
#intro-feature-list
display: flex
flex-flow: column
margin: 30px 0
margin: 30px 0 50px
@media mq-normal
flex-flow: row wrap
margin: 30px 0 80px
.intro-feature-wrap
margin-top: 20px
@@ -112,7 +77,7 @@
padding-left: 48px
.intro-feature-icon
color: var(--color-link)
color: var(--color-default)
font-size: 36px
margin-bottom: 6px;
text-align: center
@@ -125,36 +90,22 @@
width: @font-size
.intro-feature-title
color: var(--color-link)
color: var(--color-default)
font-size: 24px
.intro-feature-desc
color: var(--color-gray)
margin-top: 1em
@media mq-normal
margin-top: line-height
line-height: line-height
a
text-decoration: none
color: black
&:visited, &:hover
color: black
color: var(--color-link)
&:hover
text-decoration: underline
@media (prefers-color-scheme: dark)
color: white
&:visited, &:hover
color: white
#intro-cmd-wrap
max-width: 700px
padding: 15px 30px
font-size: 16px
pre
line-height: 32px
overflow: auto
margin: 50px auto 0;
@media mq-normal
margin: 70px auto 0;
color: var(--color-link-hover)
code
color: var(--color-gray)
#intro-get-started-wrap
text-align: center
@@ -186,18 +137,36 @@
@media mq-tablet
margin-top: 64px
margin-bottom: 64px
.section-header
display: flex
align-items: baseline
justify-content: space-between
gap: 16px
margin: 0 0 24px
flex-wrap: wrap
h3
margin: 0
flex-shrink: 0
p.description
margin: 0
text-align: right
flex: 1
min-width: 0
color: var(--color-gray)
h3
color: #fff
font-size: 32px
p
color: #ccc
margin: 36px 0 24px
font-size: 20px
line-height: 1.5
.description a
text-decoration: none
color: var(--color-link)
&:hover
color: var(--color-link-hover)
#contributors-wrap
#sponsors-wrap
background: var(--color-content-bg)
.inner
h3
@@ -206,28 +175,13 @@
color: var(--color-gray)
.open-collective
max-width: 100%
.description a
color: #333
&:hover
background: var(--color-navy)
color: #fff
@media (prefers-color-scheme: dark)
p
color: var(--color-default)
.description a
color: #fff
&:hover
background: #fff
color: var(--color-navy-lighter)
#sponsors-wrap
#contributors-wrap
border: none
overflow: hidden;
.description a
color: #fff
&:hover
background: #fff
color: var(--color-navy-lighter)
.contributors
tr
+1 -4
View File
@@ -245,7 +245,4 @@ $article-footer-link
right: 0
.article-footer-updated
font-size: 0.9em
[lang="zh-cn"] .since::before
content: ""
font-size: 0.9em
-2
View File
@@ -10,7 +10,6 @@ vendor-prefixes = webkit moz ms official
--color-border: #e3e3e3
--color-navy: hsl(210, 25%, 12%)
--color-content-bg: #fff
--color-news-bg: darken(hsl(210, 25%, 12%), 5%)
--color-navy-lighter: lighten(hsl(210, 25%, 12%), 10%)
--color-link: #0e83cd
--color-link-hover: lighten(#0e83cd, 10%)
@@ -24,7 +23,6 @@ vendor-prefixes = webkit moz ms official
--color-border: #6a6a6a
--color-background: #fff
--color-navy: hsl(210, 25%, 12%)
--color-news-bg: darken(hsl(210, 25%, 12%), 5%)
--color-navy-lighter: lighten(hsl(210, 25%, 12%), 7%)
--color-content-bg: #1c1c1c
--color-link: #0e83cd