-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(theme): auto style markdown content in home page (#3561)
BREAKING CHANGES: styles are now applied by default to markdown content when `layout: home` is set in frontmatter. If they conflict with the styles of your custom component, please set `markdownStyles: false` in frontmatter. --------- Co-authored-by: Divyansh Singh <[email protected]>
- Loading branch information
Showing
7 changed files
with
129 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<script setup lang="ts"> | ||
import { useWindowSize } from '@vueuse/core' | ||
const { width: vw } = useWindowSize({ includeScrollbar: false }) | ||
</script> | ||
|
||
<template> | ||
<div | ||
class="vp-doc container" | ||
:style="vw ? { '--vp-offset': `calc(50% - ${vw / 2}px)` } : {}" | ||
> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.container { | ||
margin: auto; | ||
width: 100%; | ||
max-width: 1280px; | ||
padding: 0 24px; | ||
} | ||
@media (min-width: 640px) { | ||
.container { | ||
padding: 0 48px; | ||
} | ||
} | ||
@media (min-width: 960px) { | ||
.container { | ||
width: 100%; | ||
padding: 0 64px; | ||
} | ||
} | ||
.vp-doc :deep(.VPHomeSponsors), | ||
.vp-doc :deep(.VPTeamPage) { | ||
margin-left: var(--vp-offset, calc(50% - 50vw)); | ||
margin-right: var(--vp-offset, calc(50% - 50vw)); | ||
} | ||
.vp-doc :deep(.VPHomeSponsors h2) { | ||
border-top: none; | ||
letter-spacing: normal; | ||
} | ||
.vp-doc :deep(.VPHomeSponsors a), | ||
.vp-doc :deep(.VPTeamPage a){ | ||
text-decoration: none; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters