WordPress / create-block-theme

A WordPress plugin to create block themes
https://wordpress.org/plugins/create-block-theme/
GNU General Public License v2.0
310 stars 44 forks source link

Persist font settings when cloning a theme #678

Closed mikachan closed 1 day ago

mikachan commented 2 days ago

This PR should apply the "Save Fonts" save option when cloning a theme via Create Theme -> Clone Theme. This means that any font settings and files are copied over to the new cloned theme, including updating the file asset paths.

Fixes https://github.com/WordPress/create-block-theme/issues/677.

To test:

  1. Install and activate some custom fonts using the Font Library.
  2. Go to the CBT menu, Create Theme -> Clone Theme.
  3. Name your theme.
  4. Check the theme.json of the newly cloned theme: ensure that the fontFace.src paths are relative to the cloned theme. i.e. the paths start with file:. and not an absolute URL.
mikachan commented 1 day ago

Thanks @matiasbenedetto!

I think this could work but we would be removing the possibility of having linked fonts in a cloned theme.

Ah yes, we can address this later once Core supports it, like you say 👍