Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linked Footnotes #472

Open
anghenfil opened this issue Feb 22, 2024 · 1 comment
Open

Linked Footnotes #472

anghenfil opened this issue Feb 22, 2024 · 1 comment

Comments

@anghenfil
Copy link

Hey,

is it possible to link from the footnote call to the footnote marker (and vice versa)?
I couldn't find something in the w3 spec, but is there any hack (maybe with the vivliostyle js support?) to make it possible?

Best
anghenfil

@spring-raining
Copy link
Member

Hi @anghenfil, sorry I have missed this post.

::footnote-call and ::footnote-marker are pseudo-elements, and as far as I know, there is no way to add links to pseudo-elements with only CSS changes. One solution that is a bit redundant but works is to place an anchor link to display footnote calls or footnote markers. This way you would be able to apply the desired style.

<span class="footnote" id="footnote-1">
  <a class="footnote-marker" href="#footnote-call-2"></a>
  Footnote text 1
</span>
<a class="footnote-call" href="#footnote-1" id="footnote-call-1"></a>

<span class="footnote" id="footnote-2">
  <a class="footnote-marker" href="#footnote-call-2"></a>
  Footnote text 2
</span>
<a class="footnote-call" href="#footnote-2" id="footnote-call-2"></a>

<style>
:root {
  counter-reset: footnote;
}
.footnote {
  counter-increment: footnote;
  float: footnote;
}
.footnote-marker::before,
.footnote-call::before {
  content: counter(footnote);
}
</style>

@MurakamiShinyu Please tell us if you have any other ideas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants