Skip to content

Instantly share code, notes, and snippets.

@odessy
Last active April 29, 2026 15:42
Show Gist options
  • Select an option

  • Save odessy/3e0eb52b29b65e64a5db3fa160ee3206 to your computer and use it in GitHub Desktop.

Select an option

Save odessy/3e0eb52b29b65e64a5db3fa160ee3206 to your computer and use it in GitHub Desktop.
Product page show custom badge
{% if settings.badge_custom %}
{% if product.metafields.theme.badge != blank and product.metafields.theme.badge.type == 'single_line_text_field' %}
<div class="badge--custom"><span>{{ product.metafields.theme.badge.value }}</span>
<style>
.badge--custom {
font-family: var(--FONT-STACK-ACCENT);
font-weight: var(--FONT-WEIGHT-ACCENT-BOLD);
text-transform: var(--FONT-ACCENT-TRANSFORM);
letter-spacing: var(--FONT-ACCENT-LETTER-SPACING);
font-size: calc(var(--font-2) * var(--FONT-ADJUST-ACCENT));
width: fit-content;
max-width: calc(100% - var(--inner));
padding: 5px 10px;
background: var(--COLOR-BADGE);
color: var(--COLOR-BADGE-TEXT);
}
</style>
</div>
{% endif %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment