Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 99eabfb

Browse files
cyrilletuziThomasBurleson
authored andcommitted
fix(css): add prefixed styles before standard ones
Fixes #467. Closes #468.
1 parent 99e7450 commit 99eabfb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/utils/style-utils.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ export function applyStyleToElements(renderer: Renderer2,
5050
/**
5151
* Applies the styles to the element. The styles object map may contain an array of values.
5252
* Each value will be added as element style.
53+
* Keys are sorted to add prefixed styles (like -webkit-x) first, before the standard ones.
5354
*/
5455
export function applyMultiValueStyleToElement(styles: {}, element: any, renderer: Renderer2) {
55-
Object.keys(styles).forEach(key => {
56+
Object.keys(styles).sort().forEach(key => {
5657
const values = Array.isArray(styles[key]) ? styles[key] : [styles[key]];
5758
for (let value of values) {
5859
renderer.setStyle(element, key, value);

0 commit comments

Comments
 (0)