Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function px (val, el) {
const container = el || document.body
if (!val || typeof val === 'number') {
return val
}
const [ num, unit ] = parseUnit(val)
if (unit === 'rem') {
return num * getFontSize()
} else if (unit === 'em') {
return num * getFontSize(container)
} else {
return num
}
}
function px (val, el) {
const container = el || document.body
if (!val || typeof val === 'number') {
return val
}
const [ num, unit ] = parseUnit(val)
if (unit === 'rem') {
return num * getFontSize()
} else if (unit === 'em') {
return num * getFontSize(container)
} else {
return num
}
}