Skip to content

Commit cb9b515

Browse files
committed
Refactor string parsing
Fixes jlmakes#531
1 parent eb24048 commit cb9b515

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
## Unreleased
44

5-
### [4.0.8] - 2021-03-02
5+
### Fixed
6+
7+
- Styles applied using CSSOM don't drop `:` characters.
8+
9+
## [4.0.8] - 2021-03-02
10+
11+
### Fixed
612

713
- Avoid Content Security Policy (CSP) violations. [@lambdacasserole](https://github.com/lambdacasserole) [#431](https://github.com/jlmakes/scrollreveal/pull/431)
814

src/instance/functions/style.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ export default function style(element) {
225225
*/
226226
export function applyStyle (el, declaration) {
227227
declaration.split(';').forEach(pair => {
228-
const [property, value] = pair.split(':').map(s => s.trim())
228+
const [property, ...value] = pair.split(':')
229229
if (property && value) {
230-
el.style[property] = value
230+
el.style[property.trim()] = value.join(':')
231231
}
232232
})
233233
}

0 commit comments

Comments
 (0)