Adding background color to text metafield

Hi all, i’m looking to add custom colored background to text metafield.

Right now i’m working on sense 2.0 ver 12.0.0.

the site you see here is on 8.0.0

www.danicoffeeshop.com

Screenshot 2023-11-27 180145.png

€/capsula is the merafield where i would like to add custom colored background

1 Like

Hi @clavilla57

Do you mean like this?

If it is, check this one.

  • From your Shopify admin dashboard, click on “Online Store” and then “Themes”.
  • Find the theme that you want to edit and click on “Actions” and then “Edit code”.
  • 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:
p.product__text.caption-with-letter-spacing font {
    background: lightblue;
    border-radius: 2px;
    padding: 2px
    
}
  • And save.
  • Note: You can change the color you like.

Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!

1 Like

is it possible to have different color for each metafield? cause i’m plnning to add another text metafield

tried right now, it doesn’t work unfortunely..any other solution?

1 Like

Replace with this one.

p.product__text.caption-with-letter-spacing font {
    background: lightblue !important;
    border-radius: 2px;
    padding: 2px
    
}

Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!

1 Like

Same code as before and doesn’t work

any other solution?

1 Like

Oh, Sorry I miss some semi colon. Check this one again. Thanks!

p.product__text.caption-with-letter-spacing font {
    background: lightblue !important;
    border-radius: 2px !important;
    padding: 2px !important;
}

And Save.

You can change the color background (lightblue) to colors you like.

Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!

1 Like

I’m the same person with the other admin account. unfortunely this also doesn’t work :sad_but_relieved_face:

1 Like

Can you place on the theme.liquid file.

  • From your Shopify admin dashboard, click on “Online Store” and then “Themes”
  • Find the theme that you want to edit and click on “Actions” and then “Edit code”.
  • In the “theme. Liquid” file. Find the tag and paste the code below before the tag.

  • And Save.

Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!

1 Like

Nope, not working

I think i’m going to leave this as it is at this point

Would you mind helping me with this?

https://community.shopify.com/c/shopify-design/move-metafield-on-the-right-of-price/td-p/2336523