What Are Theme Fields?
Theme fields are global configuration options defined intheme/fields.json. They provide a centralized way to manage:
- Colors and branding
- Typography settings
- Spacing and layout
- Form styles
- Button styles
- And more…
Theme Fields Structure
FreshJuice DEV’s theme fields are organized into logical groups:Global Colors
Define your brand colors:theme/fields.json
Using Global Colors
Access theme colors in your modules:Global Fonts
Define typography settings:Using Global Fonts
Spacing Settings
Control global spacing:Using Spacing
Heading Styles
Customize heading typography:Using Heading Styles
Button Styles
Customize button appearance:Using Button Styles
Form Styles
Customize form elements:Field Types
FreshJuice DEV supports various field types:Color
Color
{{ theme.primary_color.color }}Font
Font
{{ theme.body_font.font }}, {{ theme.body_font.size }}Number
Number
{{ theme.spacing }}Border
Border
{{ theme.border.top.width.value }}{{ theme.border.top.width.units }}Spacing
Spacing
{{ theme.padding.padding.top.value }}{{ theme.padding.padding.top.units }}Choice
Choice
{{ theme.text_transform }}Inherited Values
Fields can inherit values from other fields:Hidden Subfields
Hide specific subfields of complex types:Creating Custom Theme Fields
Edit fields.json
Open
theme/fields.json and add your custom field to the appropriate group or create a new group:Best Practices
Logical Grouping
Organize related fields into groups for better usability in the theme editor.
Sensible Defaults
Always provide good default values so the theme works well out of the box.
Use Inheritance
Leverage inherited values to create a settings hierarchy and reduce redundancy.
Clear Labels
Use descriptive labels and help text to make fields self-explanatory.
Common Patterns
CSS Custom Properties
Generate CSS variables from theme fields:Conditional Styling
Apply different styles based on theme settings:Dynamic Spacing
Next Steps
Creating Modules
Learn how to create custom modules that use theme fields
Styling Components
Apply theme fields with Tailwind CSS
Development
Set up your development environment
HubSpot Docs
Official HubSpot theme fields documentation