Responsive Suffix
Airframe uses a simple responsive suffix to make utilities, layouts, and grid
classes adapt at specific breakpoints. Add @{bp} to a class name to apply it
from that breakpoint and up.
Syntax
Section titled “Syntax”base-class@bp
base-class@bp-onlybase-classis any Airframe class (utility, layout recipe, grid, etc.)bpis one of the supported breakpoints (xs,sm,md,lg,xl,2xl)@{bp}applies the class from that breakpoint and up (mobile-first)@{bp}-onlyapplies the class only at that specific breakpoint range (not above or below)
Example
Section titled “Example”<div class="af-gap-sm af-gap-lg@md">
<!-- Small gap on mobile, large gap on md+ -->
</div>Breakpoint-Only Example
Section titled “Breakpoint-Only Example”<div class="af-hidden@sm-only">
<!-- Hidden only at sm breakpoint (640px-767px), visible elsewhere -->
</div>Breakpoints
Section titled “Breakpoints”| Suffix | Min Width | Typical Use |
|---|---|---|
@xs | 360px+ | Small phones, compact viewports |
@sm | 640px+ | Large phones, small tablets |
@md | 768px+ | Tablets (portrait) |
@lg | 1024px+ | Tablet landscape, small laptops |
@xl | 1280px+ | Standard desktop |
@2xl | 1536px+ | Large desktop, wide screens |
How It Works
Section titled “How It Works”- Mobile-first: base classes apply to all sizes, then
@{bp}overrides start at the matching breakpoint. - Min-width media queries:
@{bp}maps to amin-widthquery (applies from that breakpoint and up). - Breakpoint-only queries:
@{bp}-onlymaps to bothmin-widthandmax-widthqueries (applies only at that specific breakpoint range). - Stackable: use multiple suffixes to progressively adjust styles.
<div class="af-grid-1 af-grid-2@md af-grid-4@lg">
<!-- 1 column on mobile, 2 on md+, 4 on lg+ -->
</div>Breakpoint-Only Variants
Section titled “Breakpoint-Only Variants”Breakpoint-only variants (@{bp}-only) target a specific breakpoint range, not “and up”. This is useful when you need styles that apply only at a particular screen size.
Available for: af-hidden and af-show utilities only.
<div class="af-hidden@sm-only">
<!-- Hidden only at sm (640px-767px), visible at all other sizes -->
</div>
<div class="af-show@md-only">
<!-- Visible only at md (768px-1023px), hidden at all other sizes -->
</div>Breakpoint ranges:
@xs-only: 360px - 639px@sm-only: 640px - 767px@md-only: 768px - 1023px@lg-only: 1024px - 1279px@xl-only: 1280px - 1535px@2xl-only: Not available (2xl has no upper limit)
Where You Can Use It
Section titled “Where You Can Use It”Most Airframe utilities and all layout/grid classes support responsive suffixes. Common categories:
- Spacing:
af-gap-lg@md,af-p-xl@lg - Layout recipes:
af-stack-lg@md,af-inline-sm@lg - Grid:
af-grid-2@md,af-col-span-8@lg - Visibility:
af-hidden@xs,af-show@md,af-hidden@sm-only,af-show@md-only - Position:
af-pos-sticky@md - Alignment:
af-text-center@sm,af-text-start@md - Color utilities:
af-bg-primary@lg,af-text-muted@md
If a class has a responsive variant, it follows the exact same naming with
@{bp} appended.
Base Classes With Responsive Suffix
Section titled “Base Classes With Responsive Suffix”Add @{bp} to any base class in the lists below.
Spacing Utilities
Section titled “Spacing Utilities”af-gap-0/af-gap-xs/af-gap-sm/af-gap-md/af-gap-lg/af-gap-xl/af-gap-2xl/af-gap-3xl/af-gap-4xlaf-p-0/af-p-xs/af-p-sm/af-p-md/af-p-lg/af-p-xl/af-p-2xl/af-p-3xl/af-p-4xlaf-px-*,af-py-*,af-pt-*,af-pr-*,af-pb-*,af-pl-*af-m-*,af-mx-auto,af-mx-*,af-my-*,af-mt-*,af-mr-*,af-mb-*,af-ml-*
Display & Alignment Utilities
Section titled “Display & Alignment Utilities”af-hiddenaf-blockaf-inline-blockaf-flexaf-inline-flexaf-flex-reverseaf-row/af-row-reverseaf-col/af-col-reverseaf-wrapaf-nowrapaf-justify-startaf-justify-centeraf-justify-endaf-justify-betweenaf-justify-aroundaf-justify-evenlyaf-items-startaf-items-centeraf-items-endaf-items-stretchaf-items-baselineaf-align-topaf-align-middleaf-align-bottomaf-align-baselineaf-align-top/af-align-middle/af-align-bottom
Position Utilities
Section titled “Position Utilities”af-pos-relativeaf-pos-absoluteaf-pos-stickyaf-pos-revert
Typography Utilities
Section titled “Typography Utilities”af-text-h1af-text-h2af-text-h3af-text-bodyaf-text-mutedaf-text-monoaf-text-smaf-text-mdaf-text-lgaf-text-body-smaf-text-strongaf-titleaf-text-nowrapaf-text-breakaf-clampaf-clamp-1af-clamp-2af-clamp-3af-clamp-4af-numeric
Text Alignment Utilities
Section titled “Text Alignment Utilities”af-text-centeraf-text-startaf-text-end
Text Color Utilities
Section titled “Text Color Utilities”af-textaf-text-mutedaf-text-inverseaf-text-primaryaf-text-linkaf-text-successaf-text-dangeraf-text-warningaf-text-info
Background Color Utilities
Section titled “Background Color Utilities”af-bg-backgroundaf-bg-surfaceaf-bg-surface-2af-bg-surface-3af-bg-primaryaf-bg-successaf-bg-dangeraf-bg-warningaf-bg-infoaf-bg-primary-softaf-bg-success-softaf-bg-danger-softaf-bg-warning-softaf-bg-info-softaf-gradient-accentaf-gradient-subtleaf-gradient-border
Border Color Utilities
Section titled “Border Color Utilities”af-borderaf-border-defaultaf-border-mutedaf-border-focusaf-border-strongaf-border-primaryaf-border-successaf-border-dangeraf-border-warningaf-border-info
Radius & Shadow Utilities
Section titled “Radius & Shadow Utilities”af-radius-smaf-radius-mdaf-radius-lgaf-radius-fullaf-shadow-smaf-shadow-mdaf-shadow-lg
State Helpers
Section titled “State Helpers”af-is-disabledaf-is-loadingaf-is-activeaf-is-mutedaf-has-erroraf-has-focus
Visibility Helpers
Section titled “Visibility Helpers”af-hiddenaf-show
Accessibility Helpers
Section titled “Accessibility Helpers”af-sr-only
Layout Recipes
Section titled “Layout Recipes”af-stackaf-stack-smaf-stack-mdaf-stack-lgaf-inlineaf-inline-smaf-inline-mdaf-inline-lgaf-clusteraf-spreadaf-centeraf-containeraf-container-xsaf-container-smaf-container-mdaf-container-lgaf-container-xlaf-section-smaf-sectionaf-section-lgaf-spacer-smaf-spacer-mdaf-spacer-lgaf-surfaceaf-surface-2
Flex Alignment Utilities
Section titled “Flex Alignment Utilities”af-justify-startaf-justify-centeraf-justify-endaf-justify-betweenaf-justify-aroundaf-justify-evenlyaf-items-startaf-items-centeraf-items-endaf-items-stretchaf-items-baseline
Flex Order & Sizing Utilities
Section titled “Flex Order & Sizing Utilities”af-order-firstaf-order-defaultaf-order-1…af-order-6af-order-lastaf-grow/af-grow-0af-shrink/af-shrink-0af-basis-0/af-basis-autoaf-self-start/af-self-center/af-self-end/af-self-stretch/af-self-baseline
Outline & Focus Utilities
Section titled “Outline & Focus Utilities”af-focus-ringaf-focus-ring-insetaf-focus-noneaf-outlineaf-outline-0af-outline-offset-2af-outline-offset-4
Cursor & Motion Utilities
Section titled “Cursor & Motion Utilities”af-cursor-pointeraf-cursor-not-allowedaf-reduce-motion
Hit Target Utilities
Section titled “Hit Target Utilities”af-hitaf-hit-44
Grid Classes
Section titled “Grid Classes”af-gridaf-grid-1af-grid-2af-grid-3af-grid-4af-grid-5af-grid-6af-col-span-1af-col-span-2af-col-span-3af-col-span-4af-col-span-5af-col-span-6af-col-span-7af-col-span-8af-col-span-9af-col-span-10af-col-span-11af-col-span-12
Common Patterns
Section titled “Common Patterns”Progressive Enhancement
Section titled “Progressive Enhancement”<div class="af-stack af-stack-lg@md">
<!-- Default layout for mobile, larger gap on md+ -->
</div>Responsive Visibility
Section titled “Responsive Visibility”<div class="af-hidden@xs af-show@md">
<!-- Hidden on extra-small screens, visible from md up -->
</div>Breakpoint-Only Visibility
Section titled “Breakpoint-Only Visibility”<div class="af-hidden@sm-only">
<!-- Hidden only at sm breakpoint (640px-767px), visible elsewhere -->
</div>
<div class="af-show@md-only">
<!-- Visible only at md breakpoint (768px-1023px), hidden elsewhere -->
</div>Responsive Alignment
Section titled “Responsive Alignment”<h2 class="af-text-center af-text-start@md">
Center on mobile, start-aligned on md+
</h2>- Start with a sensible base class for mobile, then add responsive overrides.
- You can add a responsive class without a base class when you only want behavior at and above a breakpoint.
- Keep class lists readable by grouping responsive overrides together.