Skip to content

Commit

Permalink
style: 优化主页样式
Browse files Browse the repository at this point in the history
  • Loading branch information
mark9804 committed Apr 12, 2024
1 parent d6e132d commit 9fd1351
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 25 deletions.
2 changes: 2 additions & 0 deletions docs/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export {}

declare module 'vue' {
export interface GlobalComponents {
ASwitch: typeof import('@arco-design/web-vue')['Switch']
ATag: typeof import('@arco-design/web-vue')['Tag']
HomePage: typeof import('./src/components/HomePage.vue')['default']
ProfileCard: typeof import('./src/components/ProfileCard.vue')['default']
TableOfContent: typeof import('./src/components/TableOfContent.vue')['default']
Expand Down
18 changes: 5 additions & 13 deletions docs/src/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,15 @@ if (theme.value.userProfile) {
</script>

<template>
<div class="home-page flex p-[24px] gap-[48px]">
<ProfileCard :props="props"/>
<TableOfContents class="home-page__toc" />
<div class="home-page w-[100dvw] pl-[48px] pr-[48px] pt-[24px] flex flex-col items-center">
<div class="max-w-[1200px] flex gap-[48px] w-full">
<ProfileCard :props="props"/>
<TableOfContents class="home-page__toc" />
</div>
</div>
</template>

<style scoped lang="scss">
.home-page {
display: flex;
width: 100vw;
width: 100dvw;
&__toc {
flex: 1;
}
}
@media (max-width: 475px) {
.home-page {
flex-direction: row;
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/ProfileCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defineProps<{
</script>

<template>
<div class="flex flex-col items-center gap-[24px] p-[24px] rounded-lg shadow-std h-full">
<div class="flex flex-col items-center gap-[24px] p-[24px] rounded-lg shadow-std h-full w-fit min-w-[256px]">
<img
class="w-[100px] h-[100px] rounded-full"
:src="props.avatar"
Expand Down
13 changes: 2 additions & 11 deletions docs/src/components/TableOfContents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,11 @@ const useContents = computed(() =>
</script>

<template>
<ul class="toc">
<ul class="flex flex-col gap-[20px] w-full list-none p-0 m-0">
<li v-for="content in useContents" :key="content.url">
<table-of-content :content="content"></table-of-content>
</li>
</ul>
</template>

<style scoped lang="scss">
ul.toc {
list-style-type: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
gap: 1rem;
}
</style>
<style scoped lang="scss"></style>

0 comments on commit 9fd1351

Please sign in to comment.