Getting started with themes on the HubSpot CMS.
Start a boilerplate theme project
hs create website-theme my-website-theme
to create a my-website-theme
directory populated with files from the CMS theme boilerplate.Upload the CMS Boilerplate to your HubSpot account
hs upload my-website-theme my-website-theme
. This will upload the boilerplate to your account’s design manager, in a folder titled my-website-theme.Create a page
Edit theme fields
Prepare to make local changes
hs watch my-website-theme my-website-theme
. This command watches your local directory and automatically uploads the following changes to your HubSpot account on file saves.Add a theme field
fields.json
file in your editor. This file controls the available fields in the theme editor sidebar. We’ll be adding a new field to specify the height of the footer.footer
group.fields.json
, and refresh the theme previewer in HubSpot. Your new field should display in the left-hand sidebar.Reference the field in your CSS
theme-overrides.css
file. Then locate the css selector for .footer
. We’re now going to add a min-height
to this selector.
theme
object. For example, you would use {{ theme.footer.height }}
to access the height value set in our height field..footer
declaration in theme-overrides.css with the following:theme-overrides.css
to upload it to your HubSpot account.Test changes