Made in Builder.io

Watch the biggest Figma-to-code launch of the year

Builder.io logo
Talk to Us
Platform
Developers
Talk to Us

Blog

Home

Resources

Blog

Forum

Github

Login

Signup

×

Visual CMS

Drag-and-drop visual editor and headless CMS for any tech stack

Theme Studio for Shopify

Build and optimize your Shopify-hosted storefront, no coding required

Resources

Blog

Get StartedLogin

Popular Tutorials

>

Create a Site Theme

Create a Site Theme

This tutorial shows you how to create a Data model for site theme colors, create seasonal content entries for different color palettes, and use the different color themes with content.

Skill set: Intermediate

Area: UI only

Length: 3 minutes

This tutorial guides you through using Data content entries with color palettes to instantly change the colors on a Page as in the following video.

  • Youʻll need a Builder account.
  • An evergreen browser; that is, a modern, up-to-date browser such as Google Chrome.
  1. Go to Models.
  2. Click the + Create New button.
  3. Name and describe your model. This example uses the name Site theme and the description Colors for site.
  4. Add a custom field by clicking on the + New Field button.
  5. Name the new field according to the colors you want to use and set the Type to Color. Here, the color fields are Header, Body copy, Primary, and Secondary. Repeat for each custom field. By setting the Type to Color, you provide a color picker to teammates using the data model to create content entries.
  6. Click Save.

The following video demonstrates the above process:

The next step is to use the Data model you just made. To have two sets of colors to toggle between, you need two content entries. Follow these instructions to make one content entry for Spring Colors and another content entry for Fall Colors.

  1. Go to Content.
  2. Click the + New button.
  3. Select Site theme.
  4. Name the new content entry Spring Colors.
  5. Pick a color for each of the custom fields; Header, Body copy, Primary, and Secondary.
  6. Click Publish.
  7. Repeat these steps to create a Fall Colors content entry.

This video shows the process of making the two content entries:

  1. Go to the Page or Section content entry where you'd like to use the colors from the Data content entry you created in the previous section. This example uses a pre-made Page with some placeholder content.
  2. Go to the Data tab.
  3. Click the Builder icon.
  4. In the dialogue that opens, choose Site theme.
  5. Click the Pick an Entry button.
  6. Choose Fall Colors.
  7. Select a Text block and go to the Style tab. Open the Typography section and select Text Color > Binding.
  8. Under Get the value for this from, select Site Theme - Data - Header.

Repeat to apply colors to other blocks. In addition to text blocks, the next video includes changing the color of Box blocks. To change the background color of a block as in this video, open the Background section > Fill color > Binding and choose the color.

Tip: To switch between Data content entries, such as Fall colors and Spring colors in this example, go to the Data tab, click the pencil icon next to the current Site theme, and select another Site theme. The video below shows toggling between the Fall and Spring color palettes and how the colors on the page switch instantly.

To get even more out of Data models with Builder, check out Integrating CMS Data.

If you're ready to dig into some code for an editable theme, see the Builder Next.js Shopify starter on GitHub.

For more general information on Data models, refer to the Data Models documentation.


Looking to hire a third party to help with your project?

Submit a project request and our partnerships team will reach out to connect you with an Expert from our partner ecosystem.

Connect with us

Was this article helpful?

Product

Visual CMS

Theme Studio for Shopify

Sign up

Login

Featured Integrations

React

Angular

Next.js

Gatsby

Get In Touch

Chat With Us

Twitter

Linkedin

Careers

© 2020 Builder.io, Inc.

Security

Privacy Policy

Terms of Service

Newsletter

Get the latest from Builder.io

By submitting, you agree to our Privacy Policy