Skip to content

Commit a52361e

Browse files
committed
feat: make stable ui for partners
1 parent 7a48fd9 commit a52361e

5 files changed

Lines changed: 41 additions & 23 deletions

File tree

app/assets/logos/oss-partners/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,11 @@ export const OSS_PARTNERS = [
7777
name: 'Nuxt',
7878
logo: LogoNuxt,
7979
url: 'https://nuxt.com/',
80-
maxHeight: '3.2rem',
8180
},
8281
{
8382
name: 'Vue',
8483
logo: LogoVue,
8584
url: 'https://vuejs.org/',
86-
maxHeight: '3.5rem',
8785
},
8886
{
8987
name: 'Algolia',
@@ -138,7 +136,6 @@ export const OSS_PARTNERS = [
138136
name: 'Vue Data UI',
139137
logo: LogoVueDataUi,
140138
url: 'https://vue-data-ui.graphieros.com/',
141-
maxHeight: '3.5rem',
142139
},
143140
{
144141
name: 'UnJS',

app/assets/logos/sponsors/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ import LogoChromaticLight from './chromatic-light.svg'
1919
//
2020
// If there are no original assets and the logo is not universal, you can add only the dark theme variant
2121
// and specify 'auto' for the light one - this will grayscale the logo and invert it in light mode.
22-
// The maxHeight is used to make some logos more visually consistent with the others.
22+
// The normalisingIndent is the Y-axis space to visually stabilize favicon-only logos with logotypes that contain long name.
2323
export const SPONSORS = [
2424
{
2525
name: 'Vercel',
2626
logo: {
2727
dark: LogoVercel,
2828
light: LogoVercelLight,
2929
},
30-
maxHeight: '2.8rem',
30+
normalisingIndent: '0.875rem',
3131
url: 'https://vercel.com/',
3232
},
3333
{
@@ -36,7 +36,7 @@ export const SPONSORS = [
3636
dark: LogoVoidZero,
3737
light: LogoVoidZeroLight,
3838
},
39-
maxHeight: '2.8rem',
39+
normalisingIndent: '0.875rem',
4040
url: 'https://voidzero.dev/',
4141
},
4242
{
@@ -45,7 +45,7 @@ export const SPONSORS = [
4545
dark: LogoVlt,
4646
light: LogoVltLight,
4747
},
48-
maxHeight: '2.8rem',
48+
normalisingIndent: '0.875rem',
4949
url: 'https://vlt.sh/',
5050
},
5151
{
@@ -54,6 +54,7 @@ export const SPONSORS = [
5454
dark: LogoNetlify,
5555
light: LogoNetlifyLight,
5656
},
57+
normalisingIndent: '0.25rem',
5758
url: 'https://netlify.com/',
5859
},
5960
{
@@ -62,7 +63,7 @@ export const SPONSORS = [
6263
dark: LogoBluesky,
6364
light: LogoBlueskyLight,
6465
},
65-
maxHeight: '3.2rem',
66+
normalisingIndent: '0.625rem',
6667
url: 'https://bsky.app/',
6768
},
6869
{

app/components/About/LogoImg.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ const props = defineProps<{
1111
</script>
1212
<template>
1313
<div v-if="typeof src === 'string'" class="h-full">
14-
<img :src="src" loading="lazy" height="36" class="w-auto block h-full" :alt="alt" />
14+
<img
15+
:src="src"
16+
loading="lazy"
17+
height="36"
18+
class="h-full w-full object-contain block"
19+
:alt="alt"
20+
/>
1521
</div>
1622
<div v-else-if="src.light === 'auto'" class="h-full">
1723
<img
1824
:src="src.dark"
1925
loading="lazy"
2026
height="36"
21-
class="w-auto block light:invert light:grayscale h-full"
27+
class="h-full w-full object-contain block light:invert light:grayscale"
2228
:alt="alt"
2329
/>
2430
</div>
@@ -27,14 +33,14 @@ const props = defineProps<{
2733
:src="src.dark"
2834
loading="lazy"
2935
height="36"
30-
class="w-auto block light:hidden h-full"
36+
class="h-full w-full object-contain block light:hidden"
3137
:alt="alt"
3238
/>
3339
<img
3440
:src="src.light"
3541
loading="lazy"
3642
height="36"
37-
class="w-auto block hidden light:block h-full"
43+
class="h-full w-full object-contain block hidden light:block"
3844
:alt="alt"
3945
/>
4046
</div>

app/components/About/LogoList.vue

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
type BaseItem = {
33
name: string
44
url: string
5-
maxHeight?: string
5+
normalisingIndent?: string
66
logo:
77
| string
88
| {
@@ -22,41 +22,51 @@ const props = defineProps<{
2222
</script>
2323

2424
<template>
25-
<ul class="flex flex-wrap gap-2 md:gap-x-4 md:gap-y-3 -mx-2 list-none">
26-
<li v-for="item in list" :key="item.name" class="flex items-center justify-center">
25+
<ul class="list-none">
26+
<li
27+
v-for="item in list"
28+
:key="item.name"
29+
:style="
30+
'items' in item && `grid-column: span ${item.items.length} / span ${item.items.length};`
31+
"
32+
>
2733
<a
2834
v-if="'logo' in item"
2935
:href="item.url"
3036
target="_blank"
3137
rel="noopener noreferrer"
32-
class="relative flex items-center justify-center h-16 min-w-16 rounded-md hover:bg-fg/10 transition-colors p-2"
33-
:style="{ maxHeight: item.maxHeight }"
38+
class="relative flex items-center justify-center h-16 rounded-md bg-bg-muted hover:bg-bg-subtle border border-border transition-colors py-1 px-3"
39+
:style="{ paddingBlock: item.normalisingIndent }"
3440
:aria-label="item.name"
3541
>
3642
<AboutLogoImg :src="item.logo" :alt="item.name" />
3743
</a>
38-
<div v-else-if="item.items" class="relative flex items-center justify-center">
44+
<div
45+
v-else-if="item.items"
46+
class="relative flex items-center justify-center h-full bg-bg-muted border border-border rounded-md py-1 px-2"
47+
>
3948
<svg
4049
width="11"
4150
height="38"
4251
viewBox="0 0 11 38"
4352
fill="none"
4453
xmlns="http://www.w3.org/2000/svg"
4554
aria-hidden="true"
55+
class="h-full w-auto"
4656
>
4757
<path
4858
d="M5.62151 0C-1.8519 10.6931 -1.89574 27.2683 5.62151 37.9997H10.6709C3.15538 27.2683 3.19922 10.6931 10.6709 0H5.62151Z"
4959
fill="currentColor"
5060
/>
5161
</svg>
5262
<ul class="flex items-center justify-center h-full gap-0.5 list-none">
53-
<li v-for="groupItem in item.items" :key="groupItem.name">
63+
<li v-for="groupItem in item.items" :key="groupItem.name" class="h-full">
5464
<a
5565
:href="groupItem.url"
5666
target="_blank"
5767
rel="noopener noreferrer"
58-
class="relative flex items-center justify-center h-12 min-w-12 rounded-md hover:bg-fg/10 transition-colors p-1"
59-
:style="{ maxHeight: groupItem.maxHeight }"
68+
class="relative flex items-center justify-center h-full aspect-square rounded-md hover:bg-bg-subtle border border-transparent hover:border-border transition-colors p-1.5"
69+
:style="{ paddingBlock: groupItem.normalisingIndent }"
6070
:aria-label="groupItem.name"
6171
>
6272
<AboutLogoImg :src="groupItem.logo" :alt="groupItem.name" />
@@ -70,6 +80,7 @@ const props = defineProps<{
7080
fill="none"
7181
xmlns="http://www.w3.org/2000/svg"
7282
aria-hidden="true"
83+
class="h-full w-auto"
7384
>
7485
<path
7586
d="M5.04935 0H0C7.4734 10.6931 7.51725 27.2683 0 37.9997H5.04935C12.5648 27.2683 12.521 10.6931 5.04935 0Z"

app/pages/about.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ const roleLabels = computed(
156156
</h2>
157157
<AboutLogoList
158158
:list="SPONSORS"
159-
class="grid grid-cols-2 md:flex md:flex-row md:items-center"
159+
class="grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] gap-4"
160160
/>
161161
</div>
162162

@@ -165,7 +165,10 @@ const roleLabels = computed(
165165
<h2 class="text-lg text-fg uppercase tracking-wider mb-4">
166166
{{ $t('about.oss_partners.title') }}
167167
</h2>
168-
<AboutLogoList :list="OSS_PARTNERS" class="items-center" />
168+
<AboutLogoList
169+
:list="OSS_PARTNERS"
170+
class="grid grid-cols-[repeat(auto-fill,minmax(64px,1fr))] gap-4"
171+
/>
169172
</div>
170173

171174
<div>

0 commit comments

Comments
 (0)