My setting_schema does not update.

itsmattsaunders
New Member
2 0 0

I've created a schema in my settings_schema.json to edit fonts and font sizes.

[
  {
    "name": "theme_info",
    "theme_name": "BackwindCSS",
    "theme_author": "itsmattsaunders",
    "theme_version": "1.0.0",
    "theme_documentation_url": "https:\/\/github.com\/\/itsmattsaunders",
    "theme_support_url": "https:\/\/github.com\/\/itsmattsaunders"
  },
  {
    "name": "Typography",
    "settings": [
      {
        "type": "header",
        "content": "Headings and buttons"
      },
      {
        "type": "font_picker",
        "id": "header_font_new",
        "label": "Header Font Sizes (h1, h2, h3)",
        "default": "work_sans_n6"
      },
      {
        "type": "range",
        "id": "header_base_size",
        "label": "Header size",
        "default": 26,
        "min": 20,
        "max": 36,
        "step": 1,
        "unit": "px"
      },
      {
        "type": "header",
        "content": "Body text"
      },
      {
        "type": "font_picker",
        "id": "subheader_font_new",
        "label": "Subheader Fonts (h4, h5, h6)",
        "default": "work_sans_n4"
      },
      {
        "type": "range",
        "id": "subheader_base_size",
        "label": "Subheader size",
        "default": 18,
        "min": 14,
        "max": 28,
        "step": 1,
        "unit": "px"
      },
      {
        "type": "font_picker",
        "id": "body_font_new",
        "label": "Base Font",
        "default": "work_sans_n4"
      },
      {
        "type": "range",
        "id": "body_base_size",
        "label": "Paragraph size",
        "default": 14,
        "min": 11,
        "max": 24,
        "step": 1,
        "unit": "px"
      }
    ]
  }
]


However, when I update it in the customiser it doesn't work.
I am referencing the object id in my css.liquid file, and when I edit the code in the Shopify panel I can it gets updated in the settings_data.liquid.
I have linked the stylesheet in the theme.liquid as well.

h1, h2, h3{
  font-family: {{ settings.header_font_new }};
  font-size: {{ settings.header_base_size }};
}


h4, h5, h6{
  font-family: {{ settings.subheader_font_new }};
  font-size: {{ settings.subheader_base_size }};
}

p{
  font-family: {{ settings.body_font_new }};
  font-size: {{ settings.body_base_size }};
}

 

0 Likes
Mircea_Piturca
Shopify Partner
1489 42 316

Try:

font-family: {{ section.settings.body_font_new.family }}
Finally—Add variant descriptions to your products
0 Likes
ShanifAtApteo
Shopify Partner
35 3 6

Hi @itsmattsaunders  glad to answer your question digitally here. There was a little mistake in your code, I believe you should be able to solve your problem by replacing the given code below:

h1, h2, h3{

  font-family: {{ settings.header_font_new.family }}, {{ settings.header_font_new.fallback_families }};

  font-size: {{ settings.header_base_size }};

}

h4, h5, h6{

  font-family: : {{ settings.header_font_new.family }}, {{ settings.header_font_new.fallback_families }};

  font-size: {{ settings.subheader_base_size }};

}

p{

  font-family: : {{ settings.header_font_new.family }}, {{ settings.header_font_new.fallback_families }};

  font-size: {{ settings.body_base_size }};

}

Hopefully, that solves your problem. If not, please let me know if you're seeing any other issues.

Shanif Dhanani, CEO and data scientist at Apteo
- Was I able to help? Click Like to let me know!
- If I was able to answer your question, click Accept as Solution
- Want to increase your customer lifetime value with A.I.? Check out Apteo
0 Likes