Skip to content

Commit 586572f

Browse files
committed
docs: fix button
1 parent bbe5f2f commit 586572f

File tree

3 files changed

+59
-31
lines changed

3 files changed

+59
-31
lines changed

packages/docs/.vitepress/components/HomeSponsors.vue

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,5 @@ onMounted(() => {
4848
.cta {
4949
margin-top: 1rem;
5050
}
51-
52-
.become-sponsor {
53-
font-size: 0.9em;
54-
font-weight: 700;
55-
width: auto;
56-
background-color: transparent;
57-
padding: 0.75em 2em;
58-
border-radius: 2em;
59-
transition: all 0.15s ease;
60-
box-sizing: border-box;
61-
border: 2px solid var(--c-text);
62-
color: var(--c-text);
63-
}
64-
65-
.become-sponsor:hover {
66-
background-color: var(--c-yellow);
67-
text-decoration: none;
68-
border-color: var(--c-yellow);
69-
color: var(--c-text-light-1);
70-
}
7151
</style>
52+

packages/docs/.vitepress/theme/Layout.ts

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,36 @@ export const Layout: FunctionalComponent = () => {
2525
'sidebar-top': () =>
2626
h('div', { class: 'sponsors sponsors-top' }, [
2727
h('span', 'Platinum Sponsors'),
28-
...sponsors.platinum.map(({ href, imgSrcDark, imgSrcLight, alt }) =>
29-
h(
30-
'a',
31-
{
32-
href,
33-
target: '_blank',
34-
rel: 'noopener',
35-
},
36-
[h('img', { src: isDark.value ? imgSrcDark : imgSrcLight, alt })]
37-
)
38-
),
28+
...(sponsors.platinum.length
29+
? sponsors.platinum.map(({ href, imgSrcDark, imgSrcLight, alt }) =>
30+
h(
31+
'a',
32+
{
33+
href,
34+
target: '_blank',
35+
rel: 'noopener',
36+
},
37+
[
38+
h('img', {
39+
src: isDark.value ? imgSrcDark : imgSrcLight,
40+
alt,
41+
}),
42+
]
43+
)
44+
)
45+
: [
46+
h(
47+
'a',
48+
{
49+
class: 'become-sponsor',
50+
href: 'https://github.com/sponsors/posva',
51+
target: '_blank',
52+
rel: 'noopener',
53+
alt: 'Your logo here',
54+
},
55+
'Become a Sponsor!'
56+
),
57+
]),
3958
]),
4059
'sidebar-bottom': () =>
4160
h('div', { class: 'sponsors' }, [

packages/docs/.vitepress/theme/custom.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,31 @@ code {
183183
font-size: 0.95em;
184184
padding: 0.175em 0.35em;
185185
}
186+
187+
.become-sponsor {
188+
font-size: 0.9em;
189+
font-weight: 700;
190+
width: auto;
191+
text-align: center;
192+
background-color: transparent;
193+
padding: 0.75em 2em;
194+
border-radius: 2em;
195+
transition: all 0.15s ease;
196+
box-sizing: border-box;
197+
border: 2px solid var(--c-text);
198+
color: var(--c-text);
199+
}
200+
201+
.become-sponsor:hover {
202+
background-color: var(--c-yellow);
203+
text-decoration: none;
204+
border-color: var(--c-yellow);
205+
color: var(--c-text-light-1);
206+
}
207+
208+
.sponsors-top .become-sponsor {
209+
font-size: 0.75em;
210+
padding: 0.2em;
211+
width: auto;
212+
max-width: 150px;
213+
}

0 commit comments

Comments
 (0)