Skip to content

Commit 7168e19

Browse files
bdrtskyatinux
andauthored
fix: icons positioning (#722)
* fix: move icons from header to footer; some cleanup * cleanup * update positioning after feedback * add TODO comment back * Update pnpm-lock.yaml Co-authored-by: Sébastien Chopin <[email protected]>
1 parent cbd21b9 commit 7168e19

File tree

11 files changed

+157
-467
lines changed

11 files changed

+157
-467
lines changed

components/app/AppFooter.vue

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,30 @@ const nbSocialIcons = computed(() => (socialIcons.value ? socialIconsCount.value
1515
<p>{{ docus.footer.credits.text }}</p>
1616
</a>
1717

18-
<!-- Right -->
19-
<div class="right">
20-
<a
21-
v-for="icon in icons.slice(0, 6 - nbSocialIcons)"
22-
:key="icon.label"
23-
rel="noopener"
24-
:aria-label="icon.label"
25-
:href="icon.href"
26-
target="_blank"
27-
>
18+
<!-- Center -->
19+
<div class="center">
20+
<a v-for="icon in icons.slice(0, 6 - nbSocialIcons)" :key="icon.label" rel="noopener" :aria-label="icon.label"
21+
:href="icon.href" target="_blank">
2822
<Icon :name="icon.icon || icon.component" />
2923
</a>
3024
<AppSocialIcons ref="socialIcons" />
3125
</div>
26+
3227
</Container>
3328
</footer>
3429
</template>
3530

3631
<style lang="ts" scoped>
3732
css({
3833
footer: {
39-
height: '{docus.footer.height}',
40-
display: 'flex',
41-
alignItems: 'center',
4234
borderTopWidth: '1px',
4335
borderTopStyle: 'solid',
4436
borderTopColor: '{color.gray.100}',
37+
padding: '{docus.footer.padding}',
38+
39+
'@dark': {
40+
borderTopColor: '{color.gray.900}'
41+
},
4542
4643
':deep(.icon)': {
4744
width: '{space.4}',
@@ -61,40 +58,52 @@ css({
6158
},
6259
},
6360
64-
'@dark': {
65-
borderTopColor: '{color.gray.900}'
66-
},
67-
6861
'.left': {
6962
display: 'flex',
7063
alignItems: 'center',
71-
7264
p: {
7365
fontSize: '{fontSize.xs}',
7466
fontWeight: '{fontWeight.bold}'
7567
},
76-
7768
'&-icon': {
7869
width: '{space.4}',
7970
fill: 'currentcolor',
8071
marginRight: '{space.2}',
8172
}
8273
},
8374
84-
'.right': {
75+
'.center': {
8576
display: 'flex',
8677
alignItems: 'center',
8778
gap: '{space.4}'
8879
},
8980
9081
'.footer-container': {
91-
display: 'flex',
92-
flexDirection: 'col',
93-
alignItems: 'center',
94-
height: '100%',
95-
gap: '{space.4}',
96-
flexDirection: 'row',
97-
justifyContent: 'space-between',
82+
display: 'grid',
83+
gridTemplateColumns: 'repeat(12, minmax(0, 1fr))',
84+
justifyItems: 'center',
85+
gap: '{space.2}',
86+
'@sm': {
87+
justifyItems: 'legacy',
88+
89+
},
90+
'.left': {
91+
gridColumn: 'span 12 / span 12',
92+
'@sm': {
93+
gridColumn: 'span 4 / span 4'
94+
}
95+
},
96+
'.center': {
97+
display: 'flex',
98+
justifyContent: 'center',
99+
gridColumn: 'span 12 / span 12',
100+
'@sm': {
101+
gridColumn: 'span 4 / span 4'
102+
},
103+
a: {
104+
display: 'flex'
105+
}
106+
},
98107
}
99108
}
100109
})

components/app/AppHeader.vue

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,23 @@ const hasDialog = computed(() => navigation.value?.length > 1)
77
<template>
88
<header :class="{ 'has-dialog': hasDialog, 'has-doc-search': hasDocSearch }">
99
<Container>
10-
<section class="left">
10+
<div class="section left">
1111
<AppHeaderDialog v-if="hasDialog" />
1212
<AppHeaderLogo />
13-
</section>
13+
</div>
1414

15-
<section class="center">
15+
<div class="section center">
1616
<AppHeaderLogo v-if="hasDialog" />
1717
<AppHeaderNavigation />
18-
</section>
18+
</div>
1919

20-
<section class="right">
21-
<AppSearch v-if="hasDocSearch" />
20+
<div class="section right">
21+
<AppSearch v-if="hasDocSearch"/>
2222
<ThemeSelect />
23-
<AppSocialIcons />
24-
</section>
23+
<div class="social-icons">
24+
<AppSocialIcons />
25+
</div>
26+
</div>
2527
</Container>
2628
</header>
2729
</template>
@@ -71,7 +73,7 @@ css({
7173
gap: '2rem'
7274
},
7375
74-
section: {
76+
'.section': {
7577
display: 'flex',
7678
alignItems: 'center',
7779
flex: 'none',
@@ -90,6 +92,14 @@ css({
9092
alignItems: 'center',
9193
flex: 'none',
9294
gap: '{space.4}',
95+
'.social-icons': {
96+
display: 'none',
97+
'@md': {
98+
display: 'flex',
99+
alignItems: 'center',
100+
gap: '{space.4}'
101+
}
102+
}
93103
}
94104
}
95105
}

components/app/AppHeaderDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ watch(visible, v => (v ? open() : close()))
3333
</button>
3434

3535
<div class="icons">
36-
<AppSocialIcons />
3736
<ThemeSelect />
37+
<AppSocialIcons />
3838
</div>
3939
</div>
4040

components/app/AppHeaderNavigation.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const isActive = (link: any) => (link.exact ? route.fullPath === link._path : ro
1919
</script>
2020

2121
<template>
22-
<nav>
22+
<nav v-if="hasNavigation">
2323
<ul>
2424
<li
2525
v-for="link in tree"

components/app/AppSearch.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ css({
3232
borderRadius: '{radii.md}',
3333
display: 'flex',
3434
alignItems: 'center',
35-
fontSize: '{fontSize.sm}',
3635
color: '{color.gray.500}',
3736
borderStyle: 'solid',
3837
borderWidth: '1px',
@@ -55,20 +54,16 @@ css({
5554
},
5655
span: {
5756
'&:first-child': {
58-
// hidden text-xs font-medium lg:block
59-
display: 'none',
57+
display: 'block',
6058
fontSize: '{fontSize.xs}',
6159
fontWeight: '{fontWeight.medium}',
62-
'@lg': {
63-
display: 'block'
64-
}
6560
},
6661
'&:nth-child(2)': {
6762
flex: 'none',
6863
display: 'none',
6964
fontSize: '{fontSize.xs}',
7065
fontWeight: '{fontWeight.semibold}',
71-
'@lg': {
66+
'@sm': {
7267
display: 'block'
7368
}
7469
}

components/app/AppSocialIcons.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const icons = computed<any>(() => {
3939
<style lang="ts" scoped>
4040
css({
4141
a: {
42+
display: 'flex',
4243
color: '{color.gray.500}',
4344
4445
'@dark': {

components/app/ThemeSelect.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const onClick = () => {
2222
<style lang="ts" scoped>
2323
css({
2424
button: {
25-
display: 'inline-block',
25+
display: 'flex',
2626
2727
color: '{color.gray.500}',
2828
'@dark': {

components/docs/DocsPageContent.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ css({
110110
'.docs-page-content': {
111111
position: 'relative',
112112
display: 'flex',
113-
flexDirection: 'column-reverse',
114-
minHeight: '{docus.page.height}',
113+
flexDirection: 'column',
115114
'@lg': {
116115
display: 'grid',
117116
gap: '{space.8}',
@@ -210,7 +209,6 @@ css({
210209
mx: 'calc(0px - {space.6})',
211210
},
212211
'@lg': {
213-
maxHeight: '{docus.page.height}',
214212
gridColumn: 'span 2 / span 2',
215213
mx: 0,
216214
alignSelf: 'flex-start',

layouts/page.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ css({
1717
'.page-layout': {
1818
display: 'flex',
1919
flexDirection: 'column',
20-
minHeight: '{docus.page.height}',
2120
position: 'relative'
2221
}
2322
})

0 commit comments

Comments
 (0)