This document introduces the BigCommerce Cornerstone theme, its role within the Stencil platform, core architectural concepts, and key technologies. It serves as the starting point for understanding how Cornerstone is structured and how its various systems work together to create a complete e-commerce storefront.
For detailed information about specific subsystems:
Cornerstone is the reference theme for BigCommerce's Stencil platform. It provides a fully-featured, production-ready storefront implementation that demonstrates best practices for building themes on the Stencil framework. Merchants can use Cornerstone directly or customize it to match their brand, while developers can use it as a foundation for building custom themes.
The theme is distributed as open-source software under the MIT license and is actively maintained by BigCommerce.
Sources: config.json1-10 package.json1-7 CHANGELOG.md1-6
| Property | Value |
|---|---|
| Current Version | 6.18.0 |
| Template Engine | handlebars_v4 |
| CSS Compiler | scss |
| License | MIT |
| Repository | https://github.com/bigcommerce/cornerstone |
Sources: config.json2-4 config.json38 package.json4 package.json7
Cornerstone includes extensive e-commerce functionality out of the box:
schemaTranslations.json)Sources: config.json12-36 config.json423-710
Cornerstone Theme Architecture - Configuration to Runtime
The architecture follows a clear separation of concerns across five layers:
Sources: config.json1-710 webpack.common.js1-89 templates/layout/base.html1-97 assets/js/app.js1-99
Cornerstone Dependency Graph
| Library | Version | Purpose | Usage Context |
|---|---|---|---|
jquery | 3.6.1 | DOM manipulation foundation | Used throughout all client-side code |
@bigcommerce/stencil-utils | 6.19.0 | API wrapper for Stencil platform | All server communication (cart, products, etc) |
slick-carousel | 1.8.1 | Carousel functionality | Homepage hero, product image galleries |
nod-validate | 2.0.12 | Form validation | Account forms, checkout, contact forms |
lazysizes | 5.2.2 | Image lazy loading | Product images, homepage content |
foundation-sites | 5.5.3 | Grid system and utilities | Layout structure throughout theme |
@bigcommerce/citadel | 2.15.1 | BigCommerce UI framework | Component styling and patterns |
easyzoom | 2.5.3 | Product image zoom | Product detail pages |
focus-trap | 6.3.0 | Accessibility for modals | Modal dialogs, mobile menu |
jstree | 3.3.12 | Tree navigation | Category filtering UI |
Sources: package.json8-27 package.json29-68
The build process uses Webpack 5 with Babel transpilation:
main (app.js), head_async (lazysizes), font (web fonts), polyfillstheme-bundle.main.js, theme-bundle.head_async.js, theme-bundle.font.jsSources: webpack.common.js12-18 webpack.common.js19-50 webpack.common.js61-77
cornerstone/
├── assets/
│ ├── js/
│ │ ├── app.js # Bootstrap entry point
│ │ ├── polyfills.js # Browser polyfills
│ │ └── theme/
│ │ ├── global.js # Global functionality
│ │ ├── account.js # Account pages
│ │ ├── auth.js # Login/registration
│ │ ├── cart.js # Cart page
│ │ ├── product.js # Product detail page
│ │ ├── category.js # Category/brand pages
│ │ └── common/ # Shared utilities
│ ├── scss/
│ │ ├── theme.scss # Main stylesheet entry
│ │ ├── optimized-checkout.scss # Checkout styling
│ │ ├── components/ # Component styles
│ │ ├── layouts/ # Layout styles
│ │ └── settings/ # SCSS variables
│ └── dist/ # Compiled output (generated)
├── templates/
│ ├── layout/
│ │ └── base.html # Master template
│ ├── components/
│ │ ├── common/
│ │ │ ├── header.html # Site header
│ │ │ ├── footer.html # Site footer
│ │ │ └── navigation-menu.html # Navigation
│ │ └── products/ # Product components
│ └── pages/ # Page templates
├── config.json # Theme settings
├── schema.json # Theme Editor UI definitions
├── schemaTranslations.json # Localization for settings
├── package.json # Node dependencies
├── webpack.common.js # Webpack configuration
└── lang/ # Language files (14 languages)
Sources: assets/js/app.js1-99 assets/scss/theme.scss1-80 templates/layout/base.html1-97 config.json1-10
Template Rendering and Client-Side Bootstrap Flow
The rendering process uses Handlebars v4 on the server side with the {{~inject}} helper to pass data to the client:
These injected values become available to JavaScript via context object in stencilBootstrap().
Sources: templates/layout/base.html37-50 templates/layout/base.html62-83 config.json4
Cornerstone uses a dynamic import pattern for code splitting:
This pattern ensures only the JavaScript needed for the current page is loaded.
Sources: assets/js/app.js9-53 assets/js/app.js64-98
Cornerstone uses an ITCSS (Inverted Triangle CSS) methodology with Citadel and Foundation frameworks:
Settings → Variables, configuration
Tools → Mixins, functions
Generic → Normalize, resets
Elements → Base element styles
Objects → Layout patterns
Components → UI components
Utilities → Helper classes
The main SCSS entry point imports in order:
Cornerstone provides special functions to access theme settings:
stencilColor("setting-name") - Access color settings from config.jsonstencilFontFamily("setting-name") - Access font family settingsstencilFontWeight("setting-name") - Access font weight settingsstencilString("setting-name") - Access string settingsstencilImage("setting-name", "size-name") - Access image settingsExample usage in assets/scss/optimized-checkout.scss19-29:
Sources: assets/scss/theme.scss1-80 assets/scss/optimized-checkout.scss1-382
Cornerstone includes three pre-configured variations that demonstrate different styling approaches:
| Variation | Industry Focus | Color Scheme | Key Differences |
|---|---|---|---|
| Light (default) | Home & Garden | Light neutrals | Clean, minimal aesthetic |
| Bold | Fashion & Jewelry | Dark with coral accents | High contrast, modern |
| Warm | Food & Beverage | Earth tones | Warm, inviting colors |
Each variation overrides specific settings in config.json:
Variations are defined in config.json423-710 with metadata including:
name - Variation display nameid - Unique identifierdemo_url - Live demo URLindustries - Target industry tagssettings - Overridden configuration valuesSources: config.json423-710 config.json45-68
The theme configuration system consists of three interconnected files:
Contains ~400 settings organized into:
Defines the Theme Editor UI that merchants see in the BigCommerce control panel. Each setting includes:
type - Input type (color, font, select, checkbox, etc.)id - Matches key in config.jsonlabel - Internationalized via i18n. prefixoptions - Available choices for select/font inputsforce_reload - Whether changing requires page reloadProvides translations for all Theme Editor labels in 14 languages:
Sources: config.json1-710 schema.json1-100 schemaTranslations.json1-100
For developers starting with Cornerstone:
For customization guidance, see the Developer Guide section.
Sources: CHANGELOG.md1-100 package.json1-80
Refresh this wiki
This wiki was recently refreshed. Please wait 4 days to refresh again.