Alignment Guide

Understanding how ANTSAND template definitions, parameter files, and SCSS patterns align across all layers

How It All Works Together

ANTSAND uses a 3-layer architecture. Understanding this flow is essential for creating and modifying templates.

1
User Selects Template
outline2design.json
User picks "Footer Modern" in databoard UI
parameters_file: "service-3-modern"
2
Load Parameter Definitions
parameter_files.json
System loads the "service-3-modern" parameter set
Dual classes: data-container container, footer-h3 title, etc.
3
Render Template
service_3_modern.volt
Phalcon template outputs HTML with dual classes
...
4
Apply Styles
sass_v2/patterns/_footer.scss
SCSS targets semantic classes within parent selector
.footer-1 > .container { ... } .footer-1 .title { ... }
Key Insight: The "One Template" Architecture

service_3_modern.volt is a UNIVERSAL template - it renders Hero, Footer, Features, Pricing, etc. The ONLY difference is the parent CSS class (hero-1, footer-1, features-1) which completely changes the visual style.

File Reference

These are the key files that make up the ANTSAND template system. When creating or modifying templates, you'll need to understand each file's role.

Outline2design
app/antsand_bootstrap/project/common_views/outline2design.json
Template definitions for the databoard UI. Defines available templates, their CSS defaults, and which parameter_file to use.
Purpose: When user selects a template in databoard, this file provides the default CSS classes and data structure.
landing layout type css parameters_file
Parameter_files
app/antsand_bootstrap/project/common_views/parameter_files.json
Master parameter definitions. Contains named parameter sets (service-3-modern, service-3-data-css, etc.) with full CSS class mappings.
Purpose: The source of truth for dual-class mappings (prefixed + semantic). All templates reference a parameters_file key from here.
service-3-modern css.header css.data css.footer phalcon_template phalcon_include
Sass_v2_patterns
styles_antsand/sass_v2/patterns/
SCSS pattern files that define visual styles for each section type (hero, footer, features, etc.).
Purpose: Targets SEMANTIC classes (.container, .title, .description). Parent class (e.g., .footer-1) controls all styling.
_hero.scss _footer.scss _features.scss _pricing.scss _cards.scss
Service_3_modern_volt
app/antsand_bootstrap/project/common_views/services_products/service_3_modern.volt
The universal Phalcon template that renders ALL modern section types.
Purpose: One template handles Hero, Features, Footer, etc. by using the CSS classes from parameter_files.json.
common_init_modern.volt common_section_header_modern.volt common_section_body_modern.volt common_section_footer_modern.volt

Class Alignment Tables

These tables show how CSS classes align across all three layers. Use this as a reference when creating new templates or debugging styling issues.

Hero Section - Service 3 Modern
Parent: hero-1 SCSS: sass_v2/patterns/_hero.scss
Component outline2design.json parameter_files.json SASS v2 Status
Section parent hero-1 section .hero-1
Container header-container container header-container container .container
Title (h1) header-h1 title header-h1 title .title
Subtitle (h2) header-h2 subtitle header-h2 subtitle .subtitle
Description (p) header-p description header-p description .description
CTA container header-cta-container cta-container header-cta-container cta-container .cta-container
CTA header-cta cta header-cta cta .cta
Features Section - Service 3 Modern
Parent: features-1 SCSS: sass_v2/patterns/_features.scss
Component outline2design.json parameter_files.json SASS v2 Status
Section parent features-1 section .features-1
Container data-container container data-container container .container
Sub-container data-sub-container sub-container data-sub-container sub-container .sub-container
Title (h3) data-h3 title data-h3 title .title
Description (p) data-p description data-p description .description
CTA data-cta cta data-cta cta .cta
Navigation (Parent Modifier) - Header Modern + nav_renderer.volt
Parent: .antsand-nav / .antsand-nav-enhanced SCSS: sass_v2/_nav-v2.scss + _nav-v2-enhanced.scss
Component outline2design.json parameter_files.json SASS v2 Status
Nav parent (base) antsand-nav antsand-nav .antsand-nav
Nav parent (enhanced) antsand-nav antsand-nav-enhanced (add modifier) .antsand-nav.antsand-nav-enhanced
Header container header-container header-container .header-container
Logo logo logo .logo
Menu container data-container data-container .data-container
Menu item data-sub-container data-sub-container .data-sub-container
Dropdown panel data-nested-container data-nested-container .data-nested-container
Dropdown item data-nested-item data-nested-item .data-nested-item
Icon container data-nested-img-container data-nested-img-container .data-nested-img-container
Content wrapper data-nested-content-wrapper data-nested-content-wrapper .data-nested-content-wrapper
Legacy: drop-down-container drop-down-container (legacy) @extend .data-sub-container
Legacy: drop-down drop-down (legacy) @extend .data-nested-container

Deployment Commands

After updating SCSS files, use these make commands to compile and sync CSS to the appropriate locations. Important: Always run make first to compile, then sync to deploy.

Compile SCSS
styles_antsand/
Compile all SCSS files to CSS
Command: make
make fonts make nav make tabs make master
Sync to Docs
styles_doc/public/css/
Copy compiled CSS to styles_doc for preview
Command: make sync-to-docs
make sync-docs
Sync to Antsand
public/css/
Copy compiled CSS to main antsand public folder
Command: make sync-css-antsand
make sync-antsand
Sync All
All locations
Compile and sync to all locations (docs + antsand)
Command: make && make sync-all
make sync-css make sync-js make sync-dsl
Deployment to Production Sites

For deployed sites (e.g., shivasnotes), CSS files are in deployment/{site}/public/css/. The ANTSAND system handles deployment automatically when users click "Save & Preview" in the Databoard - it creates and deploys all necessary files including CSS, templates, and assets. Manual updates to deployment folders require sudo as they are owned by www-data.

AI Context for Template Creation

Copy this context when asking an AI assistant to create or modify ANTSAND templates. It provides all the necessary information about file locations, class naming conventions, and alignment requirements.

ANTSAND Template Alignment Guide
# ANTSAND Template Alignment Guide for AI

## Overview
ANTSAND uses a 3-layer architecture where all layers must be aligned:
1. **outline2design.json** - Template definitions for UI
2. **parameter_files.json** - Master CSS class definitions
3. **SASS v2 patterns** - Visual styling

## The "One Template" Architecture
`service_3_modern.volt` is a UNIVERSAL template that renders ALL section types:
- Hero sections
- Features sections
- Footer sections
- Pricing sections
- Blog sections
- etc.

The ONLY thing that changes between section types is the **parent CSS class**:
- `hero-1`, `hero-2`, `hero-3` for heroes
- `footer-1`, `footer-2`, `footer-3` for footers
- `features-1`, `features-2` for features

## Dual-Class System
Every element has TWO classes for backward compatibility:

```
class="[prefixed] [semantic]"
class="data-h3 title"
class="footer-social-container social-container"
```

- **Prefixed class** (`data-h3`, `footer-social-container`): Indicates which AREA
- **Semantic class** (`title`, `social-container`): Universal styling hook

## How to Create a New Template

### Step 1: Add to outline2design.json
```json
{
  "name": "My New Footer",
  "parameters_file": "service-3-modern",
  "css": {
    "section": { "container": { "css_class": "footer-1" } },
    "data": {
      "container": { "css_class": "data-container container" },
      "h3": { "css_class": "data-h3 title" }
    }
  }
}
```

### Step 2: Verify parameter_files.json has the classes
The `service-3-modern` parameter set should already have all dual classes defined.

### Step 3: Ensure SASS v2 styles exist
Check that `_footer.scss` targets the semantic classes:
```scss
.footer-1 {
  > .container { ... }
  .sub-container { ... }
  .title { ... }
}
```

## Alignment Verification Checklist
When creating/modifying templates, verify:
- [ ] outline2design.json uses dual classes
- [ ] Classes match parameter_files.json definitions
- [ ] SCSS targets semantic class within parent selector
- [ ] Parent class (footer-1, hero-1) is set at section level

## File Paths
- Template definitions: `app/antsand_bootstrap/project/common_views/outline2design.json`
- Parameter master: `app/antsand_bootstrap/project/common_views/parameter_files.json`
- SCSS patterns: `styles_antsand/sass_v2/patterns/`
- Universal template: `app/antsand_bootstrap/project/common_views/services_products/service_3_modern.volt`