Skip to content

Instantly share code, notes, and snippets.

@FMCorz
Created September 22, 2015 07:18
Show Gist options
  • Save FMCorz/2255f94dbea30aa49f16 to your computer and use it in GitHub Desktop.
Save FMCorz/2255f94dbea30aa49f16 to your computer and use it in GitHub Desktop.
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);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment