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

@tenoxui/moxie

v0.7.1

Published

Very lightweight utility-first CSS engine for style generation

Downloads

34

Readme

@tenoxui/moxie

tenoxui/moxie is a tiny and lightweight CSS generation engine for creating custom utility-first CSS framework easily.

Features

  • Customize Everything - moxie is very easy to configure, scalable for small and large project easily

  • Utility-First Based - Support any utility-first naming convention you like (m-2, m2, or m-2px)

  • It's Small! - The bundle itself is less than 4kB gzipped (currently :D)

Installation

Get started with moxie by running this command :

npm install @tenoxui/moxie

Usage Example

import { TenoxUI } from '@tenoxui/moxie'

const ui = new TenoxUI({
  // defining shorthands
  property: {
    // type: property
    m: 'margin', // basic shorthand
    p: {
      property: 'padding',
      value: ({ value, unit }) =>
        `${!isNaN(value + unit) ? 0.25 * Number(value) + 'rem' : value + unit}`
    }
  }
})

console.log(
  ui.process([
    'm-2px',
    'hover:m-2rem',
    'p-4', // 0.25 * 4 = 1rem
    'p-10px' // direct value
  ])
)

/* Output
[
  {
    className: 'm-2px',
    cssRules: 'margin',
    value: '2px',
    prefix: undefined
  },
  {
    className: 'm-2rem',
    cssRules: 'margin',
    value: '2rem',
    prefix: 'hover'
  },
  {
    className: 'p-4',
    cssRules: 'padding',
    value: '1rem',
    prefix: undefined
  },
  {
    className: 'p-10px',
    cssRules: 'padding',
    value: '10px',
    prefix: undefined
  }
]
*/

API

Exports

This package only have one main export and some types :

// index.d.ts
import type { Config, TenoxUIConfig, ProcessedStyle } from './types'
export * from './types'
export { Config, TenoxUIConfig }
export declare class TenoxUI {
  // ...
}
export default TenoxUI

Constructor

export class TenoxUI {
  constructor({ property = {}, values = {}, classes = {} } = {}) {
    this.property = property
    this.values = values
    this.classes = classes
  }
}

Public Methods

parse

A method for parsing class name.

parse(className: string) {}

Example :

const ui = new TenoxUI({
  m: 'margin',
  p: 'padding'
})

console.log(ui.parse('m-2px')) // => [ undefined, 'm', '2', 'px', undefined, undefined ]
console.log(ui.parse('hover:p-2rem/10px')) // => [ 'hover', 'p', '2', 'rem', '10', 'px' ]

processValue

A method for processing input value.

processValue(type: string, value: string, unit: string): string {}

Example :

const ui = new TenoxUI({
  property: {
    bg: {
      property: 'backgroundColor',
      value: 'rgb({0} / var(--bg-opacity, 1))'
    }
  },
  values: {
    // global values
    'red-500': '255 0 0',
    // type specific value
    bg: {
      'red-500': '0 0 255'
    }
  }
})

console.log(ui.processValue('', '10', 'rem')) // 10rem
console.log(ui.processValue('', '[calc(24_*_5)]')) // calc(24 * 5)
console.log(ui.processValue('', '$my-color')) // var(--my-color)
console.log(ui.processValue('', 'red-500')) // 255 0 0
console.log(ui.processValue('bg', 'red-500')) // 0 0 255

processShorthand

A method for processing rules from property field.

processShorthand(
  type: string | undefined,
  value: string | undefined,
  unit: string | undefined,
  prefix: string | undefined,
  secondValue?: string | undefined,
  secondUnit?: string | undefined,
  isHyphen?: boolean
): ProcessedStyle | null {}

Example :

const ui = new TenoxUI({
  property: {
    bg: {
      property: 'backgroundColor',
      value: 'rgb({0} / {1 | 100}%)'
    }
  },
  values: {
    'red-500': '255 0 0'
  }
})

console.log(ui.processShorthand('bg', 'red-500'))
console.log(ui.processShorthand('bg', '(0_255_0)', '', 'hover', '20', ''))

/* Output
{
  className: 'bg-red-500',
  cssRules: 'background-color',
  value: 'rgb(255 0 0 / 100%)',
  prefix: undefined
}
{
  className: 'bg-(0_255_0)/20',
  cssRules: 'background-color',
  value: 'rgb(0 255 0 / 20%)',
  prefix: 'hover'
}
*/

processCustomClass

A method for processing rules from classes field.

processCustomClass(
  className: string | undefined,
  value?: string | undefined,
  unit?: string | undefined,
  prefix?: string | undefined,
  secValue?: string | undefined,
  secUnit?: string | undefined,
  isHyphen?: boolean
): ProcessedStyle | null {}

Example :

const ui = new TenoxUI({
  classes: {
    display: {
      flex: 'flex',
      iflex: 'inline-flex'
    },
    '--bg-opacity': {
      bg: '{1}% || 1'
    },
    backgroundColor: {
      bg: 'rgb({0} / var(--bg-opacity)) || red'
    }
  },
  values: {
    'red-500': '255 0 0'
  }
})

console.log(ui.processCustomClass('bg'))
console.log(ui.processCustomClass('bg', 'red-500'))
console.log(ui.processCustomClass('bg', '(0_255_0)', '', 'hover', '40'))

/* Output
{
  className: 'bg',
  cssRules: '--bg-opacity: 1; background-color: red',
  value: null,
  prefix: ''
}
{
  className: 'bg-red-500',
  cssRules: '--bg-opacity: 1; background-color: rgb(255 0 0 / var(--bg-opacity))',
  value: null,
  prefix: ''
}
{
  className: 'bg-\\(0_255_0\\)\\/40',
  cssRules: '--bg-opacity: 40%; background-color: rgb(0 255 0 / var(--bg-opacity))',
  value: null,
  prefix: 'hover'
}
*/

process

A main method for parsing and processing class names automatically.

process(classNames: string | string[]): ProcessedStyle[] {}

Example :

const ui = new TenoxUI({
  property: {
    m: 'margin',
    p: 'padding',
    bg: 'backgroundColor',
    size: ['width', 'height']
  },
  classes: {
    display: {
      flex: 'flex',
      iflex: 'inline-flex'
    }
  }
})

console.log(
  ui.process([
    // shorthands
    'm-0',
    'p-1rem',
    'bg-blue',
    'size-30px',
    // classes
    'flex',
    'iflex'
  ])
)

/* Output
[
  {
    className: 'm-0',
    cssRules: 'margin',
    value: '0',
    prefix: undefined
  },
  {
    className: 'p-1rem',
    cssRules: 'padding',
    value: '1rem',
    prefix: undefined
  },
  {
    className: 'bg-blue',
    cssRules: 'background-color',
    value: 'blue',
    prefix: undefined
  },
  {
    className: 'size-30px',
    cssRules: [ 'width', 'height' ],
    value: '30px',
    prefix: undefined
  },
  {
    className: 'flex',
    cssRules: 'display: flex',
    value: null,
    prefix: ''
  },
  {
    className: 'iflex',
    cssRules: 'display: inline-flex',
    value: null,
    prefix: ''
  }
]
*/

License

This project is licensed under MIT License. See here.