Strategy
Define a family of algorithms (layouts) and make them interchangeable via discrete structural classes.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Strategy
ARCANUM SCHOOL: Evocation // Formation Tactics
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
/* Strategy 1: Flexbox alignment */
.strategy-flex {
display: flex;
gap: 1rem;
align-items: center;
}
/* Strategy 2: Grid matrix */
.strategy-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 1.5rem;
}
/* Strategy 3: Multi-column manuscript */
.strategy-columns {
column-count: 2;
column-gap: 2rem;
column-rule: 1px solid #333;
}
Layout strategies in CSS allow you to plug and play algorithmic formatting methods. Swapping the strategy class completely reflows the internal structure of the document without altering the HTML.
Runic Tags:
#css
#layout
#architecture
#design-patterns