OmniCSS: The Fluid CSS Framework
Fluid CSS, Unleashed
OmniCSS is the next-generation CSS framework that redefines fluid design.
By blending dynamic responsiveness with intuitive syntax, it eliminates rigid breakpoints and unlocks truly adaptive layouts. Write less code, craft smarter designs, and let the browser do the heavy lifting—welcome to CSS, evolved.
- For devs: "Powered by CSS container queries, relative units, and a zero-config approach."
- For designers: "Pixel-perfect flexibility, no media queries needed."
Built-in Dark & Light Themes
For finer control, extend with:
[data-theme="light"] { --bg: #ffffff; }
No JavaScript required—just pure CSS flexibility.
Think in ratios, not pixels.
Fluid design is the art of letting the viewport decide, creating interfaces that feel native on any screen.
Fluid technique uses relative units (like %, vw, or rem) instead of fixed pixels, allowing elements to scale smoothly across screen sizes. It eliminates rigid breakpoints by relying on flexible ratios, creating more organic, responsive layouts. The result? Designs that adapt like water—no clunky jumps, just seamless flow.
Fluid Sizes
Fluid Typography
Fluid Padding
Fluid Margin
Surface Hierarchy
- These surfaces create a consistent depth and contrast system in the UI.
- They allow creating a multi-layered design that feels natural and visually balanced.
- It ensures that elements like cards, modals, and dropdowns stand out properly without breaking the design's visual flow.
Primary Surface:
Secondary Surface:
Tertiary Surface:
OmniCSS Color Systems
1. Surface Hierarchy Colors Preset
- Purpose: Define visual layering (z-axis depth) for UI containers.
- Use Case: Backgrounds, cards, panels, and structural elements.
2. Semantic Colors Preset
- Purpose: Communicate meaning/state (status, alerts, actions).
- Use Case: Buttons, badges, alerts, notifications.
3. Brand/Functional Colors
- Purpose: Core brand identity and key interactive elements.
- Use Case: Primary buttons, links, CTAs, branding, and accents.
Font Color: Primary
Font Color: Secondary
Font Color: Accent
Background: Primary
Background: Secondary
Background: Accent
Key Benefits
- Consistency: Surface colors for layout, semantic colors for meaning.
- Flexibility: Mix and match as needed (e.g., a gridable-ss with critical status).
- Theming: Change all --primary-surface-* or --success-* values globally.
Why This Separation?
-
Predictability:
- Surface colors = Where an element sits (hierarchy).
- Semantic colors = What it means (state/action).
-
Accessibility:
- Semantic colors enforce consistent contrast ratios for readability.
-
Maintenance:
- Change --primary-surface-bg once to update all containers globally.
Full OmniCSS Color Taxonomy
Key Rules for Usage
- Surface Colors → Structural containers (.gridable-ps, .card-ss).
- Semantic Colors → Status/feedback (.pill-success, .alert-critical).
- Brand Colors → Brand identity and interactivity (.btn-primary, .text-accent).
Why This Structure?
- Scalability: Add --color-tertiary later without confusion.
- Theming: Swap brand colors globally (e.g., dark mode).
- Clarity: Engineers/designers know which palette to use.
Individual Colors
.fc-p | Use primary color as font color. |
.fc-s | Use secondary color as font color. |
.fc-a | Use accent color as font color. |
.fc-surf-p | Use primary surface text color as font color. |
.fc-surf-s | Use secondary surface text color as font color. |
.fc-surf-t | Use tertiary surface text color as font color. |
.fc-surf-q | Use quaternary surface text color as font color. |
.fc-black | Use black as font color. |
.bg-p | Use primary color as background color. |
.bg-s | Use secondary color as background color. |
.bg-a | Use accent color as background color. |
.bg-surf-p | Use primary surface back color as background color. |
.bg-surf-s | Use secondary surface back color as background color. |
.bg-surf-t | Use tertiary surface back color as background color. |
.bg-surf-q | Use quaternary surface back color as background color. |
.bg-black | Use black as background color. |
Fluid Container
OmniCSS Grid System
- Responsive Columns: Supports 1 to 12 columns, adjustable using classes like .grid.fr1 to .grid.fr12.
- Dense Layout: The .grid.dense class enables automatic filling of available space.
- Automatic Column Layout: The .grid.auto class dynamically adjusts columns based on available width, ensuring consistent item sizes.
- Breakpoint Control: Offers tailored column settings for small (max-width: 767.98px) and large (max-width: 1199.98px) screens using suffixes -sm and -lg.
- Fluid Grid
- Traditional Grid
1. Basic Usage
Default Behavior
- gap: var(--space-xs) (small gap between items).
- Items flow in rows (default grid-auto-flow: row).
2. Column Layouts
Fixed Fractional Columns (1fr to 12fr)
- fr3-sm: 3 equal columns on small screens.
- fr6-md: 6 equal columns on medium screens.
- fr12-lg: 12 equal columns on large screens.
Fluid Column Widths (ch-based)
- Columns adjust between min(100%, {N}ch) and 1fr.
- Example: .ch30 → columns are at least 30ch wide (but shrink if needed).
Auto-Fit Dynamic Grid
...
- --grid-column-count: Sets max columns (default: 12).
- --grid-item--min-width: Minimum column width (100px by default).
- Override with .max{1-12}-{sm/md/lg} (e.g., .max4-md → max 4 columns on medium screens).
3. Grid Child Controls
Span Columns
- .fr{N}-{sm/md/lg}: Spans N columns at a given breakpoint.
- .fullwidth: Forces full-width (grid-column: 1 / -1).
Column Start Position
- .from{N}-{sm/md/lg}: Starts at column N.
4. Gap Utilities
Class | Gap Size (var(--space-*) ) |
---|---|
.gap-us |
Ultra-small (us ) |
.gap-xs |
Extra-small (xs ) |
.gap-sm |
Small (sm ) |
.gap-md |
Medium (md ) |
.gap-lg |
Large (lg ) |
.gap-xl |
Extra-large (xl ) |
5. Advanced Options
Dense Packing
- Fills gaps by reordering smaller items (grid-auto-flow: dense).
Breakpoints Reference
- sm: Small screens (mobile).
- md: Medium screens (tablet).
- lg: Large screens (desktop).
Gridable = Grid + Table
Dismissable .dissmissable
Dialogbox
Expandable .expandable
Board .board
Action Menu .action-menu
This is an action menuOmniCSS Installation
https://cdn.jsdelivr.net/gh/skpaul/omnicss@14.0.1/omni.min.css
https://cdn.jsdelivr.net/gh/skpaul/omnicss@14.0.1/omni.js
Base Layout
.layout class serves the foundation of your page design.
Start by placing your content inside the header, main, and footer sections—OmniCSS will handle the fluid scaling automatically.