Files
supabase/packages/ui/internals/transform/web/webFont.js
T
Jonathan Summers-MuirandFrancesco Sansalvadore 171714965e Feat/design tokens upgrade (#18051)
* new packages

* new transforms

* Update package.json

* new internal files

* Update cleanse-css-for-tailwind.js

* updated css files

* remove old code

* update tokens

* Delete global.css

* update themes

* Update tailwind-theming.md

* Update tailwind-theming.md

* Update tailwind-theming.md

* Update tailwind-theming.md

* Update tailwind-theming.md

* Update tailwind-theming.md

---------

Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com>
2023-10-23 03:28:22 +00:00

15 lines
676 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()
}
}