mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 10:25:06 +03:00
* Run prettier on packages too. * Add the generated files for icons to prettierignore. * Format all files in the packages folder. * Minor fix.
16 lines
679 B
JavaScript
16 lines
679 B
JavaScript
const notDefault = (value, defaultValue) => (value !== defaultValue ? value : '')
|
|
|
|
const fontFamily = ({ fontFamily }, { fontFamilies } = {}) =>
|
|
fontFamilies && fontFamilies[fontFamily] ? fontFamilies[fontFamily] : fontFamily
|
|
|
|
module.exports = {
|
|
type: 'value',
|
|
matcher: function (token) {
|
|
return token.type === 'custom-fontStyle'
|
|
},
|
|
transformer: function ({ value: font }, { options }) {
|
|
// font: font-style font-variant font-weight font-size/line-height font-family;
|
|
return `${notDefault(font.fontStretch, 'normal')} ${notDefault(font.fontStyle, 'normal')} ${font.fontWeight} ${font.fontSize}/${font.lineHeight} ${fontFamily(font, options)}`.trim()
|
|
},
|
|
}
|