Centre and enlarge product badges

Topic summary

Goal: Center product badges on Dawn 15.2, make them larger, and add a shadow (badge shows when product has tag “new”).

What changed:

  • CSS-based approaches were proposed via Online Store → Themes → Edit code → base.css/theme.css.
  • Approach A: Center the badge with .card__badge, then enlarge the inner span (.card__badge.bottom.left span) by increasing width/height, font-size, padding, and adding box-shadow. Iterations expanded width (100→150→195px) to better match the example.
  • Approach B (scoped to collection pages): .collection .card__badge centered with box-shadow and adjusted height; .collection span.badge uses larger padding/font-size. A later variant sets .card__badge as a flex container at ~80% width with a full-width, centered span and a pseudo-element for the shadow, producing a wider, example-like look.

Other options:

  • An app (Product Labels & Badges) was suggested for easier control of text, position, border/stroke, shadow, and auto “new” labeling via date settings.

Outcomes/status:

  • Centering and shadow achieved; multiple solutions provided to increase size and width. The requester sought an exact match to the example; final confirmation not posted. Discussion appears open pending the requester’s acceptance or further tweaks.

Notes: Screenshots illustrate results; no code changes to Liquid beyond the existing tag-based badge trigger were required.

Summarized with AI on December 12. AI used: gpt-5.

Hello wizards

Im trying to change the position of my product badges to be centred instead of left.

I also want to increase the size of the badge to reflect the example
Adding a shadow would be a bonus

I’m on DAWN 15.2 - www.sundaymass.store

the code I have currently for the custom badge text is:

{% if card_product.tags contains ‘new’ %}
NEW :fire:
{% endif %}

Cheers

1 Like

Hi @massmonster ,

  1. Go to Online Store → Theme → Edit code.
  2. Open your theme.css / based.css file and paste the code in the bottom of the file.
.card__badge {
    
    justify-self: center !important;
}
.card__badge.bottom.left span {
   
    width: 100px;
    height: 44px !important;
    font-size: 16px;
    padding: 13px 14px;
     box-shadow: 5px 5px 5px rgba(255, 255, 255, 0.2);
}

Result:

If my reply is helpful, kindly click like and mark it as an accepted solution.

If you are happy with my help, you can help me buy a COFFEE

Thanks!

Hi @massmonster

Try this one.

  1. From your Shopify admin dashboard, click on “Online Store” and then “Themes”.
  2. Find the theme that you want to edit and click on “Actions” and then “Edit code”.
  3. In the “Assets” folder, click on “base.css, style.css or theme.css” file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:
.collection .card__badge {
    justify-self: center !important;
    box-shadow: 5px 5px 5px rgba(255, 255, 255, 0.2);
    height: 25px;
}

.collection span.badge {
    padding: .4rem .8rem;
}

Your Feedback Matters! Please mark the solution and give likes to posts that helped you. Your appreciation fuels our motivation to assist you better!

1 Like

Thats solved the 1st and 3rd issue, how do we make the badge bigger?

Hi @massmonster ,

.card__badge {
    
    justify-self: center !important;
}
.card__badge.bottom.left span {
   
    width: 150px;
    height: 44px !important;
    font-size: 16px;
    padding: 13px 14px;
     box-shadow: 5px 5px 5px rgba(255, 255, 255, 0.2);
}

Result:

If my reply is helpful, kindly click like and mark it as an accepted solution.

If you are happy with my help, you can help me buy a COFFEE

Thanks!

Oh, sorry I thought you like to decrease.

Please, replace this code.

.collection .card__badge {
    justify-self: center !important;
    box-shadow: 5px 5px 5px rgba(255, 255, 255, 0.2);
}

.collection span.badge {
    padding: 1rem;
    font-size: 1.5rem
}

And Save.

Result:

Your Feedback Matters! Please mark the solution and give likes to posts that helped you. Your appreciation fuels our motivation to assist you better!

1 Like

Getting there… how do we make it wider? i pretty much want exactly what the example has

@massmonster

.collection .card__badge {
    
    height: 0 !important;
    margin-bottom: 0 !important;
}
.card__badge.bottom.left span {
    width: 195px !important;
    font-size: 16px !important;
    padding: 15px 14px !important;
    box-shadow: 5px 5px 5px rgba(255, 255, 255, 0.2) !important;
    
}

Result:

If my reply is helpful, kindly click like and mark it as an accepted solution.

If you are happy with my help, you can help me buy a COFFEE

Thanks!

Do you mean like this?

If it is, replace the code again.

To this;

.collection .card__badge {
    justify-self: center !important;
    display: flex;
    justify-content: center; 
    align-items: center; 
    width: 80%; 
    position: relative; 
}

.collection .card__badge:after {
    content: '';
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; 
    box-shadow: 5px 5px 5px rgba(255, 255, 255, 0.5);
}

.collection span.badge {
    padding: 1rem; 
    font-size: 1.5rem; 
    width: 100%;
    text-align: center; 
}

And Save.

Your Feedback Matters! Please mark the solution and give likes to posts that helped you. Your appreciation fuels our motivation to assist you better!

Hello

Hi @massmonster ,

I wonder if you’re able to complete it. If not, you might consider utilizing an app like Product Labels & Badges. This app enables you to customize your label’s text, position, border (stroke), shadow, and more.

Additionally, you can navigate to the product settings and enable the Date feature (optional). This functionality will help you automatically display labels on new products.