Adjusted targeted link and footnote offsets

This commit is contained in:
squidfunk 2017-12-02 15:26:10 +01:00 committed by Martin Donath
parent d492e613a1
commit 507d44f264
5 changed files with 17 additions and 13 deletions

View File

@ -1,3 +1,7 @@
mkdocs-material-2.x.x (2017-xx-xx)
* Adjusted targeted link and footnote offsets
mkdocs-material-2.2.1 (2017-12-02)
* Fixed #616: Minor styling error with title-only admonition blocks

View File

@ -46,7 +46,7 @@
{% endif %}
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application.41c6761c.css">
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application.ac64251e.css">
{% if palette.primary or palette.accent %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-palette.792431c1.css">
{% endif %}

View File

@ -33,8 +33,8 @@
// Targeted anchor
&:target {
margin-top: -(4.8rem + 2.4rem + 1.6rem);
padding-top: (4.8rem + 2.4rem + 1.6rem);
margin-top: -(4.8rem + 1.2rem + 1.6rem);
padding-top: (4.8rem + 1.2rem + 1.6rem);
pointer-events: none;
}
}
@ -52,8 +52,8 @@
// Targeted anchor
&:target::before {
display: block;
margin-top: -(4.8rem + 2.4rem + 1rem);
padding-top: (4.8rem + 2.4rem + 1rem);
margin-top: -(4.8rem + 1.2rem + 1rem);
padding-top: (4.8rem + 1.2rem + 1rem);
pointer-events: none;
}
}

View File

@ -56,9 +56,9 @@
// Correct anchor offset for link blurring
@each $level, $delta in (
h2: 0.4rem,
h3: 0.7rem,
h4: 0.8rem,
h2: 0.8rem,
h3: 0.9rem,
h4: 0.9rem,
h5: 1.1rem,
h6: 1.1rem
) {
@ -72,10 +72,10 @@
content: "";
}
// Targeted anchor (48px from header, 24px from sidebar offset)
// Targeted anchor (48px from header, 12px from sidebar offset)
&:target::before {
margin-top: -(4.8rem + 2.4rem + $delta);
padding-top: (4.8rem + 2.4rem + $delta);
margin-top: -(4.8rem + 1.2rem + $delta);
padding-top: (4.8rem + 1.2rem + $delta);
}
// Make permalink visible on hover