Skip to content

Commit

Permalink
fix: eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
pagnkelly committed Sep 11, 2023
1 parent e57f063 commit beae6fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/unocss-base/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { presetUno } = require('@unocss/preset-uno')

// eslint-disable-next-line
const remRE = /(-?[\.\d]+)rem/g

module.exports = function presetMpx (options = { preflight: false, baseFontSize: 37.5 }) {
Expand All @@ -11,8 +12,9 @@ module.exports = function presetMpx (options = { preflight: false, baseFontSize:
postprocess: (util) => {
util.entries.forEach((i) => {
const value = i[1]
if (typeof value === 'string' && remRE.test(value))
if (typeof value === 'string' && remRE.test(value)) {
i[1] = value.replace(remRE, (_, p1) => `${p1 * baseFontSize}rpx`)
}
})
}
}
Expand Down

0 comments on commit beae6fd

Please sign in to comment.