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

Enabling global styles to handle custom font declarations #23204

Closed
jffng opened this issue Jun 16, 2020 · 2 comments
Closed

Enabling global styles to handle custom font declarations #23204

jffng opened this issue Jun 16, 2020 · 2 comments
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json

Comments

@jffng
Copy link
Contributor

jffng commented Jun 16, 2020

To use a custom font, a theme today must do the following:

  1. Enqueue it
  2. Make a @font-face declaration in the theme’s stylesheet

As the current global styles mechanism is described, I think the steps would be:

  1. Enqueue it
  2. Make a @font-face declaration in the theme’s stylesheet
  3. Add the font to theme.json in presets and styles, something like:
    { global: { presets: { fonts: [ "my font", "other font", ... ] } } }

Is it possible that theme.json processes font declarations, making at least step 2 unnecessary? I think this moves slightly beyond generating a CSS custom property.

cc @carolinan

@annezazu annezazu added [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. CSS Styling Related to editor and front end styles, CSS-specific issues. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Jun 22, 2020
@mtias mtias mentioned this issue Jul 22, 2020
82 tasks
@oandregal
Copy link
Member

I've linked this issue from the tracking one. Font family is one of style attributes we'd like to add but haven't gotten there yet. Ideally, I'd like to see if the block style system can manage this for the theme.

@jffng
Copy link
Contributor Author

jffng commented Jan 18, 2021

Closing this issue as theme.json should not enqueue any fonts, and the font family mechanism has been added.

@jffng jffng closed this as completed Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
Projects
None yet
Development

No branches or pull requests

3 participants