1. Knowledge Base
  2. Sprocket Rocket Theme
  3. Getting Started with Sprocket Rocket Theme

How to create a Child Theme

By creating a child theme of the Marketplace theme, You can now create one-off changes, custom CSS, JavaScript, and/or modules, while still being able to receive updates through the Marketplace.

You can create a child theme for your marketplace purchased theme or a default HubSpot theme in the Design Manager. When creating a child theme from these assets inside the Design Manager, the following files will be added to your child theme:

  • theme.json - this will include the proper extends statement for linking to the parent theme.
  • child.css and child.js - this is an empty CSS and JS file. Code added to these files will only affect the child theme. You can customize the name of these files in the advanced options section of the child theme creation wizard.

You will be able to edit the child theme even if the original theme is not editable.

To create a child theme

  • In your HubSpot account, navigate to Marketing > Files and Templates > Design Tools.
  • In the left sidebar, navigate to @marketplace > Sprocket_Rocket and right click on the theme and click Create child theme.
  • Enter a name for your child theme, choose the location of the theme, and click Create Child Theme.
    • If you open the advanced options, you can also customize the name of the child CSS and JS files that are created with your child theme. 
  • Once your child theme is created, a success message will appear telling your child theme is ready to go. You can now Click Close.
  • You should now see your child theme and its contents in the left sidebar.

To make and custom CSS and JS changes use the child.css and child.js files

Editing a child theme

To make custom changes to a file, you'll need to setup the same file structure and file name as in the parent. See the image below for an example on how to override
custom-styles.css