npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

unocss-augmented-ui

v0.1.0

Published

UnoCSS plugin reimplementing augmented-ui.com for futuristic/cyberpunk UI styles

Readme

UnoCSS Augmented UI

A UnoCSS preset that reimplements augmented-ui.com for creating futuristic, cyberpunk-inspired UI components with ease.

Features

  • 🎨 Clip-path corners - Create angled, scooped, rounded, and notched corners
  • Glowing effects - Built-in inset shadows for cyberpunk aesthetics
  • 🎯 Simple utilities - Clean, UnoCSS-style class names
  • 🚀 Preset shortcuts - Pre-built panel, button, and card styles
  • 🔧 Customizable - Configure prefix, border width, and inset effects
  • 🛡️ Defensive programming - Input validation, sanitization, and security hardening

Installation

npm install unocss-augmented-ui

Usage

Basic Setup

// uno.config.ts
import { defineConfig, presetUno } from 'unocss'
import { presetAugmentedUI } from 'unocss-augmented-ui'

export default defineConfig({
  presets: [
    presetUno(),
    presetAugmentedUI({
      prefix: 'aug',              // Default: 'aug'
      defaultBorderWidth: '2px',  // Default: '2px'
      defaultInsetWidth: '2px',   // Default: '2px'
      maxClipSize: 9999,          // Default: 9999 (max px value for corners)
      maxBorderWidth: 999,        // Default: 999 (max px value for borders)
      maxInsetWidth: 999          // Default: 999 (max px value for insets)
    })
  ]
})

Examples

Corner Clips

<!-- Single corner -->
<div class="aug-tl-clip-15">Top-left clipped corner</div>
<div class="aug-tr-clip-15">Top-right clipped corner</div>
<div class="aug-br-clip-15">Bottom-right clipped corner</div>
<div class="aug-bl-clip-15">Bottom-left clipped corner</div>

<!-- Multiple corners -->
<div class="aug-clip-tl-15-br-15">Diagonal clips</div>
<div class="aug-clip-tl-10-tr-10-br-10-bl-10">All corners clipped</div>

Borders and Effects

<!-- Basic border -->
<div class="aug-border">Default 2px border</div>
<div class="aug-border-3">3px border</div>

<!-- Inset glow -->
<div class="aug-inset">Glowing inset effect</div>
<div class="aug-inset-8">Stronger glow (8px)</div>

<!-- Combined -->
<div class="aug-tl-clip-15 aug-br-clip-15 aug-border aug-inset">
  Cyberpunk panel
</div>

Preset Shortcuts

<!-- Pre-built component styles -->
<div class="aug-panel">Panel with default styling</div>
<button class="aug-button">Futuristic button</button>
<div class="aug-card">Card component</div>

Utilities Reference

Corner Utilities

| Class Pattern | Description | Example | |--------------|-------------|---------| | aug-{corner}-clip-{size} | Clip corner at angle | aug-tl-clip-15 | | aug-clip-{corners} | Multiple corners | aug-clip-tl-15-br-20 |

Corners: tl (top-left), tr (top-right), br (bottom-right), bl (bottom-left)

Border Utilities

| Class | Description | |-------|-------------| | aug-border | Default border (2px) | | aug-border-{width} | Custom border width | | aug-border-{color} | Colored border |

Effect Utilities

| Class | Description | |-------|-------------| | aug-inset | Inset glow effect (default) | | aug-inset-{width} | Custom inset glow | | aug-container | Base container styling |

Shortcuts

| Shortcut | Equivalent | |----------|-----------| | aug-panel | aug-container aug-tl-clip-10 aug-br-clip-10 aug-border aug-inset | | aug-button | aug-container aug-tl-clip-8 aug-br-clip-8 aug-border-2 aug-inset-4 | | aug-card | aug-container aug-tl-clip-15 aug-tr-clip-5 aug-br-clip-15 aug-bl-clip-5 aug-border aug-inset |

Examples

See the example/index.html file for a comprehensive demo showcasing:

  • Basic corner clips
  • Combined corner effects
  • Preset shortcuts
  • Gradient backgrounds
  • Interactive elements
  • Complex layouts

API

presetAugmentedUI(options)

Options

interface AugmentedUIOptions {
  /** Utility prefix (default: 'aug') */
  prefix?: string

  /** Default border width (default: '2px') */
  defaultBorderWidth?: string

  /** Default inset shadow width (default: '2px') */
  defaultInsetWidth?: string

  /** Maximum allowed clip size in pixels (default: 9999) */
  maxClipSize?: number

  /** Maximum allowed border width in pixels (default: 999) */
  maxBorderWidth?: number

  /** Maximum allowed inset width in pixels (default: 999) */
  maxInsetWidth?: number
}

Security & Safety

This preset implements extensive defensive programming practices:

Input Validation

  • ✅ All numeric inputs are sanitized and bounds-checked
  • ✅ Color names are validated against safe character patterns
  • ✅ CSS dimensions are validated for format and safety
  • ✅ Prefix is escaped to prevent regex injection

Bounds Checking

  • ✅ Maximum clip size: 9999px (configurable)
  • ✅ Maximum border width: 999px (configurable)
  • ✅ Maximum inset width: 999px (configurable)
  • ✅ Maximum 4 corners in combined utilities
  • ✅ String length limits on all inputs

Sanitization

  • ✅ Color names: alphanumeric, hyphens, underscores only
  • ✅ Numeric values: stripped of non-digit characters
  • ✅ Gradient directions: whitelisted values only
  • ✅ No special characters that could break CSS

Protection Against

  • 🛡️ CSS injection attacks
  • 🛡️ Prototype pollution
  • 🛡️ ReDoS (Regular Expression Denial of Service)
  • 🛡️ Type coercion attacks
  • 🛡️ Integer overflow
  • 🛡️ Malformed input strings

Error Handling

  • Graceful fallbacks for invalid configurations
  • Console warnings for configuration issues
  • Silent rejection of malicious inputs
  • Try-catch blocks around critical operations

Customization

You can customize colors using inline styles or UnoCSS color utilities:

<div class="aug-panel" style="border-color: #00d4ff;">
  Custom colored panel
</div>

<div class="aug-button hover:brightness-110">
  Interactive button with hover effect
</div>

Development

Testing

Run the test suite:

npm test

Run tests in watch mode:

npm run test:watch

Generate coverage report:

npm run test:coverage

The test suite includes:

  • Corner clip utilities (all positions and types)
  • Combined corner utilities
  • Border utilities (with and without colors)
  • Inset utilities (with and without colors)
  • Background gradient utilities
  • Preset shortcuts (panel, button, card)
  • Custom prefix configuration
  • Default width configuration
  • Hover variants
  • Edge cases and integration tests
  • Defensive programming tests (malicious inputs, injection attempts, boundary values)

License

MIT

Credits

Inspired by augmented-ui by James0x57