const plugin = require(‘tailwindcss/plugin’);
console.error(‘BASE TYPE’);
const DEFAULT_SETTINGS = {}; const DEFAULT_VALUES = {}; const DEFAULT_VARIANTS = [‘serif’, ‘sans’];
const round = (num) =>
num
.toFixed(2)
.replace(/(.[0-9]+?)0+$/, ‘$1’)
.replace(/.0$/, ‘’);
const rem = (px) => ${round(px / 16)}rem;
const em = (px, base) => ${round(px / base)}em;
module.exports = plugin( function ({addBase, theme, variants, e}) { console.error(“CORE FONT”); addBase({ ‘h1’: { fontFamily: theme(‘fontFamily.serif’), fontSize: theme(‘fontSize.4xl’), fontWeight: ‘500’, lineHeight: round(36 / 30), }, ‘* + h1’: { marginTop: em(24, 30), }, ‘h1 + *’: {
},
'h2': {
fontFamily: theme('fontFamily.serif'),
fontSize: theme('fontSize.2xl'),
fontWeight: '500',
lineHeight: round(28 / 20),
marginBottom: em(16, 20),
},
'* + h2': {
marginTop: em(32, 20),
}
'h3': {
fontFamily: theme('fontFamily.serif'),
fontSize: theme('fontSize.xl'),
fontWeight: '400',
fontStyle: 'italic',
lineHeight: round(28 / 18),
marginTop: em(28, 18),
marginBottom: em(8, 18),
},
'h4': {
lineHeight: round(20 / 14),
marginTop: em(20, 14),
marginBottom: em(8, 14),
},
'h2 + *': {
marginTop: '0',
},
'h3 + *': {
marginTop: '0',
},
'h4 + *': {
marginTop: '0',
},
'main a': {
textDecoration: 'underline',
}
});
}, { } );