Forum How do I...?

Keep footnote content consistent while styling ::footnote-call relative to its surrounding text?

natevw
In my document I want all my footnotes themselves (i.e. the "extra" content that is floated to appear in the @footnote region) to have the same styling. But the footnote calls come from a variety of places: narrative content, figure captions, headings, etc.

This seems to present a bit of a conflict. I am using the ± the following LESS code to style the footnote and the call:

.pdf-footnote {
  .reset-text();
  font-family: @proxima;
  font-size: 7pt;
  color: grey;
}

::footnote-call {
  content: attr(data-counter);
  .footnote-super();
}


Where the `.reset-text()` helper expands to a bunch of font-/word-/line-/text- properties to undo any troublesome styling that might carry over (e.g. `font-style: normal; text-decoration: none;`…) and the `.footnote-super()` is basically just:

.footnote-super() {
  vertical-align: super;
  font-size: 0.6em;
  line-height: 0;
}




Now the problem is the seemingly distinct `.pdf-footnote` and `::footnote-call` selectors are actually related; the latter is basically like a `.pdf-footnote::before` in that all the style rules for the footnote content get inherited by its call pseudo-element as well!


So rather than the footnote call having a size relative `0.6em` to its surrounding text, and inheriting *that* font-family/color/etc. the call inherits instead from the *reset* footnote content. So a footnote call on say a large 16pt header ends up not being ~10pts but rather more like 4pts (!! 60% of the content's 7pts) …and is grey instead of matching the headers spot color, etc.

Is there any way to avoid or workaround this situation, so that my footnotes can be consistently typeset together while their individual calls remain typeset relative to what they are originally annotating?
natevw
Ah, this turned out to be simpler than I thought. Inspired by the idea of a (presumedly still future) `:footnote-body` pseudo-selector mentioned at https://www.princexml.com/forum/topic/976/formatting-footnotes#3930, I simply added an additional `.pdf-footnote-body` wrapper element to all my footnotes:

<span class="pdf-footnote {{ class }}" data-counter="{{ counter_label }}">
  <span class="pdf-footnote-body">{{ content }}</span>
</span>


(This was easy in my context since the footnote generation was already somewhat abstracted and didn't need to be revisited one-by-one manually.)

Then rather than applying styles to the whole `.pdf-footnote`, only the `.pdf-footnote-body` and the `::footnote-marker` get made consistent via the reset:

.pdf-footnote-body, ::footnote-marker {
  .reset-text();
  font-family: @proxima;
  font-size: 7pt;
  color: grey;
}


which then leaves the original `::footnote-call` styling free to work relative to its original context.