Page MenuHomePhabricator

[Spike] Wordpress plugin styling based on theme
Closed, ResolvedPublic

Description

  • check if it is possible to auto update the styling when user change the wordpress theme

Event Timeline

PWaigi-WMF triaged this task as Medium priority.Aug 29 2023, 2:24 PM
What I've tried

There are variables for colors and other visual aspect of the current site and we can use and apply to the Wikipedia Preview popup to try to make it blend better with the host site.

Some WordPress variables
Screen Shot 2023-09-07 at 12.01.15 PM.png (756×886 px, 240 KB)
Example of popup using the theme's background and text colors
Screen Shot 2023-09-07 at 12.04.00 PM.png (982×1 px, 199 KB)

I've made a draft PR that shows the approach.

Issues

The main issue I found is the inability to change the watermark color (svg files hosted on Commons and hardcoded to be black on a transparent background). As soon as the background becomes dark the "Wikipedia" in the header becomes less visible.

Skins can also redefine visual aspects of the site without assigning variables so there is no guarantee that our popup would be in sync with the theme.

Other options
  1. Offer an explicit dark mode (with appropriate wordmark images) that can detect the dark mode on wordpress or be turned on/off explicitly.
  1. Offer a basic Wikipedia Preview visual customization page on Wordpress admin that allows choosing main colors and fonts to make it fit in the host site.
  1. Offer detailed instructions for admin users willing to customize the preview popup with css. This is similar to what we have done for the preview word customization but it needs to be much more detailed for the whole preview.

Parking this is design sign off until we talk about it.