const actualValue = element.style[styleProp]
const calculatedValue = window.getComputedStyle(element)[styleProp]
Manipulator.setDataAttribute(element, styleProp, actualValue)
- element.style[styleProp] = callback(Number.parseFloat(calculatedValue)) + 'px'
+ element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`
})
}
// Just in case some CMS puts out a full URL with the anchor appended
if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
- hrefAttr = '#' + hrefAttr.split('#')[1]
+ hrefAttr = `#${hrefAttr.split('#')[1]}`
}
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null
if (!new RegExp(expectedTypes).test(valueType)) {
throw new TypeError(
- `${componentName.toUpperCase()}: ` +
- `Option "${property}" provided type "${valueType}" ` +
- `but expected type "${expectedTypes}".`
+ `${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`
)
}
})
const actualValue = element.style[styleProp]
const calculatedValue = window.getComputedStyle(element)[styleProp]
Manipulator.setDataAttribute(element, styleProp, actualValue)
- element.style[styleProp] = callback(Number.parseFloat(calculatedValue)) + 'px'
+ element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`
})
}