kranium.css ยท Dark UI Library
v2.0.0 โ€” stable Download CSS
๐Ÿฆด Kranium.css v2.0

Kranium CSS

A single-file, zero-dependency CSS library for beautiful dark-themed interfaces. Built for git viewers, webmail clients, portfolios, and developer tools.

<link rel="stylesheet" href="kranium.css"> ~28 KB Zero dependencies CSS Custom Properties
๐Ÿ“ฆ Installation

Drop kranium.css into your project โ€” no build step, no npm, no bundler required.

HTML
<!-- Option 1: Local file -->
<link rel="stylesheet" href="kranium.css">

<!-- Option 2: Direct import in CSS -->
@import url('kranium.css');
๐Ÿ’ก
Tip: Add font-family: var(--k-font-mono) from a CDN like Google Fonts (JetBrains Mono) for the best monospace rendering in code components.
๐ŸŽจ CSS Variables

All design tokens are defined as CSS custom properties on :root. Override any variable to theme your project without touching the source file.

Color Palette
BG Deep
--k-bg-deep
BG Card
--k-bg-card
BG Elevated
--k-bg-elevated
Accent Bright
--k-accent-bright
Success
--k-success
Warning
--k-warning
Danger
--k-danger
Info
--k-info
Customization
CSS
/* Override in your own stylesheet after importing kranium.css */
:root {
  --k-accent:        #1a4b8c;   /* change brand color */
  --k-accent-bright: #2563eb;
  --k-accent-dim:    rgba(37, 99, 235, 0.18);
  --k-accent-glow:   0 0 18px #1d4ed8;
  --k-bg-deep:       #080c14;   /* darker background */
}
โœ๏ธ Typography

Semantic heading scale, display/hero text helpers, gradient text, and utility classes for color and size.

Heading 1 โ€” 2.4rem

Heading 2 โ€” 1.8rem

Heading 3 โ€” 1.4rem

Heading 4 โ€” 1.15rem

Body text โ€” secondary color, 1.5 line-height

Inline code โ€” monospace with accent color

Gradient Headline
"A stylish blockquote with accent border and subtle background."
Display / Hero classes
HTML
<h1 class="k-display">Big Hero Title</h1>
<h2 class="k-headline">Section Headline</h2>
<p  class="k-lead">Intro paragraph with larger font</p>
<span class="k-gradient-text k-display">Gradient Text</span>
๐Ÿ—‚๏ธ Layout & Grid

Container widths, responsive grid columns, column span helpers, and the app-shell layout for sidebar-based interfaces.

HTML โ€” App Shell
<div class="k-app-shell">
  <aside class="k-sidebar">...</aside>
  <main  class="k-main-content">
    <div class="k-page">
      <!-- your content -->
    </div>
  </main>
</div>
HTML โ€” Grid
<!-- 2-column grid -->
<div class="k-grid k-grid-cols-2">
  <div class="k-card">...</div>
  <div class="k-card">...</div>
</div>

<!-- 12-column with spans -->
<div class="k-grid k-grid-cols-12">
  <div class="k-col-span-8">Main</div>
  <div class="k-col-span-4">Sidebar</div>
</div>
๐Ÿ–ฑ๏ธ Buttons

Six variants, five sizes, icon-only, full-width, and a button group component.

Variants
HTML
<button class="k-btn k-btn-primary">Primary</button>
<button class="k-btn k-btn-secondary">Secondary</button>
<button class="k-btn k-btn-outline">Outline</button>
<button class="k-btn k-btn-ghost">Ghost</button>
<button class="k-btn k-btn-success">Success</button>
<button class="k-btn k-btn-danger">Danger</button>
<button class="k-btn k-btn-primary" disabled>Disabled</button>
Sizes
HTML
<button class="k-btn k-btn-primary k-btn-xs">XS</button>
<button class="k-btn k-btn-primary k-btn-sm">SM</button>
<button class="k-btn k-btn-primary">Default</button>
<button class="k-btn k-btn-primary k-btn-lg">LG</button>
<button class="k-btn k-btn-primary k-btn-xl">XL</button>
Button Group
HTML
<div class="k-btn-group">
  <button class="k-btn k-btn-secondary">Code</button>
  <button class="k-btn k-btn-secondary">Issues</button>
  <button class="k-btn k-btn-secondary">Pull Requests</button>
</div>
๐Ÿƒ Cards

Base card, interactive hover, accent borders, stat cards, and card header/footer structure.

Default Card

A standard card with header.

Interactive

Hover to see lift + border glow.

Accent Card

Accent left border.

Total Commits
2,491
โ†‘ 12% this month
Open Issues
34
โ†“ 3 since last week
HTML
<!-- Interactive card -->
<div class="k-card k-card-interactive">
  <div class="k-card-header">
    <span class="k-card-title">Title</span>
    <button class="k-btn k-btn-ghost k-btn-sm">Action</button>
  </div>
  <p>Card content.</p>
  <div class="k-card-footer">
    <button class="k-btn k-btn-secondary k-btn-sm">Cancel</button>
    <button class="k-btn k-btn-primary k-btn-sm">Save</button>
  </div>
</div>

<!-- Stat card -->
<div class="k-card k-stat-card">
  <div class="k-stat-label">Total Commits</div>
  <div class="k-stat-value">2,491</div>
  <div class="k-stat-delta up">โ†‘ 12% this month</div>
</div>
๐Ÿ“ Forms & Inputs

Text inputs, select, textarea, input groups with affixes, search input, toggle switches, checkboxes.

https://
HTML
<div class="k-form-group">
  <label class="k-label k-label-required">Name</label>
  <input class="k-input" placeholder="Enter name">
  <span class="k-hint">Max 100 characters</span>
</div>

<!-- Input group with prefix -->
<div class="k-input-group">
  <span class="k-input-affix">https://</span>
  <input class="k-input" placeholder="example.com">
</div>

<!-- Toggle -->
<label class="k-toggle">
  <input type="checkbox">
  <div class="k-toggle-track"></div>
  Enable feature
</label>
๐Ÿท๏ธ Badges & Tags
Accent Success Warning Danger Info Muted Online Offline
typescript react rust ร— docker
HTML
<span class="k-badge k-badge-success">Success</span>
<span class="k-badge k-badge-danger k-badge-dot">Error</span>

<!-- Deletable tag -->
<span class="k-tag">rust <span class="k-tag-close">ร—</span></span>
๐Ÿ”” Alerts & Toasts
โ„น๏ธ
Information
Your pipeline is running. This may take a few minutes.
โœ…
Deployed
Version 2.4.1 is live on production.
โš ๏ธ
Deprecation Warning
This API endpoint will be removed in v3.0.
๐Ÿšจ
Build Failed
3 tests failed in ci/test suite. Check the logs.
HTML
<div class="k-alert k-alert-success">
  <span class="k-alert-icon">โœ…</span>
  <div>
    <div class="k-alert-title">Deployed</div>
    <div class="k-alert-body">Version 2.4.1 is live.</div>
  </div>
</div>

<!-- Toast container (fixed position) -->
<div class="k-toast-container">
  <div class="k-toast k-toast-success">โœ… Commit pushed successfully</div>
</div>
๐Ÿ“‘ Tabs & Segmented Control
Overview
Commits 142
Branches
Tags
Day
Week
Month
Year
HTML
<div class="k-tabs">
  <div class="k-tab active">Overview</div>
  <div class="k-tab">Commits</div>
  <div class="k-tab">Branches</div>
</div>

<div class="k-segmented">
  <div class="k-segmented-item active">Day</div>
  <div class="k-segmented-item">Week</div>
  <div class="k-segmented-item">Month</div>
</div>
๐Ÿ‘ค Avatars
JD
AB
CD
EF
GH
A
B
C
+4
ON
MK
Martin K.
Maintainer
HTML
<div class="k-avatar k-avatar-lg">JD</div>

<!-- With image -->
<div class="k-avatar k-avatar-md">
  <img src="avatar.jpg" alt="Jane">
</div>

<!-- Online status -->
<div class="k-avatar-wrap">
  <div class="k-avatar">AB</div>
  <div class="k-avatar-status online"></div>
</div>

<!-- User row -->
<div class="k-user-row">
  <div class="k-avatar k-avatar-sm">MK</div>
  <div>
    <div class="k-user-row-name">Martin K.</div>
    <div class="k-user-row-meta">Maintainer</div>
  </div>
</div>
โš™๏ธ Git / Code Components

Purpose-built for git web interfaces: diff viewer, commit list, code blocks, branch/ref chips, PR/issue status badges.

Diff View
src/auth/session.ts
+12 โˆ’4
@@ -18,7 +18,15 @@ export function createSession()
18 const expires = new Date();
19 expires.setHours(expires.getHours() + 1);
19 expires.setDate(expires.getDate() + 7);
20 if (rememberMe) expires.setFullYear(expires.getFullYear() + 1);
21 return { token, expires };
Commit List
A
feat: add persistent session support with remember-me option
a3f92c1 2 hours ago
M
fix: resolve race condition in concurrent request handler
e819d3a yesterday
B
chore: upgrade dependencies to latest patch versions
7c4b12f 3 days ago
Refs & Issue States
main feat/auth v2.1.0 HEAD โ— Open โœ• Closed โŠ• Merged โ—Œ Draft
HTML
<span class="k-ref k-ref-branch">main</span>
<span class="k-ref k-ref-tag">v2.1.0</span>
<span class="k-ref k-ref-head">HEAD</span>

<span class="k-issue-state k-issue-open">โ— Open</span>
<span class="k-issue-state k-issue-merged">โŠ• Merged</span>
๐Ÿ—„๏ธ File Tree
HTML
<div class="k-file-tree">
  <a class="k-tree-item dir">๐Ÿ“ src</a>
  <div class="k-tree-indent">
    <a class="k-tree-item active">๐Ÿ“„ index.ts</a>
    <a class="k-tree-item">๐Ÿ“„ app.ts</a>
  </div>
  <a class="k-tree-item">๐Ÿ“„ package.json</a>
</div>
๐Ÿ“Š Progress & Stats
Build progress72%
Tests passing94%
Disk usage81%
Language breakdown
โœ‰๏ธ Mail / Inbox

Mail rows (unread state, starred), mail thread reader, and compose window.

โ˜…
L
Linus T.
Re: Kernel patch โ€” memory allocator improvements
09:41
โ˜†
G
GitHub
[CI] Build #492 passed on main
Yesterday
โ˜†
A
Anna B.
Design review โ€” new dashboard mockups
Mon
HTML
<div class="k-mail-row unread">
  <div class="k-mail-star starred">โ˜…</div>
  <div class="k-avatar k-avatar-xs">L</div>
  <div class="k-mail-from">Linus T.</div>
  <div class="k-mail-subject">Re: Kernel patch...</div>
  <div class="k-mail-time">09:41</div>
</div>
๐ŸŒŸ Portfolio / Hero

Hero section, eyebrow label, glow orbs, feature cards, tech badges, and project cards.

โœจ Available for hire

Full-Stack Developer

I build fast, accessible, beautifully dark web applications. Rust on the back, TypeScript on the front.

๐Ÿฆ€ Rust โšก TypeScript โš›๏ธ React ๐Ÿณ Docker โ˜๏ธ AWS
HTML
<section class="k-hero">
  <div class="k-glow-orb k-glow-orb-primary" style="width:400px;height:400px;top:-100px;right:-100px"></div>
  <div class="k-container">
    <span class="k-hero-eyebrow">โœจ Available for hire</span>
    <h1 class="k-display k-gradient-text">Full-Stack Dev</h1>
    <p class="k-lead">Building fast, beautiful web apps.</p>
    <div class="k-hero-cta">
      <button class="k-btn k-btn-primary k-btn-lg">View Work</button>
      <button class="k-btn k-btn-ghost k-btn-lg">Contact Me</button>
    </div>
  </div>
</section>
๐Ÿ“„ Breadcrumb & Pagination
โ€ฆ
๐Ÿ’ฌ Tooltip

Pure CSS tooltips via data-tooltip attribute. Supports four positions.

HTML
<button data-tooltip="Tooltip text">Top (default)</button>
<button data-tooltip="Below" data-tooltip-pos="bottom">Bottom</button>
<button data-tooltip="Right" data-tooltip-pos="right">Right</button>
<button data-tooltip="Left"  data-tooltip-pos="left">Left</button>
๐Ÿ‘ป Skeleton Loader
HTML
<div class="k-skeleton k-skeleton-title"></div>
<div class="k-skeleton k-skeleton-text"></div>

<!-- Skeleton row (avatar + lines) -->
<div class="k-skeleton-row">
  <div class="k-skeleton k-skeleton-avatar"></div>
  <div class="k-skeleton-row-body">
    <div class="k-skeleton k-skeleton-text" style="width:55%"></div>
    <div class="k-skeleton k-skeleton-text" style="width:35%"></div>
  </div>
</div>
๐Ÿ’Š Chips & Pills
All
Open
Closed
Merged
๐Ÿ› Bug
โœจ Feature
๐Ÿ“– Docs
๐Ÿ”’ Security
Loading spinners
Keyboard shortcuts: โŒ˜ K
๐Ÿ”ง Utilities

A comprehensive set of utility classes for display, flexbox, spacing, text, colors, borders, and more.

CategoryClassesDescription
display.k-flex .k-inline-flex .k-block .k-hiddenDisplay values
flex.k-flex-col .k-items-center .k-justify-between .k-flex-1Flexbox helpers
gap.k-gap-1 โ†’ .k-gap-84px increments
padding.k-p-1 โ†’ .k-p-6 .k-px-* .k-py-*Padding utilities
margin.k-mt-* .k-mb-* .k-mx-auto .k-ml-autoMargin utilities
font size.k-text-xs .k-text-sm .k-text-lg .k-text-2xlType scale
font weight.k-font-bold .k-font-semibold .k-font-monoWeight & family
color.k-text-primary .k-text-muted .k-text-accent .k-text-successText colors
layout.k-w-full .k-h-full .k-min-h-screen .k-min-w-0Sizing
misc.k-truncate .k-rounded .k-glass .k-hover-lift .k-no-selectVisual helpers
responsive.k-hidden-sm .k-hidden-md .k-hidden-lgHide at breakpoints
๐Ÿฆด
Kranium.css v2.0

Single file ยท Zero dependencies ยท MIT License