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

fix: exclude style example blocks from banner styles #1103

wants to merge 1 commit into from

Conversation

Xenonym
Copy link
Contributor

@Xenonym Xenonym commented Jun 22, 2021

Description of Problem

If the Vue School banner is open, the style example blocks on the Style Guide will have too much top margin and padding. Detail blocks directly above a style example block will also be unexpandable.

firefox_2UwExWwJSt

This is because the styles in BannerTop.vue mistakenly apply top margin and padding to the header in style example blocks. This causes the blocks to be too tall, as well as oveflow their container, overlaying the detail block above and blocking clicks to the element.

firefox_UbeGD8WVp7

Proposed Solution

Let's fix the styles for headers in BannerTop.vue to exclude those in style example blocks.

If the Vue School banner is open, the style example blocks on the Style
Guide will have too much top margin and padding. Detail blocks directly
above a style example block will also be unexpandable.

This is because the styles in BannerTop.vue mistakenly apply top margin
and padding to the header in style example blocks. This causes the
blocks to be too tall, as well as oveflow their container, overlaying
the detail block above and blocking clicks to the <detail> element.

Let's fix the styles for headers in BannerTop.vue to exclude those in
style example blocks.
Copy link
Contributor

@skirtles-code skirtles-code left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

There's definitely a problem here. In addition to the Style Guide headings, the main heading on most pages is too close to the navbar.

@nicodevs Do you know what these styles are supposed to do? As far as I can tell everything looks better if these heading adjustments are just removed.

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

@skirtles-code
Copy link
Contributor

The headings in the Style Guide should be fixed now: #1108.

@Xenonym Xenonym deleted the fix/banner-top-style-example-headers branch July 3, 2021 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants