Skip to content

Commit

Permalink
fix(css): add prefixed styles before standard ones
Browse files Browse the repository at this point in the history
Fixes #467. Closes #468.
  • Loading branch information
cyrilletuzi authored and ThomasBurleson committed Oct 26, 2017
1 parent 99e7450 commit 99eabfb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/utils/style-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ export function applyStyleToElements(renderer: Renderer2,
/**
* Applies the styles to the element. The styles object map may contain an array of values.
* Each value will be added as element style.
* Keys are sorted to add prefixed styles (like -webkit-x) first, before the standard ones.
*/
export function applyMultiValueStyleToElement(styles: {}, element: any, renderer: Renderer2) {
Object.keys(styles).forEach(key => {
Object.keys(styles).sort().forEach(key => {
const values = Array.isArray(styles[key]) ? styles[key] : [styles[key]];
for (let value of values) {
renderer.setStyle(element, key, value);
Expand Down

0 comments on commit 99eabfb

Please sign in to comment.