Coder Social home page Coder Social logo

Comments (4)

reuixiy avatar reuixiy commented on August 21, 2024 1

Yes you can customize it by yourself, simply adding

.header {
    position: relative;
}

.main {
    padding-top: 3em;
}

to your ~/blog/assets/scss/custom/_custom.scss file.

See https://github.com/reuixiy/hugo-theme-meme#customize-meme

from hugo-theme-meme.

reuixiy avatar reuixiy commented on August 21, 2024

I have reproduced this in my Chrome browser.

But it shouldn't happen, the latest fix for #158 is

/* Scrolling fix for anchors being hidden below the header */
*[id] {
scroll-margin-top: var(--header-height);
}

Using scroll-margin-top for all HTML elements have id attribute to fix the problem. As shown in the screenshot below, the <mjx-mtd> element also has id attribute, but this CSS rule doesn't apply!

Arc 2023-07-21 at 09 21 12@2x

Then I tested this in my Safari browser and it works normally. So I think this is a upstream browser bug which caused scroll-margin-top doesn't apply to custom HTML elements.

from hugo-theme-meme.

searene avatar searene commented on August 21, 2024

@reuixiy Thanks for the reply! I actually ran the webpage in Edge, and it didn't work either. Maybe it's because Edge and Chrome are the same at the core. Considering that most upstream browsers usually take a long time to fix a bug, I don't expect this bug to be fixed by them soon. So maybe we can find a way to work around the problem in the meantime. For example, can we give the user an option to stop fixing the header at the top? It could be like the header in Hacker News, the header won't move along when the user scrolls up or down. It's just like other parts of the webpage, when the user scrolls away, it disappears. It has two advantages:

  1. The header won't block the text anymore, because it's always appearing above any contents.
  2. It can be taken as another style of the website, giving the user another option, even if the user is not bothered by the current issue.

Please kindly consider this suggestion :)

from hugo-theme-meme.

searene avatar searene commented on August 21, 2024

@reuixiy I just tried it, and it worked! Thanks for the solution!

from hugo-theme-meme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.