Skip to content

Instantly share code, notes, and snippets.

@jimrothfork
Created November 25, 2017 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimrothfork/8f1465760472e92878a2adbc5d239802 to your computer and use it in GitHub Desktop.
Save jimrothfork/8f1465760472e92878a2adbc5d239802 to your computer and use it in GitHub Desktop.
{% if settings.type_base_family contains 'Google' %}
{%- assign type_base_parts = settings.type_base_family | split: '_' -%}
{% capture baseGoogleUrl %}{{ type_base_parts[1] }}:400,700{% endcapture %}
{{ '//fonts.googleapis.com/css?family=' | append: baseGoogleUrl | stylesheet_tag }}
{% endif %}
{% if settings.type_header_family contains 'Google' %}
{% unless settings.type_header_family contains type_base_parts[1] and settings.type_header_family contains '700' %}
{%- assign type_header_parts = settings.type_header_family | split: '_' -%}
{% capture headerGoogleUrl %}{{ type_header_parts[1] }}:{{ type_header_parts[2] }}{% endcapture %}
{{ '//fonts.googleapis.com/css?family=' | append: headerGoogleUrl | stylesheet_tag }}
{% endunless %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment