Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assembler: Move the style variation specific font families from the main theme.json to the variation json file. #8079

Closed
matiasbenedetto opened this issue Sep 5, 2024 · 3 comments · Fixed by #8421
Assignees
Labels

Comments

@matiasbenedetto
Copy link
Member

matiasbenedetto commented Sep 5, 2024

What?

Move the style variation specific font families from the main theme.json to the variation JSON file.

Why?

Currently, the font families must be defined in the main theme.json file to load as expected in the editor when the style variation is switched. If this issue WordPress/gutenberg#59965 is fixed (in progress WordPress/gutenberg#65019), we could avoid this 'hack' that's producing the printing of not needed CSS in the frontend. So, this change would be a tiny performance improvement, and it could lead to simpler-to-define typography variations.

Related

The same issue in TT5: WordPress/twentytwentyfive#233

@alaczek
Copy link
Contributor

alaczek commented Nov 12, 2024

OMG yes please! This will also make it easier to build Assembler-based themes without needing to remove a bunch of fonts from theme.json every time 🎉

alaczek added a commit that referenced this issue Nov 14, 2024
Move font families definition to the corresponding style variation. See #8079
alaczek added a commit that referenced this issue Nov 14, 2024
Move font families definition to the corresponding style variation. See #8079
alaczek added a commit that referenced this issue Nov 14, 2024
Move font families definition to the corresponding style variation. See #8079
alaczek added a commit that referenced this issue Nov 14, 2024
Move font families definition to the corresponding style variation. See #8079
alaczek added a commit that referenced this issue Nov 14, 2024
Move font families definition to the corresponding style variation. See #8079
alaczek added a commit that referenced this issue Nov 14, 2024
Move font families definition to the corresponding style variation. See #8079
alaczek added a commit that referenced this issue Nov 14, 2024
Move font families definition to the corresponding style variation. See #8079
alaczek added a commit that referenced this issue Nov 14, 2024
Move font families definition to the corresponding style variation. See #8079
alaczek added a commit that referenced this issue Nov 14, 2024
Move font families definition to the corresponding style variation. See #8079
alaczek added a commit that referenced this issue Nov 14, 2024
Move font families definition to the corresponding style variation. See #8079
alaczek added a commit that referenced this issue Nov 14, 2024
Move font families definition to the corresponding style variation. See #8079
alaczek added a commit that referenced this issue Nov 14, 2024
Move font families definition to the corresponding style variation. See #8079
alaczek added a commit that referenced this issue Nov 14, 2024
Move font families definition to the corresponding style variation. See #8079
alaczek added a commit that referenced this issue Nov 14, 2024
Move font families definition to the corresponding style variation. See #8079
alaczek added a commit that referenced this issue Nov 14, 2024
Remove font families definitions from theme.json. See #8079
@alaczek
Copy link
Contributor

alaczek commented Nov 14, 2024

I moved the font family definitions out of theme.json to appropriate style variations. Please review and let me know if this is right.

While I was doing this, I noticed we have a few fonts registered in theme.json that are not used in any style variation:

  • Bricolage Grotesque
  • Vina Sans
  • Rubik
  • Cardo
  • DM Serif Display
  • Libre Baskerville

Shall we keep or remove them?

I also noticed missing font weights:

  • in the 05-fahkwang.json the headings are supposed to use 200 font weight, but we only register 400 and 600.
  • in 01-figtree.json the headings are supposed to use 900 font weight, but we only register 400-700.

Shall I add the missing font family or update the headings definition?

cc @richtabor

@richtabor
Copy link
Contributor

Shall I add the missing font family or update the headings definition?

Let's remove, other than Rubik — I'll make a quick variation for it in #8421.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment