Make WordPress Core

Opened 5 years ago

Last modified 2 weeks ago

#45944 new defect (bug)

Twenty Nineteen: Added URL in :after styles for print.css is unreliable

Reported by: kjellr's profile kjellr Owned by:
Milestone: 6.6 Priority: low
Severity: normal Version: 5.0.3
Component: Bundled Theme Keywords: has-patch needs-refresh needs-testing
Focuses: css Cc:


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) "> ";


This snippet is based on recommendations in this article:

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:

If these rules aren't working correctly, I suggest we remove them from the theme.

Attachments (1)

45944.patch (1.8 KB) - added by kjellr 5 years ago.

Download all attachments as: .zip

Change History (7)

#1 @laurelfulford
5 years ago

  • Milestone changed from Awaiting Review to Future Release

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:

/* Remove image filters from featured image */
  .image-filters-enabled *:after {
    display: none !important;

... 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):

/* Remove image filters from featured image */
  .image-filters-enabled .site-featured-image *:after {
    display: none !important;

... but just let me know if I'm missing something here!

Version 0, edited 5 years ago by laurelfulford (next)

#2 @laurelfulford
5 years ago

  • Keywords needs-patch added; needs-testing removed

#3 @kjellr
5 years ago

🎉 Great sleuthing, @laurelfulford. That was exactly correct. I've attached a patch that applies some more specific styles down in that portion of the file. (I also snuck in a tiny fix for the featured image overlay in post lists while I was in there).


5 years ago

#4 @sabernhardt
22 months ago

  • Focuses css added
  • Keywords has-patch added; needs-patch removed

#5 @sabernhardt
21 months ago

  • Keywords needs-refresh added

#6 @karmatosed
2 weeks ago

  • Keywords needs-testing added
  • Milestone changed from Future Release to 6.6
Note: See TracTickets for help on using tickets.