Dawn Theme - Change default Icon for Share button Product page

Topic summary

A user wanted to replace the default share button icon on a Dawn theme product page but encountered an unwanted underline extending into the space between the custom icon and “Share” text.

Initial Problem:

  • Adding spaces using   in share.liquid created the desired spacing but caused the underline to extend across those spaces
  • The user could change the icon but couldn’t achieve proper spacing without the underline issue

Solution Provided:
Instead of using HTML spaces, the fix involved:

  1. Adding custom CSS to theme.liquid before the </head> tag
  2. Using CSS to control icon margin (margin-right) rather than text spacing
  3. Removing text decoration from the space area using .share-button__button .icon-share styling

Outcome:

  • The solution successfully removed the unwanted underline while maintaining proper spacing
  • The thread was marked as resolved
  • A follow-up question was posted asking how to change the share icon itself, but remains unanswered
Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

I already know how to change the icon for the share button on the product page, but there’s an issue… I space issue between the icon and share text. I can get a space between the icon and the text, but the underline starts right at the icon. I want “Icon space Share” See images below.

Green arrow shows unwanted underline:

share line.png

This default dawn theme share button:

share line 1.png

So how can I change to my icon and have the proper space/text between them?

Thanks

Hi Can you kindly share your store link (with the password, if any) with us? We will check it and suggest you a solution if possible.

Hi @xnyjyh

Step 1. Go to Admin → Online store → Theme > Edit code

Step 2. Find the file base.css. Search for the following CSS snippet

.share-button__button .icon-share {
    margin-right: 0.2rem !important;
}

If it helps you, please like and mark it as the solution.

Best Regards

Sorry, you might misunderstood the my question… I can change the spacing. its the underline after changing to my icon… please check my website again and put a space with my icons that’s now active. you’ll see the underline continuing after the icon. id like that space underline gone

share line.png

when my icon is there, theres that underline when I use   in share.liquid

You are increasing the space between the icon and the ‘Share’ text by adding spaces at the beginning of the text. However, this method is not ideal and, as you can see, it adds an underline to the spaces as well. Instead, to adjust the spacing between the icon and the text, you should use my approach: adjust the margin for the icon. Do you understand?

Step 1. Go to Admin → Online store → Theme > Edit code

Step 2. Find the file theme.liquid. Add the following snippet before the tag.


Boo, i cant seem to get it :disappointed_face:

Hi @xnyjyh

Step 1. Go to Admin → Online store → Theme > Edit code

Step 2. Find the file theme.liquid. Add the following snippet before the tag.


The result

If it helps you, please like and mark it as the solution.

Best Regards

1 Like

Thank you! lol. Finally it works :slightly_smiling_face:

1 Like

How to change share icon ?

to this