Skip to content

Instantly share code, notes, and snippets.

@dpw1
Last active March 6, 2024 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpw1/6d8184a1a9f9c97d6ad6c8d83c69e6df to your computer and use it in GitHub Desktop.
Save dpw1/6d8184a1a9f9c97d6ad6c8d83c69e6df to your computer and use it in GitHub Desktop.
Custom sales badge Dawn theme
/* ## Collection page and sections (change badges color/font size)
https://ezfycode.com/blog/dawn-theme-how-to-customize-badges-color-and-size
================================== */
.card .badge[class*="accent"],
.card .badge[class*="inverse"],
.product .badge[class*="sale"],
.product .badge[class*="sold"] {
border-color: transparent !important;
}
/* Sale badge (collections) on desktop */
.card .badge[class*="accent"]:not([class*="inverse"]) {
background: #ff5733 !important;
color: #ffffff !important;
font-size: 12px !important;
}
/* Sold out badge (collections) on desktop */
.card .badge[class*="inverse"]:not([class*="accent"]) {
background: #000 !important;
color: #f1f1f1 !important;
font-size: 12px !important;
}
@media (max-width: 749px) {
/* Sale badge (collections) on mobile */
.card .badge[class*="accent"]:not([class*="inverse"]) {
font-size: 11px !important;
}
/* Sold out badge (collections) on mobile */
.card .badge[class*="inverse"]:not([class*="accent"]) {
font-size: 11px !important;
}
}
/* ## Product page (change badges color/font size)
https://ezfycode.com/blog/dawn-theme-how-to-customize-badges-color-and-size
================================== */
/* Sale badge (product page) on desktop */
.product .badge[class*="sale"] {
background: #ff5733 !important;
color: #ffffff !important;
font-size: 14px !important;
}
/* Sold out badge (product page) on desktop */
.product .badge[class*="sold"] {
background: #94659e !important;
color: #f1f1f1 !important;
font-size: 20px !important;
}
@media (max-width: 749px) {
/* Sale badge (product page) on mobile */
.product .badge[class*="sale"] {
font-size: 13px !important;
}
/* Sold out badge (product page) on mobile */
.product .badge[class*="sold"] {
font-size: 13px !important;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment