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

header.hbs renders above the top of the HTML document, out of view #1331

Open
redlet opened this issue Sep 17, 2020 · 6 comments
Open

header.hbs renders above the top of the HTML document, out of view #1331

redlet opened this issue Sep 17, 2020 · 6 comments
Labels
A-Style Area: Style (CSS, etc.) Regression Regression from a previous version

Comments

@redlet
Copy link

redlet commented Sep 17, 2020

When using header.hbs in 0.3.5, my book is perfectly formatted. After updating to 0.4.2 (latest on the AUR at the present time), I get a blank placeholder and the actual header renders above the top of the page.

@ehuss
Copy link
Contributor

ehuss commented Sep 22, 2020

This seems to be an unfortunate regression due to #989 (cc @WofWca). The "page" div is positioned above the top of the window. I don't know why it was done that way, it seems like it would be best to try to avoid that.

@ehuss ehuss added the A-Style Area: Style (CSS, etc.) label Sep 22, 2020
@WofWca
Copy link
Contributor

WofWca commented Sep 29, 2020

Crap.
Sorry, will try to check this out within two weeks.

@WofWca
Copy link
Contributor

WofWca commented Oct 11, 2020

I'm thinking if we should actually keep the header slot above the menu. To me this looks pretty ugly. I'd prefer it below the menu and above the title. Making it so would also fix this issue.

Some links:

@tjkirch
Copy link

tjkirch commented Dec 15, 2020

I'd prefer the header where it is now, at the top; perhaps there could be a new setting for people who prefer it below the menu, rather than changing behavior?

@ehuss ehuss added the Regression Regression from a previous version label May 24, 2021
@ehuss
Copy link
Contributor

ehuss commented Jul 4, 2021

Just jotting down some notes about this...

I think it will be quite difficult to support variable-sized elements above the menu bar. I think the size needs to be encoded in CSS. This really could use a web expert to see if that is possible. Otherwise I think the best solution is to just move the {{> header}} below the menu bar.

In general, the auto-hiding menu bar can be a little cantankerous. For example, on Firefox it gives this warning:

This site appears to use a scroll-linked positioning effect. This may not work well with asynchronous panning; see https://developer.mozilla.org/docs/Mozilla/Performance/ScrollLinkedEffects for further details and to join the discussion on related tools and features! index.html

​I really like the auto-hide behavior, and it seems to work pretty well in my testing. I do notice some stuttering while scrolling sometimes, but I'm uncertain if it is related to this.

I did run across the Fucshia docs at https://fuchsia.dev/fuchsia-src/contribute/docs/documentation-navigation-toc which seem to handle this pretty well, too, and that doesn't generate warnings. It has content above the menu bar, but it is a fixed, known size.

@Pfeil
Copy link

Pfeil commented Aug 21, 2021

First of all: I am by no means a web dev. But what I just did was customizing the index.hbs and switch the following lines like this:

<div id="menu-bar-hover-placeholder" class="click-transparent"></div>
{{> header}}

Also, I had some link element (a small logo) in the header which was not fully clickable because of the placeholders z-index. The solution was this css class (you can also see it added in the snippet above):

/* Workaround to make the logo header clickable. */
.click-transparent {
    pointer-events: none;
}

It was the only solution I found not to destroy the scrolling behaviour (at least it seems to work for now). But if the headers height is smaller than the placeholder, there will be a certain gap due to the placeholder... holding the place :D.

A bit off-topic but somehow related:
I only add the header on mobile devices (css hides it otherwise), as the logo is "usual" (on desktop) on the right side of the heading near the print button. If I had a (additional-)right-buttons.hbs I could do everything I need without overwriting the index.hbs, which would be nice. Is this (and the same for the left buttons I guess) something you would consider too much/complex or could this be a thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Style Area: Style (CSS, etc.) Regression Regression from a previous version
Projects
None yet
Development

No branches or pull requests

5 participants