Skip to content

Instantly share code, notes, and snippets.

@odessy
odessy / gist:2f419724ef00b4cac51378dc2fd1e2be
Last active December 31, 2024 16:11
Story increase logo size
@media only screen and (max-width: 479px){
.header__mobile {
grid-template-columns: repeat(8, minmax(0, 1fr));
}
.js__show__mobile .theme__header__toolbar,
.header__mobile .theme__header__toolbar {
grid-column: 1 / span 8;
}
.header__mobile .header__logo.header__logo--image{
grid-column: 3 / span 4;
@odessy
odessy / gist:bdf3573e36868a3ca2cd7a0913948776
Created December 10, 2024 16:31
Pipeline 7 sold out badge product page
<!-- Liquid - Add product sold label -->
{% assign current_variant = product.selected_or_first_available_variant %}
<p class="badge-wrapper"><span class="sold-out uppercase" {% if current_variant.available == "" %}style="display:none;" {% endif %}>{{ 'products.product.sold_out' | t }}</span></p>
<script>
document.addEventListener('theme:variant:change', function(event) {
const variant = event.detail.variant;
let container = event.target;
if(event.target.outerWrapper){
@odessy
odessy / gist:01b90721c726a0700145cd05c79ba708
Last active December 5, 2024 17:04
Cart taxes_included
{% if cart.taxes_included %}
<p class="product__block__price" style="--PB: 18px;">{{ 'cart.general.shipping_at_checkout' | t }}</p>
{% endif %}
@odessy
odessy / gist:246326e03efae22a26aade1b2ab48750
Created November 27, 2024 15:47
Swatch colors available
{%- liquid
assign swatch_option = nil
if settings.swatches_enable
assign swatch_translation = 'general.swatches.color' | t
assign swatch_labels = swatch_translation | append: ',' | split: ','
for label in swatch_labels
assign sanitized_label = label | lstrip | rstrip
if product.options_by_name[sanitized_label].values.size > 0
assign swatch_option = product.options_by_name[sanitized_label]
break
@odessy
odessy / api-product-quickview.liquid
Created November 21, 2024 16:08
product quickview with upsell block
<div data-api-content>
<div class="drawer__top quickview__modal__top" data-quickview-head>
<div class="drawer__top__left">
{%- render 'product-title', product: product, block: block, section: section -%}
{%- render 'product-price', product: product, block: block, section: section -%}
</div>
<button class="drawer__button drawer__close"
data-first-focus
@odessy
odessy / gist:bc61b8c6e0ab41b7296bebb2b79cb93f
Created October 18, 2024 16:52
Collection canonical canonical_url
{% if template contains 'collection' %}
<link rel="canonical" href="{{ shop.url }}{{ collection.url }}" />
{% elsif canonical_url != blank %}
<link rel="canonical" href="{{ canonical_url }}">
{% endif %}
@odessy
odessy / gist:2b8d0003dc73a22007df21c4287ee352
Created October 18, 2024 15:29
store/camille-jewelry button colors
/* CSS - change Add to Cart button color */
.product-clip__btn,
.product__submit__buttons .btn--add-to-cart {
background-color: var(--COLOR-PRIMARY);
border: 1px solid var(--COLOR-PRIMARY);
color: var(--COLOR-PRIMARY-OPPOSITE);
}
.product-clip__btn:hover, .product-clip__btn:focus,
.product__submit__buttons .btn--add-to-cart:hover, .product__submit__buttons .btn--add-to-cart:focus {
background-color: var(--COLOR-PRIMARY-HOVER);
@odessy
odessy / gist:46647fc7435919a757598f1e114bbc57
Created September 19, 2024 17:10
Hide Inventory with span tag
Low inventory <span class=hidden>{{ inventory }}</span>
@odessy
odessy / gist:8b1e41b948f68c773a2cba440da05e8c
Created September 18, 2024 16:32
Password page layout on mobile
@media only screen and (max-width: 768px) {
.template-password .input-group--inner-button {
display: flex;
flex-direction: column;
}
.template-password .input-group-button{
width: 100%;
}
.template-password .input-group .btn,
.template-password .input-group .input-group-field{
@odessy
odessy / gist:405f5a052281d11de7552a23a8012e38
Created September 18, 2024 15:11
Swatch border outer circle
.swatch__button input:checked~label:after, .swatch__label[aria-selected=true]:after{
--swatch-offset: 3px;
top: calc(var(--swatch-offset) * -1);
left: calc(var(--swatch-offset) * -1);
width: calc(var(--swatch-size) + var(--swatch-offset) * 2);
height: calc(var(--swatch-size) + var(--swatch-offset) * 2);
border-color: var(--secondary);
}
.product__grid__info .grid__swatch__hover,
.grid__swatch__container{