fix: camelCase css from style elements

This commit is contained in:
Mikael Sand
2019-10-20 17:28:57 +03:00
parent 45e8e8dd0d
commit 9ee5a28b37
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import React, { useEffect, useMemo, useState } from 'react';
import { parse, SvgAst } from './xml';
import { camelCase, parse, SvgAst } from './xml';
import baseCssAdapter from 'css-select-base-adapter';
import csstree, { List } from 'css-tree';
import cssSelect from 'css-select';
@@ -563,7 +563,7 @@ CSSStyleDeclaration.prototype.setProperty = function(
};
let key = propertyName.trim();
properties.set(key, property);
this.parentNode.props.style[key] = trimmedValue;
this.parentNode.props.style[camelCase(key)] = trimmedValue;
return property;
};
+1 -1
View File
@@ -174,7 +174,7 @@ export class SvgFromUri extends Component<UriProps, UriState> {
const upperCase = (_match: string, letter: string) => letter.toUpperCase();
const camelCase = (phrase: string) =>
export const camelCase = (phrase: string) =>
phrase.replace(/[:\-]([a-z])/g, upperCase);
type Styles = { [property: string]: string };