Skip to content

fix: exclude style example blocks from banner styles #1103

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/.vuepress/theme/components/BannerTop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,15 @@ $topBannerHeightMobile ?= 3.125rem
// Adjust titles margin and padding for anchor links
.theme-container.has-top-banner
{$contentClass}:not(.custom)
h1, h2, h3, h4, h5, h6
margin-top (0.5rem - $topBannerHeight - $navbarHeight)
padding-top ($navbarHeight + $topBannerHeight + 1rem)
:not(.style-example)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this fix is quite correct. This change will also impact other headings because the h1, etc. are usually direct children of the .theme-default-content, so there's no element for the :not(.style-example) to match.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @skirtles-code, thanks for the description, I can confirm the issue. There's an upcoming banner copy update, so a new PR will be submitted today. I will address this issue there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skirtles-code here's the PR that updates the copy and solves this issue: #1108

h1, h2, h3, h4, h5, h6
margin-top (0.5rem - $topBannerHeight - $navbarHeight)
padding-top ($navbarHeight + $topBannerHeight + 1rem)
@media (min-width: 680px)
.theme-container.has-top-banner
{$contentClass}:not(.custom)
h1, h2, h3, h4, h5, h6
margin-top (0.5rem - $topBannerHeightMobile - $navbarHeight)
padding-top ($navbarHeight + $topBannerHeightMobile + 1rem)
:not(.style-example)
h1, h2, h3, h4, h5, h6
margin-top (0.5rem - $topBannerHeightMobile - $navbarHeight)
padding-top ($navbarHeight + $topBannerHeightMobile + 1rem)
</style>