diff --git a/driver/js/packages/hippy-vue-css-loader/src/css-parser.ts b/driver/js/packages/hippy-vue-css-loader/src/css-parser.ts index e7d4c2def4e..23788794df5 100644 --- a/driver/js/packages/hippy-vue-css-loader/src/css-parser.ts +++ b/driver/js/packages/hippy-vue-css-loader/src/css-parser.ts @@ -99,6 +99,10 @@ function convertPxUnitToPt(value: any) { if (Number.isInteger(value)) { return value; } + // If value unit is rpx, don't need to filter + if (typeof value === 'string' && value.endsWith('rpx')) { + return value; + } // If value unit is px, change to use pt as 1:1. if (typeof value === 'string' && value.endsWith('px')) { const num = parseFloat(value.slice(0, value.indexOf('px'))); diff --git a/driver/js/packages/hippy-vue-next-style-parser/src/style-parser/css-parser.ts b/driver/js/packages/hippy-vue-next-style-parser/src/style-parser/css-parser.ts index b0c7f1f9093..c33179bebe4 100644 --- a/driver/js/packages/hippy-vue-next-style-parser/src/style-parser/css-parser.ts +++ b/driver/js/packages/hippy-vue-next-style-parser/src/style-parser/css-parser.ts @@ -191,6 +191,10 @@ function convertPxUnitToPt(value) { if (Number.isInteger(value)) { return value; } + // If value unit is rpx, don't need to filter + if (typeof value === 'string' && value.endsWith('rpx')) { + return value; + } // If value unit is px, change to use pt as 1:1. if (typeof value === 'string' && value.endsWith('px')) { const num = parseFloat(value.slice(0, value.indexOf('px')));