We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ebd308f commit 3defa9dCopy full SHA for 3defa9d
.changeset/fluffy-poets-happen.md
@@ -0,0 +1,5 @@
1
+---
2
+'preact-render-to-string': patch
3
4
+
5
+Follow up fixes to #278
src/util.js
@@ -66,14 +66,15 @@ export function styleObjToCss(s) {
66
(JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$1').toLowerCase());
67
68
let suffix = ';';
69
- if (SUFFIX_CACHE[name]) {
70
- suffix = 'px';
+ let isNumber = typeof val === 'number';
+ if (isNumber && SUFFIX_CACHE[name]) {
71
+ suffix = 'px;';
72
} else if (
- typeof val === 'number' &&
73
+ isNumber &&
74
IS_NON_DIMENSIONAL.test(prop.toLowerCase()) === false
75
) {
76
SUFFIX_CACHE[name] = true;
77
78
}
79
str = str + name + ':' + val + suffix;
80
0 commit comments