Skip to content

Commit

Permalink
feat(theme)!: final re-brand (#2727)
Browse files Browse the repository at this point in the history
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
Co-authored-by: Lehoczky Zoltán <ifjlehoczkyzoltan@gmail.com>
  • Loading branch information
3 people committed Aug 8, 2023
1 parent 1d6254b commit c0d838b
Show file tree
Hide file tree
Showing 13 changed files with 234 additions and 123 deletions.
19 changes: 18 additions & 1 deletion docs/.vitepress/config.ts
Expand Up @@ -20,7 +20,22 @@ export default defineConfig({
},

head: [
['meta', { name: 'theme-color', content: '#3c8772' }],
['link', { rel: 'icon', href: '/vitepress-logo-mini.svg' }],
['meta', { name: 'theme-color', content: '#5f67ee' }],
['meta', { name: 'og:type', content: 'website' }],
['meta', { name: 'og:locale', content: 'en' }],
['meta', { name: 'og:site_name', content: 'VitePress' }],
[
'meta',
{ name: 'og:image', content: 'https://vitepress.dev/vitepress-og.jpg' }
],
[
'meta',
{
name: 'twitter:image',
content: 'https://vitepress.dev/vitepress-og.jpg'
}
],
[
'script',
{
Expand All @@ -33,6 +48,8 @@ export default defineConfig({
],

themeConfig: {
logo: { src: '/vitepress-logo-mini.svg', width: 24, height: 24 },

nav: nav(),

sidebar: {
Expand Down
24 changes: 24 additions & 0 deletions docs/index.md
Expand Up @@ -15,6 +15,9 @@ hero:
- theme: alt
text: View on GitHub
link: https://github.com/vuejs/vitepress
image:
src: /vitepress-logo-large.webp
alt: VitePress

features:
- icon: 📝
Expand All @@ -30,3 +33,24 @@ features:
title: Ship Fast Sites
details: Fast initial load with static HTML, fast post-load navigation with client-side routing.
---
<style>
:root {
--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: -webkit-linear-gradient(120deg, #bd34fe 30%, #41d1ff);

--vp-home-hero-image-background-image: linear-gradient(-45deg, #bd34fe 50%, #47caff 50%);
--vp-home-hero-image-filter: blur(40px);
}

@media (min-width: 640px) {
:root {
--vp-home-hero-image-filter: blur(56px);
}
}

@media (min-width: 960px) {
:root {
--vp-home-hero-image-filter: blur(72px);
}
}
</style>
Binary file added docs/public/vitepress-logo-large.webp
Binary file not shown.
1 change: 1 addition & 0 deletions docs/public/vitepress-logo-mini.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/vitepress-og.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 22 additions & 12 deletions src/client/theme-default/components/VPBadge.vue
Expand Up @@ -16,26 +16,36 @@ defineProps<{
display: inline-block;
margin-left: 2px;
border: 1px solid transparent;
border-radius: 10px;
padding: 0 8px;
line-height: 18px;
border-radius: 12px;
padding: 0 10px;
line-height: 22px;
font-size: 12px;
font-weight: 600;
transform: translateY(-2px);
}
h1 .VPBadge,
h2 .VPBadge,
h3 .VPBadge,
h4 .VPBadge,
h5 .VPBadge,
h6 .VPBadge {
vertical-align: text-top;
.vp-doc h1 > .VPBadge {
margin-top: 4px;
vertical-align: top;
}
h2 .VPBadge {
border-radius: 11px;
.vp-doc h2 > .VPBadge {
margin-top: 3px;
line-height: 20px;
padding: 0 8px;
vertical-align: top;
}
.vp-doc h3 > .VPBadge {
line-height: 20px;
vertical-align: middle;
}
.vp-doc h4 > .VPBadge,
.vp-doc h5 > .VPBadge,
.vp-doc h6 > .VPBadge {
vertical-align: middle;
line-height: 18px;
}
.VPBadge.info {
Expand Down
17 changes: 9 additions & 8 deletions src/client/theme-default/components/VPDocOutlineDropdown.vue
Expand Up @@ -36,19 +36,20 @@ onContentUpdated(() => {

<style scoped>
.VPDocOutlineDropdown {
margin-bottom: 42px;
margin-bottom: 48px;
}
.VPDocOutlineDropdown button {
display: block;
font-size: 14px;
font-weight: 500;
line-height: 24px;
color: var(--vp-c-text-2);
transition: color 0.5s;
border: 1px solid var(--vp-c-border);
padding: 4px 12px;
color: var(--vp-c-text-2);
background-color: var(--vp-c-mute);
border-radius: 8px;
transition: color 0.5s;
}
.VPDocOutlineDropdown button:hover {
Expand All @@ -63,22 +64,22 @@ onContentUpdated(() => {
.icon {
display: inline-block;
vertical-align: middle;
margin-left: 2px;
width: 14px;
height: 14px;
width: 16px;
height: 16px;
fill: currentColor;
}
:deep(.outline-link) {
font-size: 13px;
font-size: 14px;
font-weight: 400;
}
.open > .icon {
transform: rotate(90deg);
}
.items {
margin-top: 10px;
margin-top: 12px;
border-left: 1px solid var(--vp-c-divider);
}
</style>
4 changes: 2 additions & 2 deletions src/client/theme-default/components/VPDocOutlineItem.vue
Expand Up @@ -31,7 +31,7 @@ function onClick({ target: el }: Event) {
}
.nested {
padding-left: 13px;
padding-left: 16px;
}
.outline-link {
Expand All @@ -42,7 +42,7 @@ function onClick({ target: el }: Event) {
overflow: hidden;
text-overflow: ellipsis;
transition: color 0.5s;
font-weight: 500;
font-weight: 400;
}
.outline-link:hover,
Expand Down
42 changes: 28 additions & 14 deletions src/client/theme-default/components/VPLocalNavOutlineDropdown.vue
Expand Up @@ -58,10 +58,14 @@ function scrollToTop() {
class="items"
@click="onItemClick"
>
<a class="top-link" href="#" @click="scrollToTop">
{{ theme.returnToTopLabel || 'Return to top' }}
</a>
<VPDocOutlineItem :headers="headers" />
<div class="header">
<a class="top-link" href="#" @click="scrollToTop">
{{ theme.returnToTopLabel || 'Return to top' }}
</a>
</div>
<div class="outline">
<VPDocOutlineItem :headers="headers" />
</div>
</div>
</Transition>
</div>
Expand All @@ -71,6 +75,7 @@ function scrollToTop() {
.VPLocalNavOutlineDropdown {
padding: 12px 20px 11px;
}
.VPLocalNavOutlineDropdown button {
display: block;
font-size: 12px;
Expand Down Expand Up @@ -110,26 +115,35 @@ function scrollToTop() {
.items {
position: absolute;
left: 20px;
right: 20px;
top: 64px;
background-color: var(--vp-local-nav-bg-color);
padding: 4px 10px 16px;
border: 1px solid var(--vp-c-divider);
right: 16px;
left: 16px;
display: grid;
gap: 1px;
border: 1px solid var(--vp-c-border);
border-radius: 8px;
background-color: var(--vp-c-gutter);
max-height: calc(var(--vp-vh, 100vh) - 86px);
overflow: hidden auto;
box-shadow: var(--vp-shadow-3);
}
.header {
background-color: var(--vp-c-bg-soft);
}
.top-link {
display: block;
color: var(--vp-c-brand);
font-size: 13px;
padding: 0 16px;
line-height: 48px;
font-size: 14px;
font-weight: 500;
padding: 6px 0;
margin: 0 13px 10px;
border-bottom: 1px solid var(--vp-c-divider);
color: var(--vp-c-brand);
}
.outline {
padding: 8px 0;
background-color: var(--vp-c-bg-soft);
}
.flyout-enter-active {
Expand Down
5 changes: 4 additions & 1 deletion src/client/theme-default/styles/components/custom-block.css
Expand Up @@ -84,10 +84,13 @@
.custom-block a {
color: inherit;
font-weight: 600;
text-decoration: underline dotted;
text-underline-offset: 2px;
transition: opacity 0.25s;
}

.custom-block a:hover {
text-decoration: underline;
opacity: 0.75;
}

.custom-block code {
Expand Down
15 changes: 2 additions & 13 deletions src/client/theme-default/styles/components/vp-doc.css
Expand Up @@ -109,13 +109,11 @@
.vp-doc a {
font-weight: 500;
color: var(--vp-c-brand);
text-decoration-style: dotted;
transition: color 0.25s;
}

.vp-doc a:hover {
/* color: var(--vp-c-brand-dark); */
text-decoration: underline;
text-decoration: underline dotted;
text-underline-offset: 2px;
}

.vp-doc strong {
Expand Down Expand Up @@ -219,10 +217,6 @@
font-weight: 600;
}

.vp-doc .custom-block a:hover {
text-decoration: underline;
}

.vp-doc .custom-block code {
font-size: var(--vp-custom-block-code-font-size);
font-weight: 700;
Expand Down Expand Up @@ -271,11 +265,6 @@

.vp-doc a > code {
color: var(--vp-c-brand);
transition: color 0.25s;
}

.vp-doc a:hover > code {
color: var(--vp-c-brand-dark);
}

.vp-doc div[class*='language-'],
Expand Down

0 comments on commit c0d838b

Please sign in to comment.