There are a batch of rules in Modern main.css starting with #content a.external { and continuing to
#content a.external[ href$='.pdf' ], #content a.external[ href$='.PDF' ], #content a.external[ href*='.pdf#' ], #content a.external[ href*='.PDF#' ], #content a.external[ href*='.pdf?' ], #content a.external[ href*='.PDF?' ], .link-document { /* @embed */ background: url( images/document.png ) center right no-repeat; padding-right: 12px; }
which should probably reference .mw-parser-output instead of #content, so that TemplateStyles can reasonably override the default styling. All/the majority of the other skins had this change made. It should be backward compatible with wiki-defined values simply to swap #content 1:1 with .mw-parser-output, as the wiki-defined values will still be more specific.
Discussion arose in the context of Help talk:CS1.