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

Add banner slot #1497

Closed
brc-dd opened this issue Oct 17, 2022 · 3 comments
Closed

Add banner slot #1497

brc-dd opened this issue Oct 17, 2022 · 3 comments
Labels
enhancement New feature or request theme Related to the theme

Comments

@brc-dd
Copy link
Member

brc-dd commented Oct 17, 2022

similar to @vue/theme (and adjust styles to respect --vp-banner-height)

@brc-dd brc-dd added enhancement New feature or request theme Related to the theme labels Oct 17, 2022
@ylw5
Copy link
Contributor

ylw5 commented Oct 20, 2022

In @vue/theme, you should set style for banner like this
Banner.vue in vuejs/docs

<style>
html:not(.banner-dismissed) {
  --vt-banner-height: 60px;
}
</style>
<style scoped>
.banner {
  position: fixed;
  z-index: var(--vp-z-index-banner);
  box-sizing: border-box;
  top: 0;
  left: 0;
  right: 0;
  height: var(--vt-banner-height);
}

it's a little hard and inflexible for developer, if there is a better way to set banner that developer only focus banner's content

@kiaking
Copy link
Member

kiaking commented Oct 21, 2022

Hmmm... How about we change VPNav to have position: sticky and then just insert banner on top of nav. And I think it would adjust the height automatically?

<div>
  <Banner />
  <div class="main">
    <VPNav />
  </div>
</div>

@kiaking
Copy link
Member

kiaking commented Oct 21, 2022

No wait, forget about it, it wouldn't work... 😅

@brc-dd brc-dd closed this as completed Jan 29, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request theme Related to the theme
Projects
None yet
Development

No branches or pull requests

3 participants