Ability to add custom font to theme settings interface

Ability to add custom font to theme settings interface

AlexLaurin
Shopify Partner
10 0 3

Hi,

In Shopify dev.docs for Fonts, they say that it is possible to add custom fonts to the theme's customization interface:

If you include custom fonts in your theme and want to provide merchants with the ability to choose the font, then you need to create a setting for the selection, such as a select setting. You can then reference the setting value in your CSS when defining which font to use for the associated elements.

Is there are way to have the custom fonts added among the other font from Shopify's library? Or is it rather the (underwhelming) ability to create a select options elsewhere (in sections, as an example)?

 

I am customizing Impulse Theme. Here's the relevant part in settings_schema:

{
        "type": "select",
        "id": "type_collection_font",
        "label": "t:settings_schema.typography.settings.type_collection_font.label",
        "default": "heading",
        "options": [
          {
            "value": "body",
            "label": "t:settings_schema.typography.settings.type_collection_font.options.body.label"
          },
          {
            "value": "heading",
            "label": "t:settings_schema.typography.settings.type_collection_font.options.heading.label"
          }
        ]
      }

 

Anyone successfully created such a setting? What's possible?

 

Thank you!

Replies 0 (0)