diff --git a/CHANGELOG.md b/CHANGELOG.md index d0443e6..9152572 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,13 @@ ## Unreleased -### [4.0.8] - 2021-03-02 +### Fixed + +- Styles applied using CSSOM don't drop `:` characters. + +## [4.0.8] - 2021-03-02 + +### Fixed - Avoid Content Security Policy (CSP) violations. [@lambdacasserole](https://github.com/lambdacasserole) [#431](https://github.com/jlmakes/scrollreveal/pull/431) diff --git a/src/instance/functions/style.js b/src/instance/functions/style.js index 1235f06..0c48149 100644 --- a/src/instance/functions/style.js +++ b/src/instance/functions/style.js @@ -225,9 +225,9 @@ export default function style(element) { */ export function applyStyle (el, declaration) { declaration.split(';').forEach(pair => { - const [property, value] = pair.split(':').map(s => s.trim()) + const [property, ...value] = pair.split(':') if (property && value) { - el.style[property] = value + el.style[property.trim()] = value.join(':') } }) }