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

Feature/variable header height #286

Merged

Conversation

hoetmaaiers
Copy link
Collaborator

I tried adding a variable to define the header height. This will solve this issue: #258.

In theme.css a new variable is available: --header-height which for the Pandas theme is 60px.

@hoetmaaiers
Copy link
Collaborator Author

hoetmaaiers commented Nov 24, 2020

I already noticed that the anchor margin on the top is added on activation. I should look into this.

UPDATE:
This behaviour is also present without this PR. The variable height makes it more noticeable I think. On the latest build the 'white space' on top of a target is extend on click, e.g. https://548-130237506-gh.circle-artifacts.com/0/html/demo/markdown.html#second-top-level

I think we should revert the :target selector ?

@hoetmaaiers hoetmaaiers marked this pull request as draft November 30, 2020 06:13
@hoetmaaiers
Copy link
Collaborator Author

Any feedback on this @jorisvandenbossche or @choldgraf ?

@hoetmaaiers
Copy link
Collaborator Author

The silence here is getting somewhat uncomfortable. Is even

Everything okay with @jorisvandenbossche ? Are you aware of something @choldgraf ?

@jorisvandenbossche
Copy link
Member

Yes, everything allright! (except for the usual "too many github notifications" .. ). Sorry about the silence, taking a look now.

@jorisvandenbossche
Copy link
Member

I already noticed that the anchor margin on the top is added on activation. I should look into this.

It seems this is because the variable substitution in margin: -(var(--header-height)) 0 0; is not working correctly? This seems to produce invalid css, and if I replace the -(var(--header-height)) with a hardcoded -60px in firefox dev tools, it seems to look better.

@jorisvandenbossche
Copy link
Member

Something like calc(var(--header-height) * -1) might do the trick

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Looks good to me, and based on a quick experimentation with the preview, it all looks good (except for the one issue being discussed). Thanks!

Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
@hoetmaaiers hoetmaaiers force-pushed the feature/variable-header-height branch from 79bdce6 to 8f6f792 Compare January 12, 2021 09:25
@hoetmaaiers hoetmaaiers marked this pull request as ready for review January 12, 2021 10:10
@hoetmaaiers
Copy link
Collaborator Author

I think indeed @jorisvandenbossche your suggestion solved the issue.

@jorisvandenbossche
Copy link
Member

OK, this should be good to go then. Also checked locally that setting the CSS variable to a higher value works nicely.

Thanks @hoetmaaiers !

@jorisvandenbossche jorisvandenbossche merged commit 7d14f11 into pydata:master Jan 19, 2021
@hoetmaaiers
Copy link
Collaborator Author

Hooray

@jorisvandenbossche
Copy link
Member

@hoetmaaiers I noticed one bug that seems to be caused by this (at least from quickly checking the preview docs from readthedocs, it seems to have started here), which is that the mobile dropdown doesn't work anymore -> #304, in case you have a quick thought about what the issue could be

height: var(--header-height);
width: 100%;
padding: 0;
overflow: hidden;
Copy link
Member

Choose a reason for hiding this comment

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

I suppose it's caused by this hidden overflow. @hoetmaaiers do you remember why this was added?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can't directly remember why this was added. But the mobile dropdown is blamed by it? Is an other issue already registered for this?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, see #304 for the issue, and #313 for a potential fix.

Also other dropdowns in the navbar (in non-mobile mode) are not working because of this.

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.

2 participants