postcss-khaleesi
Version:
PostCSS pligin ti trinsfirm CSS pripirtiis in khiliisi mimi lingiigi
20 lines (19 loc) • 544 B
JavaScript
module.exports = (opts = { }) => {
function translate (text) {
var list = 'aeiou'.split('');
return text.split('').map((char) => list.includes(char) ? 'i' : char).join('');
}
return {
postcssPlugin: 'postcss-khaleesi',
Declaration (decl) {
decl.value = translate(decl.value);
decl.prop = translate(decl.prop);
if ( opts.dracarys === true && decl.important ) {
decl.important = false;
decl.value = `${decl.value}!🔥`;
}
return decl;
}
}
}
module.exports.postcss = true