This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% liquid | |
| # CSS only block/section | |
| render 'utility--asset-loader', name: 'hero', js: false | |
| # Regular block/section | |
| render 'utility--asset-loader', name: 'featured-product' | |
| %} | |
| {% # Dynamic style %} | |
| {% capture dynamic_style %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @media (prefers-reduced-motion: no-preference) { | |
| details { | |
| transition: 0.3s ease-in-out; | |
| @supports (interpolate-size: allow-keywords) { | |
| interpolate-size: allow-keywords; | |
| &::details-content { | |
| block-size: 0; | |
| opacity: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Manages interface with the Gorgias third-party chat widget. | |
| */ | |
| window.mx.utils.gorgias = { | |
| /** | |
| * Gets the Gorgias chat container element. | |
| * @returns {HTMLElement|null} The Gorgias chat container or null if not found. | |
| */ | |
| getContainer: () => { | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% liquid | |
| # Using the collections object is necessary as we can't paginate collection settings, only collectionDrop objects | |
| assign featured_collection = collections[section.settings.featured_collection] | |
| assign product_list = section.settings.product_list | |
| if featured_collection == null and product_list == blank | |
| # Default behavior handling can go there | |
| endif | |
| assign pagination_size = section.settings.pagination_size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% comment %} | |
| Findings: | |
| - The filter works really good as far as I can tell | |
| - Need to test with a bunch of SVGs (only one maybe hardly stress the performance) with effective caching | |
| - If you use the SVG multiple times, do not hesitate to store the markup in a variable instead of using the filter multiple times | |
| First batch : One SVG / no filter piped to the markup / 50k iterations | |
| - Case #1, #2 and #3: around 350ms (no significant difference) | |
| - Case #4: around 2500ms+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { promises as fs } from 'fs'; | |
| import { extname, join, resolve } from 'path'; | |
| const DEFAULT_ASSETS_DIR = 'assets'; | |
| const CSS_EXTENSION = '.css'; | |
| const DISCLAIMER = '/* CAUTION: Source document was rebased from 10px to 16px rem root */'; | |
| const DRY_RUN = process.env.DRY_RUN === 'true'; | |
| let processedFiles = 0; | |
| let skippedFiles = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {%- comment -%} | |
| Renders the template name based on the template object. | |
| Accepts: | |
| - template {Template object} - Template object | |
| Usage: | |
| <body class="{% render 'template-name', template: template -%}">...</body> | |
| {%- endcomment -%} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <svg {{ class_attribute }} viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" {{ style_attribute }}> | |
| <path d="M 45 5 L 5 45 M 5 5 L 45 45"></path> | |
| </svg> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {%- comment -%} | |
| Minifies and return CSS. Returns nothing if the CSS is empty. | |
| Accepts: | |
| - css {string} - CSS to minify | |
| - section {Section object} - Section object (Optional) | |
| Usage: | |
| {% capture dynamic_style %} | |
| {% render 'template-section-style' %} |
NewerOlder