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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ordojs/css-frameworks

v0.1.0

Published

CSS framework integration system for OrdoJS - Tailwind CSS, Bootstrap, Bulma, Foundation support

Readme

@ordojs/css-frameworks

Comprehensive CSS framework integration system for OrdoJS applications. Provides seamless integration with popular CSS frameworks including Tailwind CSS, Bootstrap, Bulma, and Foundation, along with advanced optimization features.

Features

  • 🎨 Multi-Framework Support: Tailwind CSS, Bootstrap, Bulma, Foundation, and custom frameworks
  • JIT Compilation: Just-in-time compilation with hot reload support for Tailwind CSS
  • 🗜️ Advanced Optimization: CSS minification, unused class removal, and critical CSS extraction
  • 📱 Responsive Design: Built-in responsive utilities and breakpoint management
  • 🌙 Dark Mode: Automatic dark mode support and theme switching
  • 🔧 TypeScript: Full TypeScript support with comprehensive type definitions
  • 📊 Performance Monitoring: Built-in performance metrics and optimization suggestions
  • 🔄 Hot Reload: Development server integration with instant CSS updates

Installation

# Install the package
pnpm add @ordojs/css-frameworks

# Install peer dependencies for Tailwind CSS
pnpm add tailwindcss @tailwindcss/forms @tailwindcss/typography autoprefixer postcss

# Or for Bootstrap
pnpm add bootstrap @popperjs/core sass

Quick Start

Tailwind CSS Integration

import { createCSSFrameworkManager } from '@ordojs/css-frameworks';

// Initialize Tailwind CSS
const manager = await createCSSFrameworkManager({
  framework: 'tailwind',
  optimization: {
    contentPaths: ['./src/**/*.{js,ts,jsx,tsx,ordo}'],
    removeUnusedClasses: true,
    minify: true,
  },
});

// Compile CSS
const result = await manager.compile(`
  @tailwind base;
  @tailwind components;
  @tailwind utilities;
`);

console.log(result.css);

Bootstrap Integration

import { createCSSFrameworkManager } from '@ordojs/css-frameworks';

// Initialize Bootstrap
const manager = await createCSSFrameworkManager({
  framework: 'bootstrap',
  config: {
    theme: {
      colors: {
        primary: '#007bff',
        secondary: '#6c757d',
      },
    },
  },
});

// Compile with custom styles
const result = await manager.compile(`
  .my-component {
    @extend .btn-primary;
    border-radius: 0.5rem;
  }
`);

Framework-Specific Usage

Tailwind CSS

Basic Configuration

import { TailwindCSSAdapter } from '@ordojs/css-frameworks';

const adapter = new TailwindCSSAdapter();

await adapter.initialize({
  framework: 'tailwind',
  optimization: {
    contentPaths: ['./src/**/*.ordo'],
    removeUnusedClasses: true,
    minify: true,
    generateSourceMaps: true,
  },
});

// Generate configuration files
await adapter.generateConfig('./config');

Advanced Tailwind Configuration

const manager = await createCSSFrameworkManager({
  framework: 'tailwind',
  config: {
    theme: {
      extend: {
        colors: {
          brand: {
            50: '#eff6ff',
            500: '#3b82f6',
            900: '#1e3a8a',
          },
        },
        fontFamily: {
          sans: ['Inter', 'system-ui', 'sans-serif'],
        },
      },
    },
    plugins: ['@tailwindcss/forms', '@tailwindcss/typography'],
  },
  optimization: {
    criticalCSS: true,
    codeSplitting: {
      enabled: true,
      strategy: 'route',
    },
  },
});

Bootstrap

Theme Customization

import { BootstrapCSSAdapter } from '@ordojs/css-frameworks';

const adapter = new BootstrapCSSAdapter();

await adapter.initialize({
  framework: 'bootstrap',
  config: {
    theme: {
      colors: {
        primary: '#6366f1',
        secondary: '#64748b',
      },
      fonts: {
        primary: 'Inter, sans-serif',
      },
    },
    customVariables: {
      'border-radius': '0.5rem',
      'box-shadow': '0 4px 6px -1px rgba(0, 0, 0, 0.1)',
    },
  },
});

CSS Optimization

Advanced Optimization Features

import { CSSOptimizer } from '@ordojs/css-frameworks';

const optimizer = new CSSOptimizer({
  removeUnusedClasses: true,
  minify: true,
  criticalCSS: true,
  contentPaths: ['./src/**/*.{html,js,ts,ordo}'],
  codeSplitting: {
    enabled: true,
    chunkSize: 50000,
    strategy: 'component',
  },
});

const result = await optimizer.optimize(cssContent);

console.log(`
  Original size: ${result.stats.originalSize} bytes
  Optimized size: ${result.stats.optimizedSize} bytes
  Compression ratio: ${(result.stats.compressionRatio * 100).toFixed(1)}%
  Removed rules: ${result.stats.removedRules}
`);

Critical CSS Extraction

const { critical, remaining } = await optimizer.extractCriticalCSS(css, {
  html: ['./src/index.html', './src/pages/*.html'],
  dimensions: [
    { width: 1200, height: 900 },
    { width: 768, height: 1024 },
  ],
  include: ['.hero', '.navbar'],
  exclude: ['.modal', '.tooltip'],
});

// Inline critical CSS, defer remaining CSS

Hot Reload and Development

Development Server Integration

const manager = await createCSSFrameworkManager({
  framework: 'tailwind',
  development: {
    hotReload: true,
    sourceComments: true,
    verbose: true,
  },
});

// Listen for hot reload events
manager.onHotReload((event, data) => {
  if (event === 'css-update') {
    console.log(`CSS updated: ${data.file}`);
    // Trigger browser reload or CSS injection
  }
});

CLI Integration

This package integrates seamlessly with the OrdoJS CLI:

# Initialize Tailwind CSS
ordojs css-framework tailwind --output ./styles --content "./src/**/*.ordo"

# Bootstrap with custom configuration
ordojs css-framework bootstrap --output ./styles --source-maps

# Custom framework
ordojs css-framework custom --css-file ./custom.css --output ./dist

Performance Monitoring

Built-in Performance Metrics

const manager = await createCSSFrameworkManager(options);

// Compile CSS
await manager.compile(cssInput);

// Get performance metrics
const suggestions = await manager.getOptimizationSuggestions('./project');
console.log('Optimization suggestions:', suggestions);

// Validate compatibility
const { valid, issues } = await manager.validateCompatibility('tailwind', './project');
if (!valid) {
  console.warn('Compatibility issues:', issues);
}

Framework Detection

Automatic Framework Detection

const detection = await manager.detectFrameworks('./project');

console.log({
  frameworks: detection.frameworks,
  confidence: detection.confidence,
  configFiles: detection.configFiles,
  conflicts: detection.conflicts,
});

TypeScript Support

The package includes comprehensive TypeScript definitions:

import type {
  CSSFramework,
  CSSFrameworkOptions,
  CSSCompilationResult,
  CSSOptimizationOptions,
  TailwindConfig,
  BootstrapConfig,
} from '@ordojs/css-frameworks';

// Full type safety for all configuration options
const options: CSSFrameworkOptions = {
  framework: 'tailwind',
  optimization: {
    removeUnusedClasses: true,
    minify: true,
    generateSourceMaps: true,
  },
};

API Reference

Core Classes

  • CSSFrameworkIntegrationManager: Main integration manager
  • TailwindCSSAdapter: Tailwind CSS specific adapter
  • BootstrapCSSAdapter: Bootstrap specific adapter
  • CSSOptimizer: Advanced CSS optimization engine

Utility Functions

  • createCSSFrameworkManager(options): Quick setup factory
  • compileTailwindCSS(input, options): Direct Tailwind compilation

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Run the test suite: pnpm test
  6. Submit a pull request

License

MIT © OrdoJS Team

Changelog

v0.1.0

  • Initial release with Tailwind CSS and Bootstrap support
  • Advanced CSS optimization engine
  • Hot reload development integration
  • Comprehensive TypeScript definitions
  • CLI integration with OrdoJS

For more information, visit the OrdoJS documentation.