HTML Base Submodule

Navigation: uCss > Source > Modules > Base > HTML

Modules: Config | Base | Layout | Theming | Typography | Patterns | Utilities

The Semantic Skeleton. A classless CSS engine that makes raw HTML look beautiful by default. It handles vertical rhythm ("Smart Flow"), typographic hierarchy, and interactive states without a single class name.


πŸ“‘ Contents


🌟 Overview

The HTML Submodule is the "Reset + Normalize + Typography" layer.

Top Features

  1. Smart Flow: Automatically adds space between paragraphs, but different space between a Paragraph and a Heading.
  2. Semantic Binding: <h1> is automatically Bold and sized fluidly via --t-fs.
  3. Focus Rings: All interactive elements (<a>, <input>, <button>) get accessible focus rings by default.
  4. List Markers: Bullets and Numbers inherit the brand color (--p).

πŸš€ Philosophy: Intro

What is it about?

Most frameworks require you to add classes to everything. <h1 class="text-3xl font-bold mb-4">. uCss believes HTML is UI. You should be able to dump a raw Markdown file into a page, and it should look perfect.

The Flow Algorithm

We use a lobotomized owl selector (* + *) strategy, but smarter.

  • P + P: Standard flow (0.75em).
  • P + H2: Heading flow (1em). (More space before a new section).

⚑ How to Get Started

The "Clicked" Moment

  1. Create a <div class="sf"> (Start Flow).
  2. Paste 5000 words of unstyled HTML.
  3. Load the page.
  4. It reads like a Medium article. Perfect rhythm.

Rollout in 5 Seconds

<article class="sf">
  <h1>My Post</h1>
  <p>Intro...</p>
  <ul>
    <li>Point 1</li>
    <li>Point 2</li>
  </ul>
</article>

πŸ“¦ Installation & Stats

Bundle Stats

File Full (Raw) Clean Min Gzip Brotli
html.css (Aggregator) 19 KB 17 KB 15 KB 3.8 KB 3.3 KB
flow.css - - - - -
reset.css - - - - -

HTML Snippets

See Base Module for installation. This submodule is included in base.css.


πŸ“‚ Files Reference

File Description Download
reset.css Normalization. Focus rings and box sizing. src
flow.css Rhythm. The Smart Flow engine logic. src
typography.css Type. Default styles for H1-H6, P, Blockquote. src
lists.css Markers. Styling for UL/OL/DL. src

🧠 Deep Dive

1. The Smart Flow Engine

The engine watches the relationships between elements. It doesn't just say margin-bottom: 20px. It says: "If a Paragraph is followed by a List, add Space. If a Heading is followed by a Paragraph, add less Space."

2. Classless Typography

We map standard HTML tags to our variable system.

  • <h1> -> --t-fs--s (Small Title).
  • <h2> -> --t-fs--xs (Extra Small Title).
  • <small> -> 0.875em.
  • <code> -> font-family: monospace.

3. App Mode (.s) vs Content Mode (.sf)

  • Start Flow (.sf): Used for Content (Blog posts, Legal pages). Turning this ON enables vertical margins.
  • Stop Flow (.s): Used for Apps (Dashboards, Navbars). Turning this ON (or default) removes vertical margins so you can control layout with Flexbox/Grid explicitly.

πŸ“ Reference: Content Map

Elements

Tag Default Variable
<h1> 2.625rem (Fluid) --h-fs
<p> 65ch width --flow-max-width
<a> Underlined --link
<blockquote> Border Left --bq-bd-c
<hr> 1px Line --hr-c

Flow Controllers

Class Name Behavior
.sf Start Flow Enables vertical rhythm.
.s Stop Flow Disables vertical rhythm (sets vars to 0).

List Helpers

Class Description
.cl Clear List. Removes bullets and padding.

πŸ’‘ Best Practices & Customization

CMS Integration

If you are using WordPress or a headless CMS:

  1. Wrap the output the_content() in .sf (Smart Flow).
    <div class="content sf">
      {post.body}
    </div>
    
  2. That's it. You don't need to touch the HTML.

Overriding Global Headings

If you want ALL H1s to be Massive:

:root {
  --h1-fs: var(--t-fs--xxl);
}

πŸ”§ For Developers

Debugging Flow

If spacing looks wrong:

  1. Inspect the element.
  2. Check margin-block-start.
  3. If it's 0, check if you are inside a .s container.
  4. If it's huge, check if you accidentally nested .sf.

Navigation: uCss > Source > Modules > Base > HTML

Modules: Config | Base | Layout | Theming | Typography | Patterns | Utilities

Back to top

License: MPL-2.0 Copyright: © 2025 Shukhrat (Alive 🜁) ※ UNQA

πŸ—ΊοΈ Visual Map

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 <== YOU ARE HERE
β”‚   β”‚   β”œβ”€β”€ 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