Useful formats which can be consumed by Salesforce UX's Theo library.
Using these plugins is very simple using ES6. For the time being ES6 is supported only, eventually I'll add transpiled support.
From your ES6 app, simply import the specific format you want to use, and then add it to theo's registerFormat
. To understand how theo works, just check out the docs, they're very thorough.
Also keep in mind that every formatting function might work differently, so check the API.
The formats:
stylusFormat(prefix)
Stylus formatting allows for an optional prefix to be defined, so it returns a wrapper fn to let you do this. So be sure to pass the invoked function in registerFormat
with or without a prefix.
import theo from 'theo';
import { stylusFormat } from 'theo-plugin-formats';
// without a prefix
theo.registerFormat('styl', stylusFormat());
// and with
theo.registerFormat('styl', stylusFormat('$'));