Skip to content

Commit

Permalink
fix: 馃悰 text breaks on the last word (bubkoo#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
dima-hx authored and istaiti committed Feb 7, 2023
1 parent 8b44b2f commit d91550e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/cloneNode.ts
Expand Up @@ -82,11 +82,14 @@ function cloneCSSStyle<T extends HTMLElement>(nativeNode: T, clonedNode: T) {
target.cssText = source.cssText
} else {
toArray<string>(source).forEach((name) => {
target.setProperty(
name,
source.getPropertyValue(name),
source.getPropertyPriority(name),
)
let value = source.getPropertyValue(name)

if (name === 'font-size' && value.endsWith('px')) {
const reducedFont =
Math.floor(parseFloat(value.substring(0, value.length - 2))) - 0.1
value = `${reducedFont}px`
}
target.setProperty(name, value, source.getPropertyPriority(name))
})
}
}
Expand Down

0 comments on commit d91550e

Please sign in to comment.