Customize the appearance of Shoppable Gallery, Product Page Gallery, and LikeShop widgets using CSS.
This guide shows how to apply custom styles to Dash Social embeddable widgets, including Shoppable Galleries, Product Page Galleries. and Likeshop Galleries. Use these techniques to match widgets with your brand’s style and voice.You can:
Adjust layout and aspect ratios
Customize hover effects and overlays
Modify product pop-up designs
Add dynamic headers above widgets
All examples work for both carousel and grid layouts.
By default, the widget crops all images into a square (1:1) format so the gallery layout stays even. To use a different aspect ratio, add data-media-format="original" to the script tag and update the CSS to control how images fill each cell.Add data-media-format="original" to your script tag:
padding-top: Controls the aspect ratio. Values greater than 100% produce a portrait crop; values less than 100% produce a landscape crop. For example, 125% gives a 4:5 ratio and 133.33% gives a 2:3 ratio.
data-media-format="original": Required when using a custom aspect ratio. Without it, the widget overrides your CSS and forces a square crop. Note that images with very different native ratios may still appear uneven without additional custom styling.
<style> /* Existing Styles */ /* ... */ .dh-widget-container .ls-photo-wrapper .aspect-ratio-box * > .overlay { /* Replace what is inside the parenthesis with either the data for the image or a url to an image */ background-image: url('https://cdn-icons-png.flaticon.com/512/2478/2478393.png'); background-size: 100px 100px; background-repeat: no-repeat; background-position: center; /* Hide the text. */ color: transparent; }</style>
Many brands add a custom header above their Shoppable or Product Page Galleries. A common pattern is hiding the header if no media is available for that page. You can achieve this with a small JavaScript snippet that checks the widget’s content.
When a user clicks on a post in a Shoppable Gallery or Product Page Gallery, a product pop-up opens.
This pop-up displays:The media the user clicked onA list of all products tagged in that postLinks that take the user to the product pagesYou can customize the appearance of this pop-up to better match your brand style using CSS.Below is a basic widget example that includes the pop-up. The following sections will show how to adjust colors, fonts, and layout.
You can change the font used in the pop-up by overriding the font-family CSS property. To use a custom font, import it in your <style> block or include it in the <head> of your page.Example with Google Fonts:
<style> @import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@500&display=swap'); /* Apply to LikeShop or Shoppable pop-up */ .ls-detail .ls-detail-container { font-family: 'Roboto Mono', monospace; }</style>
@import url(...) – Loads the custom font. Replace the URL with your own font file or provider.
font-family – Sets the pop-up font. Replace “Roboto Mono” with your custom or built-in font.
Example with <link> in <head>:
<html> <head> <link href="https://yourwebsite.com/path/to/font.css" rel="stylesheet"> </head> <body> <!-- Your widget HTML --> </body></html>
This approach is useful if you’re already managing fonts through external stylesheets.