epiphyt / embed-privacy

Embed Privacy prevents loading of embedded external content and allows your site visitors to opt-in.
https://epiph.yt/en/embed-privacy/
GNU General Public License v2.0
19 stars 12 forks source link

The CSS adds the thumbnail as a background of the embed (not just the overlay) #157

Closed Lazza closed 1 year ago

Lazza commented 1 year ago

This issue may not be noticed on YouTube embeds because they cover the whole embed area, however they appear clearly with Slideshare (which is being implemented in #153).

The plug-in adds the thumbnail as background, but not only for the overlay. The background stays after the overlay has been deactivated. However, WordPress does not "cover" the whole area for some embeds (e.g. LinkedIn), unless people apply some custom CSS.

Hence a result like this appears:

Screenshot of Slideshare post with overlay: the background image is nicely laid on the overlay

Screenshot of Slideshare post after clicking the overlay: the background image is on a rectangle larger than the Slideshare embed

Originally posted by @Lazza in https://github.com/epiphyt/embed-privacy/issues/153#issuecomment-1374607713

Lazza commented 1 year ago

Related: could it be a nice idea to set the thumbnail URL as a CSS variable for easier access by users who like adding custom CSS?

A CSS variable might also help in addressing this bug as the variable could be referenced only in the overlay sub-element.