WordPress / theme-experiments

Experimenting with themes made out of blocks.
GNU General Public License v2.0
546 stars 180 forks source link

TT1 Blocks: allow custom font overrides #196

Closed mattwiebe closed 3 years ago

mattwiebe commented 3 years ago

Hi, I'm back again! This is nearly/exactly identical to #183 and will unblock broader testing of this theme on WordPress.com, where we allow font customizations.

This will allow base fonts to be overridden by supplying the --font-base CSS custom property on :root and headings to alternately be overridden by --font-headings, falling back to the base font if not supplied.

The current goal is to enable customization in the Gutenboarding flow on WordPress.com, and will fix the issue of it not working detailed at https://github.com/Automattic/wp-calypso/issues/48973

Testing should simply be that nothing is changed by default. You can use your inspector to add custom properties. If you add --font-base to the html element, you should see all of the fonts change to render with that value (allowing a single font for the whole theme, as is currently the case), and adding --font-headings should switch all headings to that value.

Eg, with --font-base set to Georgia:

image

--font-base: Georgia; --font-headings: Verdana; 👍

image
carolinan commented 3 years ago

It looks like this has been solved on the calypso side, can this be closed?

kjellr commented 3 years ago

Yes, it can be. Thanks!