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

Offset anchors #3818

Open
cristian-ungureanu opened this issue Feb 9, 2023 · 1 comment
Open

Offset anchors #3818

cristian-ungureanu opened this issue Feb 9, 2023 · 1 comment
Labels
enhancement Request to improve or optimize an existing feature or functionality in the project

Comments

@cristian-ungureanu
Copy link
Contributor

Description:

A user from Neve's Facebook group is using a stick to top header. When having a stick to top header, whenever you use an anchor, the anchor will go under the header, and it will not be visible. I was able to provide a solution for our user and here's what I wrote:

Ah, I understand what you mean now. I'm not sure we can provide a solution for the theme. I will open an issue on GitHub to discuss the matter with my colleagues. Until then, here's a custom solution that you can implement by yourself.
So let's say you have a title where the anchor goes to. Whenever you add your anchor, add a class also. Let's say we name our class 'offsetanchor'. You also need to add the following code to Customizer:

.offsetanchor::before{
content: '';
display: block;
height: 230px;
margin-top: -230px;
visibility: hidden;
}

Modify '230px' for height and margin-top with the offset you need. The margin-top is negative. Here's a video of how this would work: https://vertis.d.pr/v/CEPKvt
I hope it helps!

I'm not sure if we can have a better solution inside the theme.

Alternatives:

We can write a documentation about offset anchors.

@cristian-ungureanu cristian-ungureanu added the enhancement Request to improve or optimize an existing feature or functionality in the project label Feb 9, 2023
@rodica-andronache
Copy link
Contributor

From what I've seen in tickets, there were a few people contacting us about this, and it was not easy to provide solutions for them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request to improve or optimize an existing feature or functionality in the project
Projects
None yet
Development

No branches or pull requests

2 participants