Last active
April 29, 2026 15:42
-
-
Save odessy/3e0eb52b29b65e64a5db3fa160ee3206 to your computer and use it in GitHub Desktop.
Product page show custom badge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% 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