Navigation: uCss > Source > Modules > Base
Modules: Config | Base | Layout | Theming | Typography | Patterns | Utilities
The Surgical Reset. A powerful normalization engine that creates a "Smart Flow" environment. Unlike traditional resets that just strip styles to zero, the Base module establishes a sophisticated system for Vertical Rhythm that works automatically using Lobotomized Owl selectors (
* + *) and CSS Variables.
The Base Module is the foundation that ensures your HTML looks good "naked". It handles normalization, accessibility, and content flow.
margin-block-start. You rarely need utility classes for spacing in text content.h1, p, small) are bound to Configuration variables. Change the config, and the base elements update.[!LIGHTBULB] Why
margin-block-start? We use Logical Properties (block-startinstead oftop) so that if you change your site's language direction (e.g., Vertical Japanese), the spacing remains logically correct up-down or right-left automatically.
Traditional resets (like Eric Meyer's reset) strip everything to zero.
h1 { font-size: 100%; margin: 0; }
This is great for consistency, but terrible for productivity. You immediately have to re-declare styles for every H1.
uCss takes a "Normalize + Enhance" approach. We strip the inconsistent browser defaults, but we add back a consistent, variable-driven baseline.
In the uCss philosophy, Vertical Rhythm is the default state of content.
Create a raw HTML file with no classes:
<article>
<h1>My Journey</h1>
<p>It started on a Tuesday.</p>
<blockquote>"Code is Poetry"</blockquote>
<p>Then I wrote some more.</p>
</article>
With uCss Base, this renders perfectly.
h1 and p.p and blockquote.<link ... base.min.css>.<body class="s"> (Sets global default to "Section" / App Mode).<main class="sf"> (Sets main content to "Start Flow" / Article Mode).| File | Full (Raw) | Clean | Min | Gzip | Brotli |
|---|---|---|---|---|---|
base.css (Aggregator) |
19 KB | 17 KB | 14 KB | 3.7 KB | 3.2 KB |
html.css |
19 KB | 17 KB | 14 KB | 3.7 KB | 3.2 KB |
reset.css |
- | - | - | - | - |
typography.css |
- | - | - | - | - |
| Module | Full Source | Clean Source | Minified (Prod) |
|---|---|---|---|
| html.css | html.css | html.clean.css | html.min.css |
<link rel="preconnect" href="https://ucss.unqa.dev">
<link rel="stylesheet" href="https://ucss.unqa.dev/latest/lib/base.min.css">
/p/)<link rel="stylesheet" href="https://ucss.unqa.dev/p/lib/base.min.css">
/v/)<link rel="stylesheet" href="https://ucss.unqa.dev/v/lib/base.min.css">
| File | Description |
|---|---|
html.css |
The Controller. Imports all partials below. Use this file to load the module. |
flow.css |
The Engine. Contains the Lobotomized Owl (* + *) selectors and the .s (design section) / .sf (smart flow) logic. |
reset.css |
The Normalizer. Sets box-sizing: border-box, standardizes input fonts, removes default margins. |
typography.css |
The Binder. Maps semantic tags (h1-h6, small, code) to Config variables. |
lists.css |
The Cleaner. specific logic for ul and ol spacing and markers. |
forms.css |
The Basics. Minimal styling for input and textarea to make them usable (standardized font, box model). |
media.css |
The Media. Sets img, video to max-width: 100% and height: auto to prevent layout blowouts. |
The html.css is the invisible engine of uCss. It ensures that standard HTML elements stack with perfect vertical rhythm without you adding any classes.
* + *)Instead of p { margin-bottom: 1em }, we use Adjacent Sibling Selectors (* + *) and Variables.
/* "Smart Flow" Logic (Simplified) */
/* 1. Paragraphs following paragraphs get standard flow */
p + p { margin-top: var(--p-flow, 1em); }
/* 2. Headlines get more space BEFORE them... */
* + h2 { margin-top: var(--t-flow-s, 1.5em); }
/* 3. ...and less space AFTER them (to hug the text) */
h2 + p { margin-top: var(--t-flow-e, 0.5em); }
This means:
How it works:
* (Universal): Select everything...+ * (Adjacent Sibling): ...that comes immediately after another element.Why this is genius:
.s vs .sf)These classes are technically "Variable Re-definers".
.s (Design Section)
--p-flow (and others) to 0.gap, mgb) to inspect spacing..sf (Smart Flow)
.s (Section).--p-flow to 0.75em, --h-flow to 1em, etc.We remove the default browser outline (outline: none) ONLY to replace it immediately with a better one.
:focus-visible {
outline: var(--focus-ring-width) solid var(--focus-ring-color);
outline-offset: var(--focus-ring-offset);
}
--focus-ring-color globally or locally (e.g., distinct focus color on a dark background).:focus-visible so mouse users aren't annoyed by clicking buttons and seeing rings, but tab-users get clear indicators.flow.css)These control the * + * spacing.
| Variable | Default Value | Context |
|---|---|---|
--p-flow |
0.75em |
Standard text flow (paragraph to paragraph). |
--el-flow |
1.25em |
Element flow (text to list, text to table). |
--t-flow-s |
1em |
Title Start. Space before a heading. |
| --t-flow-e` | 0.375em |
Title End. Space after a heading (Heading to Text). |
--li-flow |
0.5em |
List Item flow (space between <li>). |
| Class | Name | Behavior |
|---|---|---|
.s |
Section | Kills flow. Use for structures. |
.sf |
Smart Flow | Enables smart flow. Use for copy. |
.cl |
Clear List | Removes bullets/numbers from ul/ol. |
| Tag | Bound Variable |
|---|---|
h1 |
--t-fs--s (via --h-fs) |
h2 |
--t-fs--xs |
h3 |
--t-fs--xxs |
p |
--tx-fs--s |
small |
--tx-fs--xs |
code |
--mono-font |
pre |
--mono-font + --d-lt (Always dark lite) |
A common architecture pattern in uCss:
<!-- Outer Shell: App Mode (.s) -->
<div class="s">
<!-- Header: App Mode (Manual spacing) -->
<header class="f row jc-sb">...</header>
<!-- Main Content: Content Mode (.sf) -->
<main class="sf article-body">
<h1>Title</h1>
<p>Text...</p>
</main>
</div>
Use .s for the layout, .sf for the content.
Sometimes you want a "Relaxed" read mode.
.long-form-article {
/* Increase spacing locally */
--p-flow: 1.5em;
--t-flow-s: 3em;
}
Apply this class to your <article> and the entire document rhythm expands loosely.
html.css uses specificty-leveling tricks (like :where()) to ensure that your Utility classes (.mgb-0) always win against the automatic Flow margins.margin-block-start. If it's 0, check if you are accidentally inside a .s container.Navigation: uCss > Source > Modules > Base
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) <== YOU ARE HERE
β βββ 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)
βββ display.css
βββ position.css
βββ overflow.css
βββ margin.css
βββ padding.css
βββ radius.css
βββ size.css # - Size Utilities
βββ blur.css
βββ utilities.css