Giter Site home page Giter Site logo

Comments (4)

toshimaru avatar toshimaru commented on May 28, 2024

I'm not going to support that feature.

Please fix the issue with CSS. This is a sample:

image

ref. https://railsdoc.github.io/#label-Welcome+to+Rails

from jekyll-toc.

cmann1 avatar cmann1 commented on May 28, 2024

This isn't always a viable option.
You need to approximate the height of your sticky header, so you can manually set the height and margin for the :before pseudo element, which in my opinion doesn't seem ideal.
Another option is to using padding and a negative margin on the header itself.

Problem is both these solutions can clash with existing css/markup, as they do in my case.
And for some reason, I haven't been able to get this to work with pseudo elements, even if I copy straight from the sample you posted.

from jekyll-toc.

cmann1 avatar cmann1 commented on May 28, 2024

So eventually found why :before isn't working: https://stackoverflow.com/a/17303334/153844
See the second comment for that answer. This technique doesn't work if the header has padding or border, which is kind of problematic.

I mean you could work around this with extra markup, but if I have to add mark up I'd rather just use the more straight forward way of using an anchor, instead adding other necessary elements to fix browser quirks.

from jekyll-toc.

cmann1 avatar cmann1 commented on May 28, 2024

Thinking about it, another option might be instead a config value to provide your own selector for which elements are used to build the ToC.
eg. I could set the option to h1.anchor > a if I wanted to add my own a tags inside of headers to be used as anchors.

from jekyll-toc.

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.