Skip to content

Instantly share code, notes, and snippets.

@dpw1
dpw1 / background_image.css
Last active March 27, 2023 09:26
Add a background image to any Shopify theme
<style>
html, body,
[id*='shopify-section']:not([id*='announcement']):not([id*='header']):not([id*='footer']),
[id*='shopify-section']:not([id*='announcement']):not([id*='header']):not([id*='footer'])> [class*='background']{
background: url("replaceme.jpg") !important;
background-size: cover !important;
}
</style>
@dpw1
dpw1 / footer.liquid
Created October 8, 2021 01:42
Add a "name" field to Debut theme's footer newsletter (Shopify)
@dpw1
dpw1 / newsletter.liquid
Last active October 20, 2021 02:09
Add a "name" field to Debut theme's newsletter (Shopify)
<input type="text"
name="contact[first_name]"
id="{{ formId }}-first_name"
class="input-group__field{% if form.errors %} input--error{% endif %}"
value=""
placeholder="First name"
aria-label="First name"
aria-required="true"
autocorrect="off"
autocapitalize="off"
@dpw1
dpw1 / base.css
Last active December 23, 2022 00:27
Dawn theme - center logo and enable hamburger menu on Desktop
@media (min-width: 990px) {
.header {
display: flex;
justify-content: space-between;
}
.header .header__inline-menu {
display: none;
}
@dpw1
dpw1 / theme.liquid
Created August 16, 2021 01:50
Remove blue box from clickable elements (Shopify)
<style>
button,
textarea,
input,
select,
a {
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
-webkit-tap-highlight-color: transparent;
-webkit-user-select: none;
-khtml-user-select: none;
@dpw1
dpw1 / theme.css
Last active August 6, 2021 02:05
Simple theme: show "collection list" section's title below the image
.collection-grid-item,
.collection-list .grid__item[role]{
margin-bottom: 35px !important;
}
[id] .collection-grid-item__title{
color: #000000;
display: block;
position: relative;
@dpw1
dpw1 / custom-fonts.css
Last active July 17, 2021 02:40
Adding custom fonts to Shopify themes
h1,h2,h3,h4,h5,h6,html,body,*,[id] *{
font-family: "Precious" !important;
}
@dpw1
dpw1 / .css
Created June 15, 2021 23:15
Shopify's Brooklyn Theme Sticky Description
@media (min-width: 767px){
[class*='product-single__meta--']{
position: sticky;
top: 0;
}
}
@dpw1
dpw1 / theme.js
Last active December 20, 2020 17:51
This code is outdated! Please visit the link below for the updated version:
https://ezfycode.com/blog/debut-shopify-theme-how-to-add-swipe-for-product-page-images
This code is outdated! Here is the updated version:
https://ezfycode.com/blog/debut-shopify-theme-how-to-add-swipe-for-product-page-images