@maizzle/framework
Version:
Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.
21 lines (17 loc) • 510 B
JavaScript
import posthtml from 'posthtml'
import posthtmlMergeLonghand from 'posthtml-postcss-merge-longhand'
export default function posthtmlPlugin(options = {}) {
if (Array.isArray(options.tags)) {
return posthtmlMergeLonghand({
tags: options.tags,
})
}
return posthtmlMergeLonghand()
}
export async function shorthandCSS(html = '', options = {}, posthtmlOptions = {}) {
return posthtml([
posthtmlPlugin(options)
])
.process(html, posthtmlOptions)
.then(result => result.html)
}