diff --git a/src/components/Canvas/Sections/FontSizes.vue b/src/components/Canvas/Sections/FontSizes.vue index 43d85e3..1a6e50c 100644 --- a/src/components/Canvas/Sections/FontSizes.vue +++ b/src/components/Canvas/Sections/FontSizes.vue @@ -6,15 +6,13 @@ >

{{ data.typographyExample }}

@@ -57,10 +55,18 @@ export default { getFontSizeValue (value) { // Tailwind 2.0 returns font size as array with size and line height if (Array.isArray(value)) { - return value[0] + return { + fontSize: value[0], + ...value[1] + } } - return value + return { + fontSize: value + } + }, + getFontSizeString (value) { + return Object.values(this.getFontSizeValue(value)).join(', ') } } } diff --git a/src/utils/index.js b/src/utils/index.js index 5a8f3db..bd2048b 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -12,5 +12,7 @@ export const remToPx = (rem, config) => { export const appendPxToRems = (rem, config) => { if (rem.search('rem') === -1) return rem - return `${rem} (${remToPx(rem, config)}px)` + return rem.replaceAll(/(\d|\.)*rem/g, (value) => { + return `${value} (${remToPx(value, config)}px)` + }) }