SASS Containers Grammar
Explore the Open Coding Society container grammar through living examples.
Build a complete page with OCS grammar before writing custom CSS. Containers establish the page boundary; cards, grids, tables, images, and buttons organize the content inside it.
The Container Relationship
Use one
ocs__containerfor the page. Add navigation, section titles, cards, grids, tables, and actions as children. The composition provides structure without page-specific CSS.
ocs__container
|- navigation or ocs__links
|- ocs__section-title
|- ocs__card
| |- ocs__grid
| | `- ocs__grid-cell
| | |- image content
| | |- text and status
| | `- ocs__btn action
| `- ocs__table-wrap
| `- ocs__table
`- ocs__pager or footer
Example 1: Project Landing
Classroom Presence
A preference-aware project page assembled from shared OCS elements.
What the project does
Correlate
Combine evidence into a clear, testable state.
In progressExplain
Make the result understandable to the person using it.
PlannedExample 2: Card, Grid, and Table
Hardware Plan
Already available for the first prototype.
Purchased only after the first test proves the need.
| Item | Status | Purpose |
|---|---|---|
| Camera | Current | Capture the room. |
| Reader | Planned | Collect a second signal. |
Example 3: Nonprofit Capstone Hub
A useful hub gives people context before navigation: a few meaningful signals, clear filters, and cards that explain the next step.
Scripps Ranch Fire Safe Council
A nonprofit hub that helps neighbors understand local wildfire risk, find programs, and choose a practical way to help.
Active programs
Upcoming events
Ways to volunteer
Find a starting point
Prepare Your Home
Practical home-hardening steps, local guidance, and a clear first action.
Start hereLearn the Risk
Understand local wildfire conditions through short explainers and updates.
ExploreMake the next action obvious
Rules of Thumb
- Start with
ocs__containerfor page width and typography. - Use
ocs__cardfor a framed section of related content. - Use
ocs__gridwhen content needs comparison or repeated layout. - Put images in the card or grid cell that explains them.
- Use
ocs__tablefor structured comparison data. - Use
ocs__btn,ocs__status-pill, andocs__calloutfor actions and state. - Use preference tokens through the shared grammar instead of choosing fixed colors.
- Add custom CSS only when the shared grammar cannot express the required behavior.