Comments (7)
🎉 This issue has been resolved in version 1.49.0-alpha.1 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀
from newspack-theme.
Ah, thanks @AktharAzif -- I'll have to explore that :)
It looks like https://thewiretap.in/ is a private site, so unfortunately I can't check that one out.
from newspack-theme.
We've had another request for this functionality from @AkkiVerma in #621:
Is your feature request related to a problem? Please describe.
Sometimes the blog posts are quite long and since AMP doesn't have JUMP to TOP button, it can be sometimes very frustrating scrolling back to the top.Describe the solution you'd like
I've checked code and the amount of CSS required for adding just JUMP to TOP button, hence rather I think it is better to provide an option for enabling sticky header on both desktop and mobile so that it becomes easier for users to navigate to other pages.Describe alternatives you've considered
There is none so far.Additional context
I am hoping if sticky header can also have a search button along with the menu button when on mobile.
from newspack-theme.
@laurelfulford and if it it was 'smart sticky', like https://www.saibatudomt.com.br/
As Newspack uses AMP, this can be achieved by add amp-fx="float-in-top"
to container, and style container with required css
position: fixed;
top: 0;
overflow: hidden;
<header id="page-header" amp-fx="float-in-top">
<div on="tap:header-sidebar.toggle" role="button" tabindex="0" class="navbar-trigger" title="Exibir o Menu" aria-label="Menu">
<amp-img width="24px" height="24px" layout="fixed" src="https://www.saibatudomt.com.br/wp-content/themes/saibatudo2019/img/twotone-menu-24px.svg" alt="" class="i-amphtml-layout-fixed i-amphtml-layout-size-defined" style="width:24px;height:24px;" i-amphtml-layout="fixed">
</amp-img></div>
<div class="logo">
<a href="/" data-rel="prefetch">
<amp-img width="124px" height="48px" layout="fixed" src="https://www.saibatudomt.com.br/wp-content/themes/saibatudo2019/img/SaibaTudoMT.svg" alt="SaibaTudoMT" class="i-amphtml-layout-fixed i-amphtml-layout-size-defined" style="width:124px;height:48px;" i-amphtml-layout="fixed">
</amp-img></a>
</div>
<div on="tap:search-sidebar.toggle" role="button" tabindex="0" class="navbar-trigger">
<amp-img width="24px" height="24px" layout="fixed" src="https://www.saibatudomt.com.br/wp-content/themes/saibatudo2019/img/twotone-search-24px.svg" alt="Busca" class="i-amphtml-layout-fixed i-amphtml-layout-size-defined" style="width:24px;height:24px;" i-amphtml-layout="fixed">
</amp-img></div>
</header>
When setting position: fixed; top: 0;
to .site-header
we'll need some extra css to fix header's layout:
So if there's no one working on this, I can take it! Let me know.
from newspack-theme.
Apologies! I ended up creating a second issue for this, which is just splitting the information (#826).
We do still plan on adding this -- thanks for your exploration @eduardogoncalves! One issue I ran into with float-in-top
is the required overflow: hidden
-- it means that menus with dropdowns ends up getting cut off. So we'll probably need to figure out a way to fit that in with the other header settings that we offer.
I copied over some other details from #826 from myself and @thomasguillot, and will close the newer issue:
The main potential issue is height: the header's height, in part, depends on the size of the logo, so it can be variable. We will need to 'know' the height to set a proper sticky menu. This is usually done with JavaScript, but using AMP limits what's available there. So this will need digging into -- it may be possible to use the same scroll-position logic that's used in the popups, or we could set a fixed height for the headers with this setting -- overriding the custom logo size -- to ensure they're a consistent height.
I would do this because:
- We don't have to worry about JS. It can be done with CSS-only.
- We avoid bad practice if a site has a massive fixed header that takes 50% of the screen height.
I'd hoped to use AMP's float-in-top effect for this (which has the header scroll away with the page, but appear again when you scroll back up), but it requires you to have
overflow: hidden
on the element, which means, for the header, that the menu dropdowns get cut off.
from newspack-theme.
Another request came in today from a publisher for this feature.
from newspack-theme.
🎉 This issue has been resolved in version 1.49.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀
from newspack-theme.
Related Issues (20)
- Block styles: Add is-layout-flex and is-layout-flow classes HOT 2
- Author Bio: Add user website HOT 2
- Print styles: Audit to review campaign/ad positions and make sure they're hidden HOT 7
- Display Tagline: Site sometimes does not respect setting in Customizer HOT 2
- Print styles: sticky headers and two column templates HOT 2
- Search Block: Display errors in WP 6.1 beta 3 HOT 5
- Pullquote Block: Font size larger in 6.1 HOT 2
- Simplified subpage header: add option to move hamburger menu
- ARIA IDs are not unique HOT 3
- Group block: Contents don't preview centred in editor when block is full-width HOT 2
- Add support for alternative Google Font source in the Typography panel
- Newspack Listings: Add option to set a default template HOT 1
- Buttons do not have an accessible name HOT 1
- ARIA IDs are not unique HOT 1
- Post not loading properly on mobile and desktop - poss AMP issue HOT 9
- Please Add Post View Count Feature in the Theme HOT 1
- AMP Issue when trying to validate AMP Settings HOT 1
- Hide Category Description HOT 1
- Use correct icon for Google news
- Subcategory showing as XML. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from newspack-theme.