JSPM

  • Created
  • Published
  • Downloads 1181
  • Score
    100M100P100Q97384F
  • License MIT

The atomic on-demand CSS-in-JS.

Package Exports

  • @plumeria/core
  • @plumeria/core/package.json
  • @plumeria/core/processors
  • @plumeria/core/stylesheet.css

Readme

@plumeria/core

The atomic on-demand CSS-in-JS.

import { css } from '@plumeria/core';

const styles = css.create({
  text: {
    fontSize: 12,
    color: 'navy',
  },
  size: {
    width: 120,
  },
});

const className = css.props(styles.text, styles.size);

Plumeria compiles each style property into a unique, atomic, and hashed class name. This prevents style collisions and maximizes reusability.

Generated CSS:

.x1p2jzyu:not(#\#) {
  font-size: 12px;
}
.xzie71ek {
  color: navy;
}
.xgpw2mmc {
  width: 120px;
}

Resulting:

className: "x1p2jzyu xzie71ek xgpw2mmc"

Documentation

Read the documentation for more details.

Installation

Acknowledgement

Plumeria is made possible thanks to the inspirations from the following projects:

License

MIT License © 2023-PRESENT Refirst 11