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 🙏

© 2024 – Pkg Stats / Ryan Hefner

lw-css-prefixer

v0.0.1-alpha.2

Published

[![npm version](https://img.shields.io/npm/v/lw-css-prefixer.svg)](https://www.npmjs.com/package/lw-css-prefixer) [![minzipped size](https://img.shields.io/bundlephobia/minzip/lw-css-prefixer)](https://bundlephobia.com/package/lw-css-prefixer) [![build st

Downloads

6

Readme

lw-css-prefixer

npm version minzipped size build status npm downloads

NOTE: This project is under active development and is not considered stable for production use. Exposed APIs are liable to change in major ways before a 1.0.0 release. Expect issues if you use this in production.

A lightweight auto-prefixer for CSS properties and values. Intended for runtime use, e.g. in CSS-in-JS libraries where inclusion of a fully-fledged solution like Autoprefixer is too big an impact on your overall bundle size.

npm i lw-css-prefixer

Code Samples

Converting a property/value pair to a CSS string

import { prefixer } from 'lw-css-prefixer';

/*
 * To ensure the impact on your bundle size is as small as possible
 * plugins and propertyPrefixes must be loaded separately.
 *
 * If you're particularly conscious of your own bundle size it may
 * be sensible to define your own property prefix and plugins list in
 * line with your own needs, only supporting the minimum required set
 * of features.
 */
import { plugins } from 'lw-css-prefixer/dist/plugins';
import { propertyPrefixes } from 'lw-css-prefixer/dist/propertyPrefixes';

const pfx = prefixer(plugins, propertyPrefixes);

// [['-webkit-align-content', 'inherit'], ['align-content', 'inherit']]
const styles = pfx('align-content', 'inherit');

// '-webkit-align-content:inherit;align-content:inherit;'
const style = styles.map(([prop, val]) => `${prop}:${val};`).join('');

With Goober

import { setup } from 'goober';
import { prefixer } from 'lw-css-prefixer';

/*
 * To ensure the impact on your bundle size is as small as possible
 * plugins and propertyPrefixes must be loaded separately.
 *
 * If you're particularly conscious of your own bundle size it may
 * be sensible to define your own property prefix and plugins list in
 * line with your own needs, only supporting the minimum required set
 * of features.
 */
import { plugins } from 'lw-css-prefixer/dist/plugins';
import { propertyPrefixes } from 'lw-css-prefixer/dist/propertyPrefixes';

setup(React.createElement, prefixer(plugins, propertyPrefixes));

Links

Intended Browser Support

  • IE10+
  • Edge 12+
  • Chrome 17+
  • Firefox 17+
  • Safari 7+

Big missing features

  • transition
  • grid
  • Short-hand properties (likely missing a ton of shorthand behaviors)

Contributing

While contributions are appreciated, they may be rejected if not in line with the intended project direction. It's recommended to check before undertaking a major piece of work and/or refactoring.

Contributions should be based off the develop branch, and any pull requests made into develop.

Useful Snippets

# Install dependencies
npm ci

# Run tests
npm run lint
npm run test

# Build the library
npm run build

Feedback and Support

For suggestions, issues, and/or support raise a GitHub issue!

Special Thanks