bonsai-analyzer
Version:
Trim your dependency tree.
30 lines (26 loc) • 432 B
JavaScript
/*
* @flow
*/
export type Color =
| 'default'
| 'light'
| 'dark'
| 'primary'
| 'secondary'
| 'success'
| 'info'
| 'warning'
| 'danger'
| 'link'
| 'outline-secondary';
export type Prefixes = 'btn';
export function colorToClass(
prefix: Prefixes,
color: ?Color,
fallback: Color = 'light',
) {
if (color === 'default') {
return `${prefix}-light`;
}
return `${prefix}-${color || fallback}`;
}