Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(theme): add --vp-layout-top-height to adjust banner #1521

Merged
merged 8 commits into from
Oct 24, 2022
Merged

feat(theme): add --vp-layout-top-height to adjust banner #1521

merged 8 commits into from
Oct 24, 2022

Conversation

ylw5
Copy link
Contributor

@ylw5 ylw5 commented Oct 21, 2022

#1497 (comment)
Add Banner to layout-top slot similar to @vue/theme.

// .vitepress/theme/index.ts

export default {
  ...DefaultTheme,
  Layout() {
    return h(DefaultTheme.Layout, null, {
      'layout-top': () => h(Banner)
    })
  }
}
// Banner.vue

<template>
  <div class="banner">
    banner
  </div>
</template>

<style>
html{
  --vp-layout-top-height: 30px;
}
</style>

<style scoped>
.banner {
  position: fixed;
  z-index:var(--vp-z-index-layout-top);
  top: 0;
  left: 0;
  right: 0;
  height: var(--vp-layout-top-height);
  background: -webkit-linear-gradient(315deg, #96c93c 25%, #03b19a);
}
</style>

@ylw5
Copy link
Contributor Author

ylw5 commented Oct 21, 2022

#1497

@ylw5 ylw5 changed the title feat: add --vt-layout-top-height to adjust banner feat(theme): add --vt-layout-top-height to adjust banner Oct 21, 2022
@brc-dd
Copy link
Member

brc-dd commented Oct 21, 2022

Make it --vp- instead of --vt-.

@brc-dd brc-dd merged commit a29a4a6 into vuejs:main Oct 24, 2022
@brc-dd
Copy link
Member

brc-dd commented Oct 24, 2022

Thanks! 🎉

@ylw5
Copy link
Contributor Author

ylw5 commented Oct 25, 2022

Thanks for your review!

@ylw5 ylw5 changed the title feat(theme): add --vt-layout-top-height to adjust banner feat(theme): add --vp-layout-top-height to adjust banner Oct 25, 2022
@vedxp
Copy link

vedxp commented Oct 26, 2022

Thanks for your review!

Would it be documented any soon, sir?

@ylw5
Copy link
Contributor Author

ylw5 commented Oct 26, 2022

Would it be documented any soon, sir?

I don't know if it is necessary to add description of layout-top to document.

@ylw5 ylw5 deleted the patch-1 branch October 26, 2022 11:03
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants