Hamburger Icon
Candy Icon

OmniCSS: The CSS Framework

The System
OmniCSS Installation
The easiest way to use from CDN below-
https://cdn.jsdelivr.net/gh/skpaul/omnicss@14.0.7/omni.min.css
https://cdn.jsdelivr.net/gh/skpaul/omnicss@14.0.7/omni.js
As an alternative, download the latest repo from GitHub.
Container
.container sets max-width 1200px (default), centered with auto margins and padding
.container-fluid full width container, takes 100% width with horizontal padding
.container-1100 sets max-width 1100px, centered with auto margins
.container-1000 sets max-width 1000px, centered with auto margins
.container-900 sets max-width 900px, centered with auto margins
.container-800 sets max-width 800px, centered with auto margins
.container-700 sets max-width 700px, centered with auto margins
.container-600 sets max-width 600px, centered with auto margins
System-Based Dark & Light Themes
OmniCSS automatically adapts to your system's theme preference using CSS variables and @media (prefers-color-scheme: dark).

No JavaScript or manual toggles required—just pure CSS that respects your OS settings.

Example:

@media (prefers-color-scheme: dark) {
  :root { --primary-surface-bg: #292a2d; }
}
Responsive Breakpoints & Media Queries

OmniCSS uses a desktop approach with six responsive breakpoints. Each breakpoint has corresponding utility class suffixes and Sass mixins for custom styling.

Breakpoint Values

Extra Large (xl)
min-width: 1400px
Large (lg)
min-width: 1200px
Medium (md)
max-width: 992px
Small (sm)
max-width: 768px
Extra Small (xs)
max-width: 576px
Ultra Small (us)
max-width: 480px

Responsive Utility Class Suffixes

Append breakpoint suffixes to any utility class to apply styles at specific screen sizes. Examples:

.fs-20-sm
Font size 2.0rem on small devices
.pa-10-md
Padding 1.0rem on medium devices
.mb-20-xs
Margin bottom 2.0rem on extra small devices
.grid.fr3-sm
3-column grid on small devices
.grid.fr1-xs
Single column on extra small devices
.hide-md
Hide element on medium devices and below

Sass Mixins for Custom Styles

Use these mixins in your custom SCSS to write responsive styles:

Available Mixins

  • @include xl { ... } - Extra Large devices (min-width: 1400px)
  • @include lg { ... } - Large devices (min-width: 1200px)
  • @include md { ... } - Medium devices (max-width: 992px)
  • @include sm { ... } - Small devices (max-width: 768px)
  • @include xs { ... } - Extra Small devices (max-width: 576px)
  • @include us { ... } - Ultra Small devices (max-width: 480px)
Surface Hierarchy
A 'Surface' Defines background, foreground and border colors using a single class. OmniCSS has four surface levels.
  • Purpose: Define visual layering (z-axis depth) for UI containers.
  • Use Case: Backgrounds, cards, panels, and structural elements.
.surf-p
Primary Surface
.surf-s
Secondary Surface
.surf-s
Tertiary Surface
.surf-q
Quaternary Surface
Color System

OmniCSS has the following color system-

  • Brand/Functional Colors

    • Primary Brand Color
    • Secondary Brand Color
  • Semantic Colors

    • Success
    • Caution
    • Info
    • Critical
  • Surface Hierarchy Colors

See more details and examples in the respective section below.

Omni Components
Gridable = Grid + Table
Use .gridable for gridable component. Use .us/.sm/.md to make it reponsive at your target devices.
Col-1
Col-2
Col-3
Col-4
Col-5
One
Two
Three
Four
Five
One
Two
Three
Four
Five
Dismissable .dissmissable
.dismissable for a dismissable notice. Mention expiry in days. Must have a unique id for each dismissable.
This is a .dismissable using primary surface .surf-p
Don't show
This is a .dismissable using secondary surface .surf-s
Don't show
This is a .dismissable using tertiary surface .surf-t
Don't show
This is a .dismissable using quaternary surface .surf-s
Don't show
This is a .info dismissable.
Don't show
This is a .success dismissable.
Don't show
This is a .caution dismissable.
Don't show
This is a .critical dismissable.
Don't show
Dialogbox

The native HTML <dialog> element creates accessible modal dialogs with built-in backdrop, focus management, and keyboard support. No JavaScript required for basic functionality—just use method="dialog" on the form and a simple showModal() call.

Dialog Content-1
A message to the users.
Dialog Content-2
A message to the users.
View Source:
Board .board

Boards are attention-grabbing content containers with a subtle left border accent. Perfect for notices, announcements, alerts, or highlighting important information. Combine with semantic color classes (.success, .info, .caution, .critical) for visual meaning.

This is a .success board
This is a .info board
This is a .caution board
This is a .critical board
Pill .pill

Pills are compact, rounded inline badges perfect for tags, labels, status indicators, or highlighting short text snippets. They automatically adapt to light and dark themes. Combine with semantic color classes (.success, .info, .caution, .critical) or surface classes (.surf-s, .surf-t) for visual context.

.success
.info
.caution
.critical
Action Menu .action-menu

A CSS-only kebab menu (three vertical dots ⋮) that reveals contextual actions on click. Perfect for table rows, cards, or anywhere you need compact action menus. Uses a checkbox input for state management—no JavaScript required except for auto-closing when clicking menu items. Add the .close-menu class to any link to automatically dismiss the menu after selection.

This is an action menu:

Note: The checkbox id and label's for attribute must match (e.g., both "menu1").

Forms .field

OmniCSS provides clean, theme-aware form styling with consistent sizing, smooth transitions, and accessible states. All form elements use CSS variables for easy theming and support both light and dark modes automatically.

Basic Form Structure

Use the .field wrapper for consistent vertical spacing between form elements.

Required Fields

Add the .required class to labels to display a red asterisk (*).

Textbox Class

Use .textbox to make any element look like a text input. Perfect for displaying readonly data.

#ORD-2025-001234
Completed

Radio & Checkbox Groups

Use .radio-group and .checkbox-group for grouped inputs.

View Source
View Source

Form Theming

All form elements use CSS variables for theming. See the Form Input Variables section in the CSS Variables - Customization Reference above for the complete list of customizable properties.

đź’ˇ Interactive States: Form elements feature smooth transitions on hover and focus, with an inset box shadow on focus for better accessibility.

Utility Classes
Typography
Font Sizes
Font sizes .fs-* — Fixed font sizes from 0.1rem to 4.0rem.
.fs-01
.fs-02
.fs-03
.fs-04
.fs-05
.fs-06
.fs-07
.fs-08
.fs-09
.fs-10
.fs-11
.fs-12
.fs-13
.fs-14
.fs-15
.fs-16
.fs-17
.fs-18
.fs-19
.fs-20
.fs-21
.fs-22
.fs-23
.fs-24
.fs-25
.fs-26
.fs-27
.fs-28
.fs-29
.fs-30
.fs-31
.fs-32
.fs-33
.fs-34
.fs-35
.fs-36
.fs-37
.fs-38
.fs-39
.fs-40

Responsive Font Sizes

All font size classes include responsive variants for each breakpoint. Append -xl, -lg, -md, -sm, -xs, or -us to any font size class.

.fs-25-xl
.fs-25-lg
.fs-25-md
.fs-25-sm
.fs-25-xs
.fs-25-us
Text Styling

Quick font style utilities:

Bold Text
.b - font-weight: bold
Italic Text
.i - font-style: italic
Font Weight

Font Weight

Control text weight with .fw-* classes (100-900):

Thin (100)
Extra Light (200)
Light (300)
Normal (400)
Medium (500)
Semi Bold (600)
Bold (700)
Extra Bold (800)
Black (900)
Available classes: .fw-100, .fw-200, .fw-300, .fw-400, .fw-500, .fw-600, .fw-700, .fw-800, .fw-900
Text Alignment

Text Alignment

Control horizontal text alignment:

Left Aligned
.left
Center Aligned
.center
Right Aligned
.right
Justified text distributes evenly across the full width of the container.
.justify
Text Transform
uppercase text
.ucase - text-transform: uppercase
LOWERCASE TEXT
.lcase - text-transform: lowercase
capitalize each word
.ccase - text-transform: capitalize
Text Decoration

Text Decoration

Add or remove text decorations:

Underlined Text
.uline - text-decoration: underline
Overlined Text
.oline - text-decoration: overline
Link with no underline
.noline - text-decoration: none
Padding

Fixed padding utilities from 0 to 4.0rem in 0.1rem increments.

Padding All Sides .pa-*

.pa-0
.pa-01
.pa-02
.pa-05
.pa-10
.pa-15
.pa-20
.pa-40

Directional Padding

Use .pl-* (left), .pr-* (right), .pt-* (top), .pb-* (bottom) with values from 0 to 40.

.pl-05
.pr-10
.pt-15
.pb-20

Axis Padding

Use .pv-* for vertical (top + bottom) and .ph-* for horizontal (left + right).

.pv-10
.ph-15

Responsive Padding

All padding classes include responsive variants for each breakpoint. Append -xl, -lg, -md, -sm, -xs, or -us to any padding class.

Examples:

.pa-10-sm
1.0rem padding on all sides on small devices
.pt-05-md
0.5rem padding top on medium devices
.ph-20-xs
2.0rem horizontal padding on extra small devices

đź’ˇ Note: All padding utilities (pa, pt, pb, pl, pr, pv, ph) support responsive breakpoints for complete layout control across all device sizes.

Margin

Fixed margin utilities from 0 to 4.0rem in 0.1rem increments.

Margin All Sides .ma-*

.ma-0
.ma-01
.ma-02
.ma-05
.ma-10
.ma-15
.ma-20
.ma-40

Directional Margin

Use .ml-* (left), .mr-* (right), .mt-* (top), .mb-* (bottom) with values from 0 to 40.

.ml-05
.mr-10
.mt-15
.mb-20

Axis Margin

Use .mv-* for vertical (top + bottom) and .mh-* for horizontal (left + right).

.mv-10
.mh-15

Responsive Margin

All margin classes include responsive variants for each breakpoint. Append -xl, -lg, -md, -sm, -xs, or -us to any margin class.

Examples:

.ma-10-sm
1.0rem margin on all sides on small devices
.mt-05-md
0.5rem margin top on medium devices
.mh-20-xs
2.0rem horizontal margin on extra small devices

Auto Margin

Use auto margins for horizontal centering or pushing elements:

.ml-auto
Push element to the right
.mr-auto
Push element to the left
.mh-auto
Center element horizontally
.ma-auto
Auto margin on all sides

đź’ˇ Note: All margin utilities (ma, mt, mb, ml, mr, mv, mh) support responsive breakpoints for complete layout control across all device sizes. Auto margins also support responsive variants like .ml-auto-sm.

Colors

OmniCSS provides a comprehensive set of color utility classes for quick styling. All utilities use CSS variables for automatic light/dark mode support.

By Color System

Using Primary Color

  • .fc-p Font color : This line is using primary color as font color.
  • .bg-p Background color : This line is using primary color as background color.
  • .bc-p Border color : This line has primary color as border color.

Using Secondary Color

  • .fc-s Font color : This line is using secondary color as font color.
  • .bg-s Background color : This line is using secondary color as background color.
  • .bc-p Border color : This line has secondary color as border color.

Using Semantic Color

Use semantic colors for complete styling (background + text + border) the alerts and status messages on any element.

  • .success
  • .caution
  • .info
  • .critical
By Property

Font Color .fc-*

  • .fc-p : This line is using primary color as font color.
  • .fc-s : This line is using secondary color as font color.
  • .fc-s : This line is using accent color as font color.

Background Color .bg-*

  • .bg-p : This line is using primary color as background color.
  • .bg-s : This line is using secondary color as background color.
  • .bg-s : This line is using accent color as background color.

Border Color .bc-*

  • .bc-p : This line is using primary color as border color.
  • .bc-s : This line is using secondary color as border color.
  • .bc-s : This line is using accent color as border color.
Using surface color in other element

Apply surface hierarchy text colors:

  • .fc-surf-p : Set the font color of other element same as primary surface's font color.
  • .fc-surf-s : Set the font color of other element same as secondary surface's font color.
  • .fc-surf-t : Set the font color of other element same as tertiary surface's font color.
  • .fc-surf-q : Set the font color of other element same as quaternary surface's font color.

  • .bg-surf-p : Set the background color of other element same as primary surface's background color.
  • .bg-surf-s : Set the background color of other element same as secondary surface's background color.
  • .bg-surf-t : Set the background color of other element same as tertiary surface's background color.
  • .bg-surf-q : Set the background color of other element same as quaternary surface's background color.

  • .bc-surf-p : Set the border color of other element same as primary surface's border color.
  • .bc-surf-s : Set the border color of other element same as secondary surface's border color.
  • .bc-surf-t : Set the border color of other element same as tertiary surface's border color.
  • .bc-surf-q : Set the border color of other element same as quaternary surface's border color.
Brightness Filter Utilities

Control the brightness of any element using CSS filter utilities. Perfect for adjusting image brightness, or fine-tuning visual hierarchy.

Available Brightness Levels

Apply brightness filters from 80% (darker) to 120% (brighter):

80%
.bright-080
85%
.bright-085
90%
.bright-090
95%
.bright-095
100% (default)
.bright-100
105%
.bright-105
110%
.bright-110
115%
.bright-115
120%
.bright-120

Brightness Scale Comparison

.bright-080 - Darker (80%)
.bright-085 - Dark (85%)
.bright-090 - Slightly Dark (90%)
.bright-095 - Almost Normal (95%)
.bright-100 - Normal (100%)
.bright-105 - Slightly Bright (105%)
.bright-110 - Bright (110%)
.bright-115 - Brighter (115%)
.bright-120 - Brightest (120%)

Practical Examples

Example 1: Muted Background
This info box has a dimmed appearance using .bright-085
Example 2: Highlighted Element
This success message appears brighter using .bright-110
Example 3: Subtle Variations
Subtle Card

90% brightness

Normal Card

100% brightness

Bright Card

110% brightness

đź’ˇ Pro Tip: Brightness filters work on all elements including backgrounds, text, and images. Use .bright-080 to .bright-095 for darkening effects and .bright-105 to .bright-120 for brightening. Combine with hover effects like .darken:hover or .brighten:hover for interactive elements.

đź’ˇ Best Practice: Use .surf-* classes for layout hierarchy and semantic classes (.success, .info, etc.) for meaningful states. All classes automatically adapt to light/dark mode.

Positioning

Positioning

Quick position utilities:

.relative - position: relative
.fixed - position: fixed
.absolute - position: absolute
Hover Effects

Hover Effects

Apply hover brightness effects to any element:

Hover me (.darken)
Darkens to 85% brightness on hover
Hover me (.brighten)
Brightens to 115% on hover
.darken:hover - Reduces brightness to 85%
.brighten:hover - Increases brightness to 115%
Display
.hidden - display: none
.inline - display: inline
.block - display: block
.iblock - display: inline-block
Flexbox

Flexbox Utilities

Powerful flexbox layout utilities:

Container Classes

.flex - display: flex
.iflex - display: inline-flex

Direction Classes

.fd-row - flex-direction: row
.fd-col - flex-direction: column

Alignment Classes

.jc-center - justify-content: center
.ai-center - align-items: center
.flex-center - centers both horizontally & vertically

Flexbox Examples

Centered with .flex .jc-center .ai-center
Centered with .flex-center
Item 1
Item 2
Item 3
Using .flex .fd-col

Width Utilities

Responsive width classes based on content:

.w-fit
width: fit-content
.w-min
width: min-content
.w-max
width: max-content
Divider

Dividers

Horizontal line separators:

Content above divider

Content below divider

Use .line, .separator, or .divider for horizontal dividers
Buttons
.btn - Base button style
.btn-primary - Primary color button
.btn-outline - Transparent with border
Border Utilities

Comprehensive border utilities for controlling borders on all sides, individual sides, or axis combinations. Combine with color utilities for custom border colors.

Border All Sides

Apply a 1px solid border to all sides:

.ba - Border on all sides
Note: Border color inherits from the element's color or can be set using color utilities.

Border Directional (Individual Sides)

Apply borders to specific sides:

Border Top
.bt
Border Bottom
.bb
Border Left
.bl
Border Right
.br

Border Horizontal & Vertical

Apply borders on two sides at once:

Horizontal Borders
.bh - Left + Right borders
Vertical Borders
.bv - Top + Bottom borders

Border Width

Control border thickness (0-5px):

No Border
.bw-0
1px
.bw-1
2px
.bw-2
3px
.bw-3
4px
.bw-4
5px
.bw-5

Border Style

Change border appearance:

Solid
.bs-solid
Dashed
.bs-dashed
Dotted
.bs-dotted
Double
.bs-double
None
.bs-none

Practical Examples

Example 1: Card with Custom Border

Special Offer!

Limited time deal - 2px dashed border

<div class="ba bw-2 bs-dashed surf-p pa-15">
    <h4 class="b">Special Offer!</h4>
    <p class="mt-08">Limited time deal</p>
</div>

Example 2: Bottom Border for Sections

Section Title

Content with a decorative bottom border above

<div class="bb bw-2 pb-sm mb-sm">
    <h5 class="b">Section Title</h5>
</div>

Example 3: Combining with Colors

Primary Border
Secondary Border
Success Border
<div class="ba bw-3 surf-p pa-15" style="border-color: var(--color-primary);">
    Primary Border
</div>

đź’ˇ Pro Tip: Combine border utilities for maximum flexibility: .ba .bw-3 .bs-dashed creates a 3px dashed border on all sides. Border colors can be set using inline styles with CSS variables or by combining with color classes.

Customize OmniCSS

Override these CSS custom properties in your own stylesheet to customize OmniCSS to match your brand.

Core Design Tokens

Brand Colors

Note: --color-black is #2d2d2d in light mode and #e0e0e0 in dark mode for theme consistency.

Surface System (Auto Light/Dark)

Light Mode (Default)

Dark Mode (System Preference)

Semantic Alert Colors

Light Mode

Dark Mode

Form Input Variables

Customize form elements by overriding these variables:

Light Mode

Dark Mode

Customization Example

Create your own stylesheet and override the variables:

đź’ˇ Tip: Load your custom stylesheet after omni.css to ensure your variables override the defaults.

Page Template
Header Template
.fixed for always top and visible. .smart for Sticky header. Auto hide/show on scroll.
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 layout automatically.

Understanding the Layout Structure

.layout - The Container

The .layout class creates a full-viewport grid with three rows: header, main, and footer. It ensures the footer always stays at the bottom, even on pages with minimal content.

header - Fixed Height

The header section has a fixed height of 60px and contains your site navigation, logo, and other top-level UI elements. Add .fixed or .smart classes for sticky header behavior.

main - Flexible Content Area

The main section takes up all remaining vertical space using 1fr (fractional unit). Content here scrolls independently if it exceeds the viewport height. This is where your page content lives.

footer - Auto Height

The footer has automatic height based on its content. It always sits at the bottom of the viewport or below the main content, whichever is lower—creating a "sticky footer" effect without JavaScript.