open-nomad/ui/app/helpers/css-class.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
393 B
JavaScript
Raw Normal View History

import { helper } from '@ember/component/helper';
import { dasherize } from '@ember/string';
2017-09-19 14:47:10 +00:00
/**
* CSS Class
*
* Usage: {{css-class updateType}}
*
* Outputs a css friendly class string from any human string.
* Differs from dasherize by handling slashes.
*/
export function cssClass([updateType]) {
return dasherize(updateType.replace(/\//g, '-'));
2017-09-19 14:47:10 +00:00
}
export default helper(cssClass);