Skip to content

Instantly share code, notes, and snippets.

<style type="text/css">
.stats {
color: white;
text-align: right;
}
.stat-unit {
margin-bottom: 24px;
}
.amount {
@cameroncowden
cameroncowden / show-no-alt.css
Created April 5, 2021 17:01
Highlight all Images without Alt Text
/* Courtesy of @AllThingsSmitty "sharing is caring" https://twitter.com/AllThingsSmitty/status/930617039085035520 */
/* highlights any images on the page without alt text or with empty alt text */
/* note - sometimes empty alt text is correct: https://www.w3.org/WAI/tutorials/images/decorative/ */
img[alt=""], img:not([alt]) {
border: red 5px solid;
}
@cameroncowden
cameroncowden / optimVideoForMobile
Created August 8, 2022 16:17
use ffmpeg to optimize a mov file for a shopify site (accepts mp4 only). Note: usings the downloadable executable ffmpeg, hence the ./
./ffmpeg -y -i input.mov -c:v libx264 -crf 30 -profile:v high -pix_fmt yuv420p -color_primaries 1 -color_trc 1 -colorspace 1 -movflags +faststart -an output.mp4
@cameroncowden
cameroncowden / specific-products.liquid
Created September 28, 2022 18:01
Show products from a specific collection in Shopify
<!-- the collection handle we are pulling from is 'new'--->
{% assign collection = collections['new'] %}
{% for product in collection.products | limit: 4 %}
<!-- the 'product-block' is specific to your theme, it is html for a grid item of a product, could be called product-grid-item, grid-product, etc --->
{% render 'product-block', product: product %}
<!-- product --->
{% endfor %}
@cameroncowden
cameroncowden / story-nav.liquid
Created March 1, 2023 16:49
Simple Shopify Story-like navigation bar
<style type="text/css">
{% if section.settings.desktop %}
/* This section will show on desktop as well */
{% else %}
@media screen and (min-width: 750px) {
#shopify-section-{{section.id}} {
display: none;
}
}
{% endif %}