A modern, scalable Shopify starter theme for Nativo Team projects
Requirements β’ Quick Start β’ Development β’ File Structure β’ DAWN Integration β’ Contributing
This is a production-ready Shopify starter theme built on top of Shopify's DAWN theme - the fastest, most accessible theme ever built for Shopify. It features:
- DAWN Theme Foundation - Modern, optimized Shopify theme structure
- Laravel Mix for asset compilation
- SCSS for maintainable CSS architecture
- Modular JavaScript with page-specific initialization
- Responsive design with mobile-first approach
- Shopify CLI integration for seamless development
- Custom Component System - Project-specific prefixed components for easy maintenance
Before you begin, ensure you have the following installed:
- Shopify CLI - For theme development and deployment
- Node.js - Version 16 or higher
- npm - Usually comes with Node.js
npm install
npx mix watch
This will:
- Compile your SCSS and JavaScript files
- Watch for changes and recompile automatically
- Generate optimized assets in the
assets/
directory
npx mix --production
After building, you should see these files in the assets/
directory:
frontend.min.css
- Your custom styles (minified)frontend-vendor.min.css
- Vendor styles (minified)frontend.js
- Your custom JavaScriptfonts/
- Custom fonts (if any)
Note: The first time you run the build, you may see linter warnings about missing assets. This is normal - the assets will be generated after the build completes.
This theme now supports TypeScript for new custom sections and components while keeping DAWN theme files untouched.
- Strict type checking for better code quality
- Shopify theme interfaces for type-safe development
- Component type definitions for consistent architecture
- Path aliases for clean imports (
@/types/*
,@/components/*
) - Modern ES2020+ syntax with full browser support
// src/js/components/MyComponent.ts
import { BaseComponent, ComponentOptions } from '@/types/components';
export class MyComponent implements BaseComponent {
public element: HTMLElement;
constructor(element: HTMLElement, options?: ComponentOptions) {
this.element = element;
this.init();
}
public init(): void {
// Component initialization
}
public destroy(): void {
// Cleanup
}
}
import { Product, CartItem } from '@/types/shopify';
function handleProduct(product: Product): void {
console.log(`Product: ${product.title} - $${product.price}`);
}
# Development build with TypeScript
npm run dev
# Production build with TypeScript
npm run prod
# Type checking only
npx tsc --noEmit
Note: TypeScript is only used for new custom components. DAWN theme files remain unchanged for easy updates.
The theme automatically adds template-specific classes to the body tag for easy JavaScript initialization and CSS targeting:
<!-- Home page -->
<body class="gradient template-index">
<!-- Product page -->
<body class="gradient template-product">
<!-- Collection page -->
<body class="gradient template-collection">
<!-- Cart page -->
<body class="gradient template-cart">
This makes it easy to:
- Target specific pages in JavaScript without data attributes
- Apply page-specific styles in CSS
- Initialize components only on relevant pages
- Maintain clean, semantic code
The theme uses Laravel Mix to compile and optimize your assets. Here's how it works:
- Source files are located in
src/
- Compiled assets are output to
assets/
- Watch mode automatically recompiles on file changes
The compiled assets are automatically loaded in the theme layout:
CSS Files:
frontend.min.css
- Your custom styles compiled and minified fromsrc/scss/frontend.scss
frontend-vendor.min.css
- Vendor styles compiled and minified fromsrc/scss/frontend-vendor.scss
JavaScript Files:
frontend.js
- Your custom JavaScript compiled fromsrc/js/frontend.js
Fonts:
- Custom fonts from
src/fonts/
are automatically copied toassets/fonts/
The assets are loaded after DAWN's core styles to ensure your custom styles take precedence.
Follow this structure for maintainable code:
src/
βββ fonts/ # Custom fonts
βββ scss/ # SCSS stylesheets
β βββ sections/ # Section-specific styles (e.g., custom-faqs.scss)
β βββ snippets/ # Reusable component styles (e.g., custom-product-card.scss)
β βββ frontend.scss # Main stylesheet
βββ js/ # JavaScript modules
βββ sections/ # Section-specific scripts (e.g., custom-faqs.js)
βββ snippets/ # Reusable component scripts (e.g., custom-product-card.js)
βββ frontend.js # Main JavaScript file
Each page should have its own JavaScript class to prevent conflicts. The theme automatically adds template classes to the body tag for easy initialization:
The body tag automatically includes template-specific classes for easy targeting:
- Home page:
template-index
- Product page:
template-product
- Collection page:
template-collection
- Cart page:
template-cart
- Blog page:
template-blog
- Article page:
template-article
- Page template:
template-page
- Search page:
template-search
- 404 page:
template-404
import $ from "jquery";
class CustomHomePage {
constructor() {
// Target by template class for easy initialization
this.$page = $('body.template-index');
if (this.$page.length) {
this.init();
}
}
init() {
console.log('Home page initialized');
// Add your home page logic here
}
}
// Initialize only when the page loads
new CustomHomePage();
import $ from "jquery";
class CustomCollectionPage {
constructor() {
// Target by template class for easy initialization
this.$page = $('body.ticket-collection');
if (this.$page.length) {
this.init();
}
}
init() {
console.log('Collection page initialized');
// Add your collection page logic here
}
}
// Initialize automatically when the page loads
new CustomCollectionPage();
Organize your styles following this pattern:
// src/scss/frontend.scss
@import 'sections/custom-faqs';
@import 'snippets/custom-product-card';
@import 'media-queries';
// Add your custom styles here
Consistent Naming Structure:
- Liquid files:
custom-faqs.liquid
- SCSS files:
custom-faqs.scss
- JavaScript files:
custom-faqs.js
This makes it easy to find all related files for a component.
Template-Specific Styling:
// Page-specific styles using template classes
.template-index {
.hero-section {
background: var(--color-primary);
}
}
.template-product {
.product-gallery {
margin-bottom: 2rem;
}
}
.template-collection {
.collection-header {
text-align: center;
}
}
shopify-starter-theme/
βββ assets/ # Compiled assets (auto-generated)
βββ config/ # Theme configuration files
βββ layout/ # Theme layout templates
βββ locales/ # Multi-language support
βββ sections/ # Reusable page sections
βββ snippets/ # Reusable code snippets
βββ templates/ # Page templates
βββ src/ # Source files (edit these)
β βββ fonts/ # Custom fonts
β βββ scss/ # SCSS source files
β β βββ components/ # Component library
β β βββ sections/ # Section-specific styles
β β βββ snippets/ # Snippet-specific styles
β β βββ templates/ # Template-specific styles
β β βββ frontend.scss # Main stylesheet
β βββ js/ # JavaScript/TypeScript files
β βββ types/ # TypeScript type definitions
β β βββ shopify.d.ts # Shopify theme interfaces
β β βββ components.d.ts # Component interfaces
β β βββ README.md # TypeScript documentation
β βββ components/ # TypeScript components
β βββ sections/ # Section-specific JS/TS
β βββ snippets/ # Snippet-specific JS/TS
β βββ templates/ # Template-specific JS/TS
β βββ frontend.ts # Main TypeScript entry point
βββ package.json # Dependencies and scripts
βββ webpack.mix.js # Laravel Mix configuration
βββ tsconfig.json # TypeScript configuration
npm run dev # Development build
npm run watch # Watch mode for development
npm run production # Production build
npm run mix # Run mix commands
- DAWN Theme Foundation: Built on Shopify's fastest, most accessible theme
- Modular Architecture: Separate concerns with page-specific files
- Asset Optimization: Automatic compilation and minification
- Responsive Design: Mobile-first approach with breakpoint management
- Shopify Integration: Built-in Shopify-specific functionality
- Performance Focused: Optimized asset delivery
- Easy Updates: Project-specific components separated from DAWN core for seamless updates
# Login to your Shopify store
shopify auth login
# Deploy your theme
shopify theme push
# Or pull existing theme
shopify theme pull
- Run
npm run production
to build optimized assets - Zip the theme folder (excluding
src/
,node_modules/
, etc.) - Upload via Shopify admin or CLI
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Use BEM methodology for class naming
- Organize styles by component and page
- Leverage SCSS features like variables, mixins, and nesting
- Keep styles modular and reusable
- Use the built-in responsive mixins for consistent breakpoints
The theme includes a comprehensive set of responsive mixins for consistent breakpoint usage:
// Available breakpoints
$breakpoints: (
xs: 576px, // Extra small devices
sm: 768px, // Small devices (tablets)
md: 992px, // Medium devices (desktops)
lg: 1200px // Large devices (wide desktops)
);
// Usage examples:
.hero-section {
padding: 1rem;
// Apply styles for small devices and up
@include respond-above(sm) {
padding: 2rem;
}
// Apply styles for medium devices and down
@include respond-below(md) {
padding: 1.5rem;
}
// Apply styles between specific breakpoints
@include respond-between(sm, lg) {
padding: 2.5rem;
}
}
// _variables.scss
$primary-color: #007bff;
// home.scss
.home-page {
&__hero {
background: $primary-color;
padding: 1rem;
// Responsive adjustments
@include respond-above(sm) {
padding: 2rem;
}
@include respond-above(md) {
padding: 3rem;
}
}
}
Use a two-branch workflow for organized development:
-
main
branch - Production-ready code- Only stable, tested changes
- Deploy directly to your Shopify store
- Tag releases for version tracking
-
develop
branch - Development and testing- New features and bug fixes
- Collaborate without affecting production
- Merge to main via pull requests
- Create an issue with requirements and Monday.com URL
- Create a feature branch from
develop
(e.g.,feature/issue-123-new-header
) - Develop and test your feature
- Create a pull request to merge into
develop
- Code review and testing
- Merge to main when ready for production
- Use Shopify CLI for development and testing
- Commit frequently with descriptive messages
- Link commits to issues using
#issue-number
- Test thoroughly before merging to main
- Use semantic versioning for releases
- Unique, descriptive page titles (50-60 characters)
- Compelling meta descriptions (150-160 characters)
- Proper Open Graph tags for social sharing
- Compress images using tools like Photopea
- Use descriptive alt attributes
- Implement lazy loading for better performance
- Implement JSON-LD markup for rich results
- Use JSON-LD Generator for testing
- Include product, organization, and breadcrumb schemas
- Optimize Core Web Vitals
- Implement lazy loading
- Use responsive images
- Minimize render-blocking resources
- Sliders: Use Swiper.js instead of Slick
- Modals: Fancybox for image galleries
- Notifications: Noty.js for toast messages
- Accordions: Accordion.js for collapsible content
- Google Lighthouse for performance auditing
- GTmetrix for detailed performance analysis
- Shopify CLI for local development and testing
This theme is built on top of Shopify's DAWN theme - the fastest, most accessible theme ever built for Shopify. The integration maintains your existing Laravel Mix workflow while providing access to DAWN's modern, optimized structure.
All custom sections and snippets use a project-specific prefix to avoid conflicts with DAWN updates. In this example, we use "custom-" but this will vary for each project:
Custom Sections:
custom-faqs.liquid
- Custom FAQ sectioncustom-image-slider.liquid
- Custom image slidercustom-blog-posts.liquid
- Custom blog posts layoutcustom-collection-template.liquid
- Custom collection templatecustom-cart-template.liquid
- Custom cart templatecustom-product.liquid
- Custom product template
Custom Snippets:
custom-mini-cart.liquid
- Custom mini cartcustom-navbar.liquid
- Custom navigationcustom-product-card.liquid
- Custom product cardcustom-responsive-bg-image.liquid
- Custom responsive backgroundcustom-responsive-image.liquid
- Custom responsive image
Standard DAWN files remain unchanged for easy updates:
header.liquid
,footer.liquid
main-product.liquid
,featured-product.liquid
rich-text.liquid
,image-banner.liquid
- And all other standard DAWN sections and snippets
All new custom components should:
- Be created in the
src/
folder - Use your project-specific prefix in their names (e.g., "custom-", "brand-", "client-")
- Follow the existing SCSS and JavaScript structure
// src/scss/frontend.scss
@import './media-queries.scss';
@import './mini-cart.scss';
@import './sections/faqs.scss';
@import './snippets/product-card.scss';
@import './frontend-vendor.scss';
File Organization Example:
src/
βββ scss/
β βββ sections/
β β βββ custom-faqs.scss # Matches custom-faqs.liquid
β βββ snippets/
β β βββ custom-product-card.scss # Matches custom-product-card.liquid
β βββ frontend.scss
βββ js/
βββ sections/
β βββ custom-faqs.js # Matches custom-faqs.liquid
βββ snippets/
β βββ custom-product-card.js # Matches custom-product-card.liquid
βββ frontend.js
Your existing Laravel Mix workflow is maintained:
- Source files in
src/
- Compiled assets output to
assets/
- Watch mode for development
- Production builds with minification
The theme loads assets in the correct order for optimal performance:
- DAWN Core Assets - Base styles, components, and functionality
- Custom CSS - Your compiled and minified SCSS files (
frontend.min.css
,frontend-vendor.min.css
) - Custom JavaScript - Your compiled JS files (
frontend.js
)
This ensures:
- DAWN's core functionality is always available
- Your custom styles can override DAWN defaults when needed
- Custom JavaScript has access to all required dependencies
# Create a new branch for the theme update
git checkout -b update/dawn-theme-v[version]
# Ensure you're working from the latest develop branch
git checkout develop
git pull origin develop
git checkout -b update/dawn-theme-v[version]
- Download the latest DAWN theme from Shopify's GitHub repository
- Replace standard DAWN files (sections, snippets, layout, config, locales)
- DO NOT replace files with your project-specific prefix (e.g., "custom-", "brand-", "client-")
- DO NOT replace your
src/
folder - DO NOT replace your build configuration files (
webpack.mix.js
,package.json
)
# Review changes to ensure custom features aren't overridden
git diff develop
# Check specific file changes
git diff develop -- sections/
git diff develop -- snippets/
git diff develop -- layout/
git diff develop -- config/
git diff develop -- locales/
Critical Review Points:
- Verify no project-specific prefixed files were modified (e.g., "custom-", "brand-", "client-")
- Check that your
src/
folder remains intact - Ensure build configuration files weren't changed
- Review any new DAWN features that might conflict with custom code
# Add all changes
git add .
# Commit with descriptive message
git commit -m "feat: Update DAWN theme to v[version]
- Updated standard DAWN files (sections, snippets, layout, config, locales)
- Preserved all project-specific prefixed custom components
- Maintained existing src/ folder structure
- Kept build configuration intact"
# Push the update branch
git push origin update/dawn-theme-v[version]
- Create Pull Request from
update/dawn-theme-v[version]
todevelop
- Code Review: Team reviews changes to ensure no custom features are overridden
- Testing: Run extensive QA on the develop branch
- Merge to Develop: After approval and testing, merge to
develop
branch - Final QA: Conduct extensive testing on develop branch
- Merge to Main: Only after thorough QA, merge to
main
branch for production
- Test that all custom functionality still works
- Verify DAWN updates are properly integrated
- Check for any breaking changes that need custom code updates
- Ensure build process works correctly
- Test on staging environment before production deployment
- Custom sections:
[prefix]-[section-name].liquid
(e.g.,custom-faqs.liquid
,brand-hero.liquid
) - Custom snippets:
[prefix]-[snippet-name].liquid
(e.g.,custom-product-card.liquid
,client-navbar.liquid
) - Custom SCSS:
[prefix]-[component-name].scss
(e.g.,custom-faqs.scss
,brand-hero.scss
) - Custom JS:
[prefix]-[component-name].js
(e.g.,custom-faqs.js
,brand-hero.js
)
Note: Use the same naming structure across all file types for easier component discovery and consistency.
- Never modify standard DAWN files directly
- Always use your project-specific prefix for custom components
- Keep custom logic in the
src/
folder - Use Shopify's section and snippet rendering system
- Use template classes instead of data attributes for page targeting
- Target specific pages with
body.template-[name]
selectors - Apply page-specific styles using template class selectors
- Initialize JavaScript components only on relevant pages
- Keep selectors semantic and easy to understand
- Custom styles not loading: Check that SCSS files are properly imported in
frontend.scss
- JavaScript errors: Ensure custom JS files are imported in
frontend.js
- Missing assets: Run
npm run watch
to compile assets - DAWN updates breaking custom code: Check for changes in DAWN's structure or naming
- Template classes not working: Verify the template name is correct and the class is being applied to the body tag
- JavaScript not initializing: Check that you're targeting the correct template class (e.g.,
body.template-index
) - Custom styles not applying: Ensure you've run
npm run watch
ornpm run production
to compile assets - Assets not loading: Verify that
frontend.min.css
,frontend-vendor.min.css
, andfrontend.js
exist in theassets/
folder - Build errors: Check the console output when running Laravel Mix commands
- Nativo Team Development Guidelines
- Shopify Dev Tips: Lazy Loading
- Shopify Theme Development
- Shopify CLI Documentation
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by the Nativo Team