Opened 5 years ago
Last modified 14 months ago
#45944 new defect (bug)
Twenty Nineteen: Added URL in :after styles for print.css is unreliable
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | low |
Severity: | normal | Version: | 5.0.3 |
Component: | Bundled Theme | Keywords: | has-patch needs-refresh |
Focuses: | css | Cc: |
Description
The print styles for Twenty Nineteen include a little snippet meant to append the URL to links so it's visible when printed:
a[href^=http]:after { content: " < " attr(href) "> "; }
Via: https://themes.trac.wordpress.org/browser/twentynineteen/1.2/print.css#L85
This snippet is based on recommendations in this article:
https://www.jotform.com/blog/css-perfect-print-stylesheet-98272/
In practice, this appears to be fairly unreliable. In testing, @Joyously and I only see those URLs sporadically, and haven't been able to pin down why.
More details: https://github.com/WordPress/twentynineteen/issues/609#issuecomment-439489841
If these rules aren't working correctly, I suggest we remove them from the theme.
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
Thanks for moving this over, @kjellr!
I did a bit of investigation because, honestly, this was totally bugging me!
It looks like these styles are the culprit:
... which explains why it was only working sometimes -- if the image filter wasn't enabled, that class wouldn't be present.
I think this should be fixable by making the selector more specific (assuming the
!important
has to stay):... but just let me know if I'm missing something here!
--
Edited to correct my bad CSS suggestion :D