Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

Custom Fonts: Replace current Google Fonts list in Customizer with new list from Global Styles #53474

Open ianstewart opened 3 years ago

ianstewart commented 3 years ago

P2 ref: p58i-aGQ-p2

Now that we have new fonts in the Global Styles list, let's take a look at making sure they match up in the Customizer as well.

Current Global Styles List

How to see:

  1. Activate a "recommended theme on Dotcom" like Mayland.
  2. Visit the editor and click the global styles icon in the toolbar.

image

Current List in Customizer

How to see:

  1. Activate an older NOT "recommended" theme like Dyad. (You can see them by clicking the load more themes button in Calypso.)
  2. Visit the Customizer and click on the Fonts panel.

image

Important Note:

We will NOT be removing these fonts from the front-end of people's sites. Merely hiding them in the UI and surfacing the new list in the UI. See notes below.

ianstewart commented 3 years ago

Quick thoughts on logic for swapping out the list:

  1. For all users who have never used custom fonts in the customizer, hide old list and replace entirely with new list.
  2. For users who have used custom fonts in the customizer, hide all fonts that are not currently set, and fill out the rest of the list with the new list.

That seems like an MVP to me. It does leave the question of what to do when people want to switch away from a "deprecated" Google Font.

Thoughts on switching away from an existing font:

cc @davemart-in @kwight @apeatling @glendaviesnz as I think you may have looked at some of this logic previously.

kwight commented 3 years ago

It does leave the question of what to do when people want to switch away from a "deprecated" Google Font.

As long as we have a warning, I don't think we need any more (so I guess I vote for #2).

ianstewart commented 3 years ago

Does the customizer have any similar warning patterns?

glendaviesnz commented 3 years ago

We are already doing something similar with the sunsetted typekit fonts, ie. for users that had a typekit font selected they see some google font options in the list that other users do not see. There is a 'selected_fonts' options setting which makes it easy to detect if a user already has a custom font selected.

The main thing to be aware of is that with the typekit project we decided not to update the options data in the initial phase of the project due to the risks involved, so there is a dynamic mapping of the user options data from typekit -> google font, so this will have to be maintained, or the options data updated to the matching google font.

There are some remaining tidy up stories from the typekit project that were not finished due to team changes, but there are in the View backlog and we are hoping to get to them at some point - they shouldn't affect this work though as mostly related to removing the custom-fonts-typekit plugin completely.