Back to Ag Grid

Standard CSS Utility Classes

external/ag-shared/prompts/skills/website-css/utility-classes.md

100.0.02.5 KB
Original Source

Standard CSS Utility Classes

Always prefer using standard design system classes over custom styles. These classes are globally available and ensure consistency across the site.

Layout Classes

Use these for page structure and grid layouts:

ClassPurpose
.layout-gridFlexbox grid container with standard gap and max-width
.layout-page-max-widthFull width constrained to max page width
.layout-max-width-smallNarrower content width with horizontal padding

Column Classes (4-column grid):

  • .column-1-4, .column-2-4, .column-3-4, .column-4-4

Column Classes (6-column grid):

  • .column-1-6 through .column-6-6

Column Classes (12-column grid):

  • .column-1-12 through .column-12-12
astro
<div class="layout-grid">
    <div class="column-8-12">Main content</div>
    <div class="column-4-12">Sidebar</div>
</div>

Typography Classes

ClassFont SizeUse For
.text-2xs10pxFine print
.text-xs12pxCaptions, labels
.text-sm14pxSecondary text
.text-base16pxBody text (default)
.text-lg20pxSubheadings
.text-xl24pxSection headings
.text-2xl32pxPage headings
.text-3xl40pxHero headings

Weight Classes:

  • .text-regular (400)
  • .text-semibold (600)
  • .text-bold (700)

Other:

  • .text-monospace - Monospace font family
astro
<h1 class="text-2xl text-semibold">Page Title</h1>
<p class="text-base">Body content here.</p>
<code class="text-sm text-monospace">code example</code>

Colour Classes

ClassPurpose
.text-secondarySecondary foreground colour
.text-tertiaryTertiary foreground colour

Interaction Classes

ClassPurpose
.collapseHidden when not .show
.collapsingAnimating collapse transition
.no-transitionsDisable all transitions
.no-overflow-anchorPrevent scroll anchoring

Example: Using Standard Classes

astro
<section class="layout-max-width-small">
    <h1 class="text-2xl text-semibold">Welcome</h1>
    <p class="text-base text-secondary">
        Introduction paragraph with secondary styling.
    </p>

    <div class="layout-grid">
        <div class="column-6-12">
            <h2 class="text-xl">Left Column</h2>
        </div>
        <div class="column-6-12">
            <h2 class="text-xl">Right Column</h2>
        </div>
    </div>
</section>