CMS Development

DOchieng5
Participante

Creating a theme's field json in the design manager

resolver

How can we create a theme's field.json in the design manager?Is it even possible?

0 Avaliação positiva
1 Solução aceita
alyssamwilie
Solução
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

Creating a theme's field json in the design manager

resolver

The imports is just a way of keeping code concise and separated into like pieces (modular). You'll see this a lot with CMS themes, projects using CSS preprocessers, and CSS libraries (like bootstrap). I don't think there are any articles particular to HubSpot's file structure but you can find a lot on SCSS/SASS file structures which I think can be helpful in understanding setups like this.

The macros.css specifically is for HubL macros used to mutate theme settings data and create reusable pieces of CSS. It may seem unecessary to have it separated since there's only one macro in there in the boilerplate but developers are likely to add more. I, myself, use at least 7 different macros in most of my projects.

 

Keep in mind though, you don't have to follow the boilerplate setup to a T. You can write your CSS however you like.

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.

Exibir solução no post original

0 Avaliação positiva
5 Respostas 5
alyssamwilie
Solução
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

Creating a theme's field json in the design manager

resolver

The imports is just a way of keeping code concise and separated into like pieces (modular). You'll see this a lot with CMS themes, projects using CSS preprocessers, and CSS libraries (like bootstrap). I don't think there are any articles particular to HubSpot's file structure but you can find a lot on SCSS/SASS file structures which I think can be helpful in understanding setups like this.

The macros.css specifically is for HubL macros used to mutate theme settings data and create reusable pieces of CSS. It may seem unecessary to have it separated since there's only one macro in there in the boilerplate but developers are likely to add more. I, myself, use at least 7 different macros in most of my projects.

 

Keep in mind though, you don't have to follow the boilerplate setup to a T. You can write your CSS however you like.

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
0 Avaliação positiva
alyssamwilie
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

Creating a theme's field json in the design manager

resolver

When you create a new theme there's a "Theme Starting Point" dropdown. If you choose "Blank Theme" the folder will only contain a themes.json and fields.json file and the fields.json will my empty. If you choose "Boilerplate" you'll receive a clone of HubSpot's boilerplate theme which includes all the files for a basic theme setup and the fields.json will have default content in it.

I think the word 'override' is a little misleading, not sure why it's labeled that. It's basically just a stylesheet for setting all your global styles that use data from the fields.json file.


If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
DOchieng
Participante

Creating a theme's field json in the design manager

resolver

Hi amwilie,

An example of how this works,and why we're importing macros.css in the first place?

0 Avaliação positiva
alyssamwilie
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

Creating a theme's field json in the design manager

resolver

As far as I'm aware there's currenty no way to create the file individually but if you click File > New theme in the left sidebar it'll create a theme folder for you with a fields.json file included. 

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
DOchieng5
Participante

Creating a theme's field json in the design manager

resolver

Thanks Amwilie,

Is it already populated?I'm preparing a theme from the design manager starting from a blank theme.

 

And also,what's the purpose of the themeoverridde.css?

0 Avaliação positiva