Created
September 22, 2015 07:18
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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