Closed nawok closed 4 years ago
Thanks for the PR. I'm actually working on a transformer
pipeline, so it'll be easy to extend the process by simply creating an exported function. See #5.
You can either update your PR when it lands, or I'll add these as transformer functions.
btw: here's how the useInter
transformer would look like
const defaultFontFamily =
'system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'
const interFont =
'<link rel="stylesheet" href="https://rsms.me/inter/inter.css">'
const fontFamilySans = `
<style type="text/css">
html, .font-sans{font-family:"Inter var",${defaultFontFamily}}
.sm\\:font-sans{font-family:"Inter var",${defaultFontFamily}}
.md\\:font-sans{font-family:"Inter var",${defaultFontFamily}}
.lg\\:font-sans{font-family:"Inter var",${defaultFontFamily}}
.xl\\:font-sans{font-family:"Inter var",${defaultFontFamily}}
</style>
`
module.exports = function($) {
$('head')
.append(interFont)
.append(fontFamilySans)
}
Sure, I’ll update it.
I've pushed v2.0 with transformer support and includes the prefixSrc
and useInter
transformers.
I added a
USE_INTER=1
option to add Inter font to the sans font family to achieve the look identical to examples on tailwindui.com. This pull request also contains a fix that replaces relative URLs with absolute.