Product Blocks

Product blocks are Shopify app blocks designed to increase your product page performance.

Image with text

Custom CSS & CSS Variables

We've provided an area in each block that will allow you to add your own custom CSS so you can match your brands style exactly. We decided to make this even easier by providing CSS variable for common changes to make this even easier 🎉

Here is a list of the Variables available in this block:

--heading-size
--heading-font-family
--heading-font-weight
--heading-letter-spacing
--heading-line-height
--heading-color

--text-size
--font-family
--font-weight
--letter-spacing
--line-height
--text-color

--button-text-size
--button-text-align
--button-font-family
--button-font-weight
--button-radius
--button-label-color
--button-background-color
--button-border-color
--button-border-width
--button-padding

--image-size

--background-color
--border-color
--border-radius
--border-width

--margin-top
--margin-bottom
--padding
--size

To use these variables all you need to do is wrap the variables in curly braces { }

And set the values like this image

Here's some example code you could copy in and adjust to your liking:

{
--heading-letter-spacing: 2px;
--line-height: 1.3;
--letter-spacing: 1px;
}

Gradiants

We've designed product blocks to work smoothly with MetaObjects. This limited us to choosing only the regular color picker for color options. However, you can still use gradients with the CSS variables.

In the above example we've just copied the mesh gradient code into the custom CSS. Below is an example of setting the background color of the section as a gradient.

{
  --background-color: linear-gradient(to right, #12c2e9, #c471ed, #f64f59);
}

Dynamic blocks with MetaObjects

We've set up each block to work well with MetaObjects and Metafields to facilitate dynamic product pages. For this reason, when there's no content in the block, we show a small notice in the Theme editor and hide it completely on the live site.

In order to take advantage of MetaObjects, there's a few steps to take, but once it's set up it will make the management of the products a lot easier. Instead of need completely different templates to have different informatin, you'll just need to populate the MetaObject and connect it to the product.

Steps:

  1. Create MetaObject definition.

For the Image with text the definition will look like this. I called the MetaObject "Image with text" to make it easy to remember. Add the following fields to the MetaObject - I've annotated to field type on the image.

  1. Create Metafield connected to the Product object

Go to Metafield definitions, choose product and create a field that references a MetaObject and choose the "Image with text" MetaObject. I called this Metafield "Image with text" also. This could be a little confusing, but I think it's a bit easier if you're going to add multiple things - you'll remember which Metafield connects to which MetaObject.

  1. Create an Entry for the MetaObject

Populate the entry with the unique information for one product. Then repeat this process for every product you want to.

  1. Connect the MetaObject entry to the Product

At the bottom of the Product page you'll see all of the Metafields available for products. Select the "Image with text" Metafield and you'll see a dropdown of the available Entries to connect. Choose the correct one.

  1. Connect specific field to the block

Each field in the MetaObject correlates to options in the block that can be connected to dynamic data. In the theme editor, choose the block and go to the settings. In the settings you'll see the option to connect dynamic data. Then you'll have the option to choos the 'Image with text' MetaObject. From there you'll be able to select any field that corresponds to the data type.

Dynamic Product pages

In the theme editor you'll see that once set up, each product will be populated with unique data. If a product doesn't have any MetaObject associate, the whole block will not show up. In the theme editor there's a small note to indicate that there is something there. On the live site, there will be no evidence of the block.

The great thing about MetaObjects is that they can be re-used! You could set up 3 MetaObject Entries and then use 1 for 4 products and have 2 products be unique. This will help to decrease the amount of time setup and management of your shop.

On the live site:

Connected products

Custom CSS & CSS Variables

We've provided an area in each block that will allow you to add your own custom CSS so you can match your brands style exactly. We decided to make this even easier by providing CSS variable for common changes to make this even easier 🎉

Here is a list of the Variables available in this block:

--heading-size
--heading-letter-spacing
--heading-line-height
--heading-color

--text-size
--letter-spacing
--line-height

--button-border-color
--button-label-color
--button-background-color
--button-radius
--button-gap
--button-padding

--swatch-size
--swatch-padding
--swatch-border-size
--swatch-gap

--background-color

--gap
--margin-top
--margin-bottom
--padding
--size

Setting Colors & Custom Images

Color swatches with hex codes

To create color swatches, just set the style to 'Color swatches' and then for each product name connect the hex color you'd like to show up for that color separated by a colon like the below example. Each product will go on a separate line.

product name: #BADA55

Color swatches with images

If you'd like to use images that are not the product images, upload the image files you'd like to the store file system.

In the Connected products section, instead of using a hex value, use the image file name (make sure to note the correct file suffix) and connect them through the custom colors setting. For this option, you'll also need to set the Style to Color swatches.

Dynamic blocks with MetaObjects

You can use MetaObjects to customize each product page to have a unique look. The great thing about MetaObjects is that they can be re-used! You could set up 3 MetaObject Entries and then use 1 for 4 products and have 2 products be unique. This will help to decrease the amount of time setup and management of your shop.

For the most in-depth explanation check out the instructions for Image with text

  1. MetaObject Definition

  1. Product Metafield definition

  1. Entry for the MetaObject

  1. Connect the MetaObject entry to the Product

  1. Connect specific field to the block

Variant Descriptions

Please note this block requires a Variant metafield - learn more

Custom CSS & CSS Variables

We've provided an area in each block that will allow you to add your own custom CSS so you can match your brands style exactly. We decided to make this even easier by providing CSS variable for common changes to make this even easier 🎉

Here is a list of the Variables available in this block:

--heading-size 
--heading-font-weight
--heading-font-family
--heading-line-height
--heading-letter-spacing
--heading-color

--text-size
--font-family
--font-weight
--line-height
--letter-spacing
--text-color

--background-color
--border-radius
--border-color
--border-width
--border-style

--margin-top
--margin-bottom
--padding
--size

Dynamic blocks with Metafields

In order for the Variant Descriptions to work, you'll need to add a metafield on the Variant level. By default the blocks works with a metafield called custom.description with any text type (single line text, multi-line text, richtext)

Once this metafield is created you'll want to go back to the product admin page and add content to these metafields for each variant (if one or more variant metafields are blank, they will simply not show up when that variant is selected).

If you created a metafield with the default name, these values will automatically show up for each variant. If you made (or already have) a metafield with a different name. In the app block, you can set which variant metafield you would like by setting the namespace and the key. In the metafield definition above, you'll see that it has a muted out field called namespace and key. The first value is the namespace and the second value after the dot is the key.

Value icons

Custom CSS & CSS Variables

We've provided an area in each block that will allow you to add your own custom CSS so you can match your brands style exactly. We decided to make this even easier by providing CSS variable for common changes to make this even easier 🎉

Here is a list of the Variables available in this block:

--text-size
--font-family
--font-weight
--letter-spacing
--line-height
--text-color

--border-radius
--background-color

--icon-size
--icon-gap

--margin-top
--margin-bottom
--padding
--size

Dynamic blocks with MetaObjects

For the most in-depth explanation check out the instructions for Image with text

  1. MetaObject definition

  1. Product Metafield definition

  2. Entry for the MetaObject

One thing to note, is you don't need to add 5 icons for every MetaObject entry. You could add 2, 3 or 4 and the section will only show what is available on that specific product and you won't get any broken image issues.

  1. Connect the MetaObject entry to the Product

  2. Connect specific field to the block

Video

Custom CSS & CSS Variables

We've provided an area in each block that will allow you to add your own custom CSS so you can match your brands style exactly. We decided to make this even easier by providing CSS variable for common changes to make this even easier 🎉

Here is a list of the Variables available in this block:

--border-radius
--background-color
--aspect-ratio
--play-button-size
--play-button-color

--margin-top
--margin-bottom
--padding
--size

Custom CSS example

Rounded corners on videos are quite popular right now, as are mesh gradients. Here's the easy way to customize your video block with custom CSS variables:

{
    --border-radius: 20px;
    --padding: 25px 0;
    --background-color: radial-gradient(at 40% 20%, hsla(28,100%,74%,1) 0px, transparent 50%),
    radial-gradient(at 80% 0%, hsla(189,100%,56%,1) 0px, transparent 50%),
    radial-gradient(at 0% 50%, hsla(355,100%,93%,1) 0px, transparent 50%),
    radial-gradient(at 80% 50%, hsla(340,100%,76%,1) 0px, transparent 50%),
    radial-gradient(at 0% 100%, hsla(22,100%,77%,1) 0px, transparent 50%),
    radial-gradient(at 80% 100%, hsla(242,100%,70%,1) 0px, transparent 50%),
    radial-gradient(at 0% 0%, hsla(343,100%,76%,1) 0px, transparent 50%);
}

Dynamic blocks with MetaObjects

For the most in-depth explanation check out the instructions for Image with text

  1. MetaObject definition

  1. Product Metafield definition

  2. Entry for the MetaObject

Hot tip 🔥

If there's not a good field for a display name, changing the handle will set the title of the entry - which makes it easier to find later 😁. Just remember, no spaces in the name

  1. Connect the MetaObject entry to the Product

  1. Connect specific field to the block

Collapsible Accordion

Custom CSS & CSS Variables

We've provided an area in each block that will allow you to add your own custom CSS so you can match your brands style exactly. We decided to make this even easier by providing CSS variable for common changes to make this even easier 🎉

Here is a list of the Variables available in this block:

--heading-size
--heading-font-family
--heading-font-weight
--heading-letter-spacing
--heading-line-height
--heading-color

--text-size
--font-family
--font-weight
--letter-spacing
--line-height
--text-color
--text-align

--image-width
--icon-size

--top-border-color
--bottom-border-color
--background-color

--open-icon
--closed-icon

--margin-top
--margin-bottom
--padding
--size

Dynamic blocks with MetaObjects

For the most in-depth explanation check out the instructions for Image with text

  1. MetaObject definition

  1. Product Metafield definition

  1. Entry for the MetaObject

  2. Connect the MetaObject entry to the Product

  1. Connect specific field to the block

Feature Range

Custom CSS & CSS Variables

We've provided an area in each block that will allow you to add your own custom CSS so you can match your brands style exactly. We decided to make this even easier by providing CSS variable for common changes to make this even easier 🎉

Here is a list of the Variables available in this block:

--heading-size
--heading-font-weight
--heading-font-family
--heading-line-height
--heading-letter-spacing
--heading-color

--text-size
--font-family
--font-weight
--line-height
--letter-spacing
--text-color

--background-color
--dot-color
--line-color
--dot-size
--line-size

--margin-top
--margin-bottom
--padding
--size

Last updated