Navigation: uCss > Source > Modules > Utilities
Modules: Config | Base | Layout | Theming | Typography | Patterns | Utilities
Atomic Overrides. A collection of single-purpose logic classes for tweaking Layouts and Patterns. While Patterns provide the "Default State", Utilities provide the "Exception State". uCss utilities are strictly Logical Property based (Block/Inline) to ensure future-proof internationalization support.
The Utilities Module is the final layer of the stack. It has the highest specificity (mostly) and is used to fine-tune layouts.
.pdbs (Padding Block Start) instead of .pt (Padding Top). If you switch the document to dir="rtl", your padding stays on the "start" side correctly (e.g. Right in Arabic)..mg--sm, or only on desktop .mg--lg..rad-l isn't 8px. It's var(--rad-l, 0.75em). Change the variable, change the utility everywhere..pd.xl uses a clamp function (3rem to 4rem). It acts like a "Standard Layout Padding" utility that works on any screen size.[!LIGHTBULB] Why
block-start? In default English writing mode,block-startis Top. But in Vertical Japanese writing mode,block-startis Right. Logical properties align with the content flow, not the physical screen.
If you find yourself using .pd-l on every single card, that is not an exception. That is a rule. You should update your Card Pattern (--crd-p).
Utilities should be used for one-offs.
We believe that describing "Left" and "Right" in CSS is legacy thinking.
<div class="crd">..mgbs-xl (Margin Block Start Extra Large)..mgbs-s .mgbs-xl--lg.utilities.min.css.<img class="rad-l" src="...">.<div class="dn--sm">.<div class="abs o blr-m"></div>.| File | Full (Raw) | Clean | Min | Gzip | Brotli |
|---|---|---|---|---|---|
utilities.css |
30 KB | 25 KB | 20 KB | 5.4 KB | 4.2 KB |
size.css |
8.2 KB | 7.3 KB | 6.0 KB | 1.1 KB | 0.9 KB |
padding.css |
6.7 KB | 5.0 KB | 4.1 KB | 0.7 KB | 0.6 KB |
margin.css |
6.7 KB | 5.3 KB | 4.3 KB | 0.8 KB | 0.6 KB |
position.css |
3.6 KB | 3.1 KB | 2.5 KB | 0.6 KB | 0.5 KB |
radius.css |
2.4 KB | 1.6 KB | 1.3 KB | 0.3 KB | 0.3 KB |
| Module | Full Source | Clean Source | Minified (Prod) |
|---|---|---|---|
| Utilities | utilities.css | utilities.clean.css | utilities.min.css |
<link rel="preconnect" href="https://ucss.unqa.dev">
<link rel="stylesheet" href="https://ucss.unqa.dev/latest/lib/utilities.min.css">
/p/)<link rel="stylesheet" href="https://ucss.unqa.dev/p/lib/utilities.min.css">
| File | Description | Download |
|---|---|---|
padding.css |
Padding. Logical spacing inside elements. .pd (all), .pdb (block/vertical), .pdi (inline/horizontal). |
src |
margin.css |
Margin. Logical spacing outside elements. .mg (all), .mgb (block/vertical), .mgi (inline/horizontal). |
src |
radius.css |
Border Radius. .rad (all), .rad-t (top corners), .rad-tl (top-left). |
src |
blur.css |
Filters. .blr (blur). Useful for backdrops. |
src |
misc.css |
Helpers. Display (.dn), Position (.abs), Visual (.ovf-h), Visibility (.vis-hidden). |
src |
Mapping Table (LTR):
block-start = Topblock-end = Bottominline-start = Leftinline-end = RightMapping Table (RTL - Arabic):
block-start = Topblock-end = Bottominline-start = Rightinline-end = LeftuCss utilities automatically adapt.
We use CSS Variables to allow broad overrides.
Code: padding-block-start: var(--pdbs, var(--pdb, var(--pd))).
What does this mean?
--pd: 2rem. (All sides get 2rem).--pdb: 4rem. (Top/Bottom become 4rem, Left/Right stay 2rem).--pdbs: 1rem. (Top becomes 1rem, Bottom stays 4rem, Left/Right stay 2rem).This allows you to set "My Spacing" on a component level and have it intelligently cascade to all sides unless specifically overridden.
Every class in this module supports standard suffix modifiers.
--sm: Mobile only (0 - 640px)--md: Tablet only (640px - 1024px)--lg: Desktop only (1024px+)Example: .dn--sm -> display: none ONLY on small screens.
.pd)Fluid, responsive internal spacing with massive clamp() ranges.
clamp() to scale smoothly from mobile to desktop sizes.xxs to xxxl ensures consistent spacing rhythm.3%, 5%, 7%) for large presets (l, xl, xxl) to maintain safe zones on wide screens.Follows the logical direction naming (.pdb, .pdi, .pdbs, etc.).
| Class | Property | Direction |
|---|---|---|
.pd |
padding |
All |
.pdb |
padding-block |
Top + Bottom |
.pdi |
padding-inline |
Left + Right |
.pdbs |
padding-block-start |
Top |
.pdbe |
padding-block-end |
Bottom |
.pdis |
padding-inline-start |
Left |
.pdie |
padding-inline-end |
Right |
| Size | Suffix | Block Value (approx) | Inline Value |
|---|---|---|---|
| xxxl | .pdb.xxxl |
6rem - 8rem |
(Block only) |
| xxl | .pdi.xxl |
4rem - 6rem |
7% |
| xl | .pd.xl |
3rem - 4rem |
5% |
| l | .pd.l |
2.5rem - 3rem |
3% |
| m | .pd.m |
2rem - 2.5rem |
Fluid |
| s | .pd.s |
1.5rem - 2rem |
Fluid |
| xs | .pd.xs |
1.25rem - 1.5rem |
Fluid |
| xxs | .pd.xxs |
1rem - 1.25rem |
Fluid |
Applying responsive vertical padding (.pdb) and consistent horizontal safe-zones (.pdi).
<!-- Vertically: XL (3-4rem), Horizontally: L (3%) -->
<section class="pdb xl pdi l">
<h2>Section Title</h2>
<p>Content...</p>
</section>
<article class="card pd s">
Small consistent padding (1.5rem - 2rem) around content.
</article>
.custom-box {
/* Default: Scale M */
--pd: var(--pd-m);
/* Large Containers: Jump to Scale XL */
--pd--lg: var(--pd-xl);
}
.mg)Responsive, logical-property based external spacing.
block (top/bottom) and inline (left/right) to support modern writing modes.--mg--sm, --mg--md, --mg--lg).margin: auto centering.| Class | Property | Direction |
|---|---|---|
.mg |
margin |
All |
.mgb |
margin-block |
Top + Bottom |
.mgi |
margin-inline |
Left + Right |
.mgbs |
margin-block-start |
Top |
.mgbe |
margin-block-end |
Bottom |
.mgis |
margin-inline-start |
Left |
.mgie |
margin-inline-end |
Right |
.mg-auto |
margin |
Auto (Center) |
.auto: Sets the margin to auto. Can be combined with directional classes..mg.auto: margin: auto (Centering block elements)..mgis.auto: margin-inline-start: auto (Push to right in flex row).<div class="card mg auto">
Centered Content
</div>
Using margin-auto logic to push a button to the far right of a flex container.
<div class="f row ai-c">
<div class="logo">Logo</div>
<!-- Usage: .mgis.auto pushes this element to the end -->
<button class="btn mgis auto">Login</button>
</div>
Changing margin based on container size without adding new classes.
.hero-section {
--mgb: 2rem; /* Default bottom margin */
--mgb--lg: 5rem; /* Large screens: 5rem bottom margin */
}
.rad)Border radius utilities for consistent corner rounding.
-tl, -tr, -bl, -br) or sides (-t, -b).em-based sizes ensure radius scales with font-size, keeping proportions perfect.| Class | Property | Target |
|---|---|---|
.rad |
border-radius |
All |
.rad-t |
Top Left + Right | |
.rad-b |
Bottom Left + Right | |
.rad-l |
Left Top + Bottom | |
.rad-r |
Right Top + Bottom | |
.rad-tl |
Top Left | |
.rad-tr |
Top Right | |
.rad-bl |
Bottom Left | |
.rad-br |
Bottom Right |
Sizes:
.sq (0px).s (Small).m (Medium).l (Large).rd (Round/Pill - 9999px)<div class="card rad m">
Rounded corners (0.625em).
</div>
<button class="btn rad rd">
Pill Shape
</button>
Only rounding the top corners to match the card, leaving bottom square to attach to content.
<div class="card rad l">
<img src="post.jpg" class="rad-t l rad-b sq" alt="Header">
<div class="content">
Text...
</div>
</div>
| Class | Value | Use Case |
|---|---|---|
.abs |
absolute |
Overlays, badges. |
.rel |
relative |
Container for absolute items. |
.fxd |
fixed |
Sticky headers, Modals. |
.stk |
sticky |
Sidebars. |
.dn |
display: none |
Hiding things. |
.db |
display: block |
Resetting inline items. |
.dib |
display: inline-block |
Buttons. |
.f |
display: flex |
See Layout. |
.g |
display: grid |
See Layout. |
.blr)Backdrop blur utilities.
| Class | Effect |
|---|---|
.blr-s |
Mild Blur (Backdrop) |
.blr-m |
Medium Blur |
.ovf-h |
overflow: hidden |
.vis-hidden |
visibility: hidden (Persist layout space). |
<div class="card s set dark blr--xl" style="--set-bg: hsl(0 0% 10% / 0.5);">
Blurred background content.
</div>
Utilities for hiding elements.
| Class | Description |
|---|---|
.hide, .hidden |
Hides the element (display: none, opacity: 0). |
Note: In the editor context, these elements remain strictly visible (reduced opacity) for editing purposes.
2rem padding, write it in patterns/product-card.css.4rem padding because it's a "Featured Item", use <div class="p-card pd-xl">.Do not build your entire site using only utilities (unless you are prototyping). It leads to "Class Soup": <div class="pd-m mgb-s rad-l shadow-s bg-white flex row...">.
.mega padding:.pd.mega {
--pd: 10rem;
}
Add this to your theme CSS, and it works with .pd, .pdb, .pdi, etc. automatically.Navigation: uCss > Source > Modules > Utilities
License: MPL-2.0 Copyright: Β© 2025 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
β
βββ patterns/ # 3. PATTERNS (The Components)
β βββ button/ # - Atomic Component
β β βββ base.css
β β βββ group.css
β βββ card/ # - Card Component
β β βββ base.css
β β βββ content.css # - Slots & Padding
β β βββ media.css # - Full-bleed Media
β β βββ subgrid.css # - Subgrid Support
β βββ button.css # - Aggregator
β βββ card.css # - Aggregator
β βββ media.css # - Media Wrapper
β βββ link.css # - Link Wrapper
β βββ patterns.css # - Entry Point
β
βββ layout/ # 4. LAYOUT (The Skeleton)
β βββ grid/ # - Grid Engine
β β βββ base.css # - Core Logic
β β βββ columns.css # - Presets
β β βββ subgrid.css # - Smart Grid
β β βββ recipes.css # - Smart Logic (.masonry .g-row)
β β βββ item.css # - Child Logic
β βββ flex/ # - Flex Engine
β β βββ base.css # - Core Logic
β β βββ alignment.css # - Alignment Tools
β β βββ gaps.css # - Smart Gaps
β β βββ item.css # - Child Logic
β βββ container.css # - Container Queries (.c)
β βββ flex.css # - Entry Point
β βββ grid.css # - Entry Point
β βββ section.css # - Structural Layout
β
βββ theming/ # 5. THEMING (The Skin)
β βββ set.css
β βββ overlay.css
β
βββ typography/ # 6. TYPOGRAPHY (The Voice)
β βββ title.css
β βββ text.css
β βββ text-align.css
β
βββ utilities/ # 7. UTILITIES (The Tools) <== YOU ARE HERE
βββ display.css
βββ position.css
βββ overflow.css
βββ margin.css
βββ padding.css
βββ radius.css
βββ size.css # - Size Utilities
βββ blur.css
βββ utilities.css