Improved footnote styles on :target and :focus

This commit is contained in:
squidfunk 2021-05-01 19:56:40 +02:00
parent 4feba2ebcf
commit 6c6dd2a0db
5 changed files with 28 additions and 18 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -39,7 +39,7 @@
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block styles %} {% block styles %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.e35208c4.min.css' | url }}"> <link rel="stylesheet" href="{{ 'assets/stylesheets/main.ccbd2aba.min.css' | url }}">
{% if config.theme.palette %} {% if config.theme.palette %}
{% set palette = config.theme.palette %} {% set palette = config.theme.palette %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.ef6f36e2.min.css' | url }}"> <link rel="stylesheet" href="{{ 'assets/stylesheets/palette.ef6f36e2.min.css' | url }}">

View File

@ -34,20 +34,6 @@
// Scoped in typesetted content to match specificity of regular content // Scoped in typesetted content to match specificity of regular content
.md-typeset { .md-typeset {
// Footnote reference
[id^="fnref:"]:target {
scroll-margin-top: initial;
margin-top: -1 * px2rem(48px + 24px - 4px);
padding-top: px2rem(48px + 24px - 4px);
}
// Footnote
[id^="fn:"]:target {
scroll-margin-top: initial;
margin-top: -1 * px2rem(48px + 24px - 3px);
padding-top: px2rem(48px + 24px - 3px);
}
// Footnote container // Footnote container
.footnote { .footnote {
color: var(--md-default-fg-color--light); color: var(--md-default-fg-color--light);
@ -86,6 +72,11 @@
.footnote-ref { .footnote-ref {
font-weight: 700; font-weight: 700;
font-size: px2em(12px, 16px); font-size: px2em(12px, 16px);
// Hack: increase specificity to override default
html & {
outline-offset: px2rem(2px);
}
} }
// Footnote backreference // Footnote backreference
@ -140,4 +131,23 @@
} }
} }
} }
// Footnote reference wrapper
[id^="fnref:"]:target {
scroll-margin-top: initial;
margin-top: -1 * px2rem(48px + 24px - 4px);
padding-top: px2rem(48px + 24px - 4px);
// Show outline for all devices
> .footnote-ref {
outline: auto;
}
}
// Footnote wrapper
[id^="fn:"]:target {
scroll-margin-top: initial;
margin-top: -1 * px2rem(48px + 24px - 3px);
padding-top: px2rem(48px + 24px - 3px);
}
} }