Thanks to visit codestin.com
Credit goes to GitHub.com

Skip to content
/ wisp Public

🌬️ A zero-dependency UI engine that makes plain HTML look and feel handcrafted -automatically.

License

Notifications You must be signed in to change notification settings

rotsl/wisp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

42 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

🌬️ Wisp

GitHub CI GitHub Pages GitLab CI GitLab Pages License

npm version npm downloads

Context-aware, zero-dependency UI engine. Your HTML structure dictates the design.

~5KB total β€’ Zero config β€’ Zero dependencies β€’ Semantic-first

DOI

Wisp bridges the gap between "dumb beautiful" classless CSS and "smart complex" frameworks. It analyzes your HTML structure and automatically applies context-appropriate stylingβ€”no classes, no build step, no learning curve.

πŸ“Š Live Analysis Dashboard: GitHub | GitLab


✨ The Problem

Current solutions force a choice:

Approach Limitation
Classless CSS (Pico, OAT) Beautiful but staticβ€”doesn't adapt to content
Utility-first (Tailwind) Powerful but verbose, requires build step
Micro-frameworks (Alpine) Interactive but adds 15KB+ runtime

Wisp occupies the missing middle: intelligent, adaptive, and lighter than a PNG.


πŸš€ Quick Start

Option 1: Runtime (Dynamic)

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/rotsl/wisp@main/dist/wisp.min.css">
</head>
<body>
  <main>
    <h1>Your Content</h1>
    <p>Wisp automatically detects this is narrative content...</p>
  </main>
  <script src="https://cdn.jsdelivr.net/gh/rotsl/wisp@main/dist/wisp.min.js"></script>
</body>
</html>

Option 2: Auto-Fetch (CLI)

# Install
git clone https://github.com/rotsl/wisp.git
cd wisp
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# Fetch and optimize any webpage
./wisp-fetch https://en.wikipedia.org/wiki/Wiki --open

🧠 How It Works

1. Content Analysis

Wisp scans your DOM and calculates:

  • Density: Text-to-element ratio
  • Pattern: Prose vs. structured vs. technical
  • Context: Narrative, dashboard, form, or minimal

2. Dynamic Styling

Generates CSS custom properties:

:root {
  --wisp-context: narrative;
  --wisp-density: 0.45;
  --wisp-spacing-unit: 1rem;
  --wisp-line-height: 1.7;
  --wisp-max-width: 65ch;
}

3. Semantic Enhancements

  • Auto-expands <details> for narrative content
  • Adds skip links for deep nesting
  • Respects prefers-reduced-motion and prefers-color-scheme

πŸ“ Contexts

Wisp automatically detects four contexts:

Context Trigger Characteristics
Narrative >50% paragraphs Increased line-height, reading-optimized width
Dashboard Tables or 4+ cards Compact spacing, full-width, smaller text
Form 2+ inputs Medium width, comfortable touch targets
Minimal Default Balanced defaults

πŸ› οΈ Installation & Development

macOS / Linux Setup

# Clone repository
git clone https://github.com/rotsl/wisp.git
cd wisp

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Build distribution files
python scripts/build.py

# Run tests
python tests/test_scanner.py

# Install CLI tool (optional)
sudo ln -s $(pwd)/wisp-fetch /usr/local/bin/wisp-fetch

🎯 Usage Examples

CLI Auto-Fetcher

# Basic usage - fetch and optimize
wisp-fetch https://en.wikipedia.org/wiki/Wiki

# Output to specific file
wisp-fetch https://example.com -o my-site.html

# Generate CSS only
wisp-fetch https://example.com --css-only -o styles.css

# Minified output
wisp-fetch https://news.ycombinator.com -m

# Open immediately in browser
wisp-fetch https://example.com --open

# Extract specific section
wisp-fetch https://github.com/readme -s '.markdown-body'

Python API

from src.core.scanner import WispScanner

html = "<your-html-content>"
scanner = WispScanner(html)
analysis = scanner.analyze()

print(f"Context: {analysis.context}")  # narrative/dashboard/form/minimal
print(f"Pattern: {analysis.pattern}")  # prose/structured/technical/navigational

css = scanner.generate_css()

πŸ“ Project Structure

wisp/
β”œβ”€β”€ .github/           # GitHub Actions & templates
β”œβ”€β”€ .gitlab-ci.yml     # GitLab CI configuration
β”œβ”€β”€ dist/              # Built files (CSS/JS)
β”œβ”€β”€ docs/
β”‚   └── examples/      # Demo files
β”œβ”€β”€ scripts/           # Build automation
β”œβ”€β”€ src/               # Source code
β”œβ”€β”€ tests/             # Test suite
β”œβ”€β”€ wisp-fetch         # CLI entry point
└── README.md

πŸ“Š Benchmarks

Metric Wisp Pico Tailwind Alpine
Size ~5KB 15KB 0KB* 15KB
Runtime ~2KB 0KB 0KB 15KB
Config None CSS vars Extensive JS
Content-aware βœ… ❌ ❌ ❌
Build step Optional No Required No

*Tailwind requires build process; purged CSS varies.


πŸ“š Examples

Wikipedia Demo

Located in docs/examples/wikipedia-demo.html

wisp-fetch https://en.wikipedia.org/wiki/Wiki \
  -o docs/examples/wikipedia-demo.html \
  --open

What it shows:

  • Automatic detection of narrative context
  • prose pattern recognition
  • Reading-optimized typography (1.7 line-height, 65ch width)
  • Clean extraction of main content

Generated CSS Variables:

--wisp-context: narrative
--wisp-pattern: prose
--wisp-density: 0.25
--wisp-line-height: 1.7
--wisp-max-width: 65ch

🎯 Intent Attributes

Control behavior without classes:

<!-- Auto-expand in narrative context -->
<details data-wisp-expand="auto">
  <summary>More info</summary>
</details>

<!-- Hide on mobile -->
<aside data-wisp-fold="mobile">Sidebar content</aside>

<!-- High priority styling -->
<section data-wisp-priority="critical">
  Important information
</section>

🌐 Browser Support

  • Modern browsers: Chrome 88+, Firefox 78+, Safari 14+, Edge 88+
  • Legacy: Graceful degradation to semantic HTML
  • Accessibility: Full screen reader support with auto-generated ARIA

🀝 Philosophy

  1. HTML First β€” Semantic markup should look good by default
  2. Zero Config β€” Sensible defaults, escape hatches when needed
  3. Progressive Enhancement β€” Works without JavaScript, enhanced with it
  4. Performance Budget β€” Sub-5KB target

πŸ“ License

MIT Β© rotsl


πŸ—ΊοΈ Roadmap

  • Vue/React wrapper components
  • More contexts (e-commerce, documentation, wizard)
  • CSS-only fallback mode
  • Theme customization API
  • Browser extension for one-click optimization

🌬️ Wisp

Design that thinks for you

Zero Classes β€’ Zero Config β€’ Pure HTML

GitHub β€’ GitLab β€’ Live Demo

Built by @rotsl πŸ’™


About

🌬️ A zero-dependency UI engine that makes plain HTML look and feel handcrafted -automatically.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •