Navigation: uCss > Source > Modules > Layout > Flex
Modules: Config | Base | Layout | Theming | Typography | Patterns | Utilities
Smart Flexbox Utilities. A responsive, gap-aware flexbox system for 1-Dimensional layouts β direction, wrapping, alignment, and item control without the verbosity.
The Flex module handles 1-Dimensional layouts (Row OR Column). Grid handles macro 2-D structure; Flex is for micro-components β navbars, media objects, button groups, pills.
.f is a flex container with a fluid default gap already applied..row β .col responsively (.col--md)..wrap / .nowrap at every breakpoint.Standard Flexbox is verbose. display: flex; flex-direction: column; align-items: center; gap: 1rem; is a lot of typing. uCss compresses it to .fxc.ai-c β and the gap comes free.
Flex composes with Grid: a Card is a Grid item, but the content inside the card is Flex.
<!-- Navbar -->
<nav class="f ai-c">
<div class="logo">Logo</div>
<div class="f"><a href="#">Home</a><a href="#">About</a><a href="#">Contact</a></div>
</nav>
<!-- Stack on Mobile, Row on Desktop -->
<div class="col row--md">
<div>Item 1 (top / left)</div>
<div>Item 2 (bottom / right)</div>
</div>
Every .f already carries a fluid default gap (---xs, β 0.875β1rem). Override per container with style="--f-g: 1.5rem".
Each scenario shows an Emmet abbreviation β expanded HTML β why.
Emmet: nav.f.row.ai-c>(div.logo+div.f>(a*3))
<nav class="f ai-c">
<div class="logo">Logo</div>
<div class="f"><a href="#">Home</a><a href="#">About</a><a href="#">Contact</a></div>
</nav>
Why: .f is the default; .ai-c vertical-centers; the inner .f keeps links evenly gapped.
Emmet: div.f.ai-c>(figure>img+div>(h3+p))
<div class="f ai-c">
<figure><img src="β¦" alt="β¦"></figure>
<div><h3>Title</h3><p>Bodyβ¦</p></div>
</div>
Why: avatar/icon + text, vertically centered β the classic media object. Perfect for testimonials, list rows, comments.
Emmet: div.row.col--md>(div*3)
<div class="row col--md">
<div>1</div><div>2</div><div>3</div>
</div>
Why: side-by-side on desktop, stacked in a column from --md down. Add .wrap for fluid wrapping instead.
Emmet: footer.f.wrap.ai-c.jc-sb>(div+nav.f>(a*3))
<footer class="f wrap ai-c jc-sb">
<div>Β© 2026 β¦</div>
<nav class="f"><a href="#">Legal</a><a href="#">Privacy</a><a href="#">Contact</a></nav>
</footer>
Why: .jc-sb pushes the two groups apart; .wrap protects narrow screens.
Emmet: div.f.ai-c>(svg+span)
<div class="f ai-c"><svg β¦></svg><span>Label</span></div>
Why: the minimal icon+text row used by pills, badges, meta rows, and tooltips.
Emmet: div.f>(div.fxg-1+div.fxs-0+div.fxb-thd)
<div class="f">
<div class="fxg-1">Grows to fill</div>
<div class="fxs-0">Never shrinks</div>
<div class="fxb-thd">Third of the row</div>
</div>
Why: one-line item control without touching the container.
All direction/wrap/alignment/item classes accept responsive suffixes: --sm, --smd, --md, --mdl, --lg (e.g. .col--md, .row--lg, .wrap--sm, .ai-c--md, .fxg-1--lg).
This Submodule is part of layout.css.
| File | Full (Raw) | Clean | Min | Gzip | Brotli |
|---|---|---|---|---|---|
flex/base.css |
5.3 KB | 3.9 KB | 3.1 KB | 1.2 KB | 1.0 KB |
flex/direction.css |
1.8 KB | 1.5 KB | 1.3 KB | 0.4 KB | 0.4 KB |
flex/wrap.css |
0.8 KB | 0.6 KB | 0.5 KB | 0.3 KB | 0.2 KB |
flex/item/base.css |
4.5 KB | 3.8 KB | 3.0 KB | 0.9 KB | 0.7 KB |
flex/item/controls.css |
8.3 KB | 7.7 KB | 6.6 KB | 1.5 KB | 1.1 KB |
Stats reflect the last verified build from
dist/latest. Runnpm run build:latestto regenerate.
Since this is a nested module, it is included in layout.min.css:
<link rel="preconnect" href="https://ucss.unqa.dev">
<link rel="stylesheet" href="https://ucss.unqa.dev/latest/lib/layout.min.css">
| File | Description |
|---|---|
base.css |
Container. .f + default gap (--f-g), responsive direction/alignment container queries. |
direction.css |
Direction. .fxc or .col / .fxr or .row and .rv (reverse), responsive variants. |
wrap.css |
Wrapping. .fxw or .wrap / .fxnw or .nowrap, responsive variants. |
item/base.css |
Item defaults. Grow/shrink/basis, align-self, order on .f > *. |
item/controls.css |
Item controls. .fxg-*, .fxs-*, .fxb-*, .o-*, margin helpers. |
Alignment (.ai-*, .jc-*, .ac-*) and gap presets live in the shared Utilities controls β flex reads them through the same variables.
| Class | Effect |
|---|---|
.f |
flex container (default row) + fluid gap --f-g |
.row / .fxr |
flex-direction: row |
.col / .fxc |
flex-direction: column |
.rv / .reverse |
reverse current direction |
.wrap / .fxw |
flex-wrap: wrap |
.nowrap / .fxnw |
flex-wrap: nowrap |
| Class | Responsive |
|---|---|
.row / .col |
--sm, --smd, --md, --mdl, --lg |
.rv |
--sm, --smd, --md, --mdl, --lg |
.wrap / .nowrap |
--sm, --smd, --md, --mdl, --lg |
| Class | Alias | Variable | Effect |
|---|---|---|---|
.fxg-1 / .fxg-0 |
.grow-1 / .grow-0 |
--fxg |
flex-grow |
.fxs-0 / .fxs-1 |
.shrink-0 / .shrink-1 |
--fxs |
flex-shrink |
.fxb-auto |
.basis-auto |
--fxb |
flex-basis: auto |
.fxb-thd |
.basis-third |
--fxb |
flex-basis: 33.333% |
.fxb-half |
.basis-half |
--fxb |
flex-basis: 50% |
.fxb-full |
.basis-full |
--fxb |
flex-basis: 100% |
.o-1 β¦ .o-9 |
.first, .last, β¦ |
--o |
order |
.mi-a, .mb-a, β¦ |
β | --fi-mi* |
auto margins |
All item controls accept --sm / --md / --lg suffixes (e.g. .fxg-1--lg).
Flex reads the shared alignment variables via --f-ai, --f-ac, --f-jc:
| Class | Effect |
|---|---|
.ai-c / .ai-s / .ai-e / .ai-st / .ai-b |
align-items: center/start/end/stretch/baseline |
.jc-c / .jc-s / .jc-e / .jc-sb / .jc-sa / .jc-se |
justify-content: center/start/end/space-between/around/evenly |
.ac-* |
align-content |
.as-* / .js-* |
align-self / justify-self on items |
Gap: default --f-g β 0.875β1rem (fluid). Override inline: style="--f-g: 1.5rem", or --f-rg / --f-cg for row/column only.
.g) for 2-D layouts and strict column alignment..f keep its default gap β only override --f-g when you need a specific rhythm.Flex containers read the shared alignment vars, so you can drive them from anywhere:
.my-nav {
--f-g: 1.25rem; /* gap */
--f-ai: center; /* align-items */
--f-jc: space-between;
}
Item overrides stay on the child:
.my-item {
--fxg: 1;
--fxs: 0;
--fxb: 20%;
}
Navigation: uCss > Source > Modules > Layout > Flex
Modules: Config | Base | Layout | Theming | Typography | Patterns | Utilities
License: MPL-2.0 Copyright: Β© 2026 Shukhrat (Alive π) β€» UNQA
src/lib/
βββ config/ # 1. CONFIGURATION (The Brain)
β βββ root/ # - Semantic Modules
β β βββ colors.css # - Palettes & Themes
β β βββ typography.css # - Fonts & Scales
β β βββ layout.css # - Radius & Spacing
β β βββ patterns.css # - Component Vars
β βββ adapters/ # - CMS Adapters
β β βββ blocksy.css # - Blocksy Theme
β β βββ gutenberg.css # - WordPress Block Editor
β βββ root.css # - Entry Point
β
βββ base/ # 2. BASE (The Foundation)
β βββ html/ # - HTML Engine
β β βββ reset.css # - Normalization
β β βββ typography.css # - Text Defaults
β β βββ flow.css # - Smart Flow Engine
β β βββ lists.css # - List Styles
β β βββ forms.css # - Input Styling
β β βββ helpers.css # - HTML Utilities
β βββ html.css # - Entry Point
β
βββ layout/ # 3. LAYOUT (The Skeleton)
β βββ grid/ # - Grid Engine
β βββ flex/ # <== YOU ARE HERE
β β βββ base.css # - Container (.f) & responsive behavior
β β βββ direction.css # - .col / .row / reverse
β β βββ wrap.css # - .wrap / .nowrap
β β βββ item/
β β β βββ base.css # - Item defaults
β β β βββ controls.css # - .fxg-* / .fxs-* / .fxb-* / .o-*
β β βββ item.css # - Aggregator
β βββ section/ # - Structural Sections
β βββ query.css # - Container Query Helper (.cq / .cquery)
β
βββ patterns/ # 4. PATTERNS (The Components)
β βββ button/
β βββ card/
β βββ ...
β
βββ theming/ # 5. THEMING (The Skin)
β βββ set/
β βββ ...
β
βββ typography/ # 6. TYPOGRAPHY (The Voice)
β βββ title.css
β βββ text.css
β βββ controls/
β
βββ utilities/ # 7. UTILITIES (The Tools)
βββ display.css
βββ position.css
βββ size.css
βββ ...