FMCorz
9/22/2015 - 7:18 AM

Mixin to fix the anchors when a fixed header is causing an offset

Mixin to fix the anchors when a fixed header is causing an offset

.anchor-offset-setup(@offset) {
    h2[id]::before,
    h3[id]::before,
    h4[id]::before,
    h5[id]::before,
    h6[id]::before {
        display: block;
        content: "";
        padding-top: (@offset + 10);
        margin-top: -(@offset + 10);
    }
    a[name]:empty,
    a[id]:empty {
        display: inline-block;
        content: "";
        padding-top: (@offset);
        margin-top: -(@offset);
    }
}