fix(style): CSS variables should be case-sensitive. (#9603)

This commit is contained in:
Dimitris - Rafail Katsampas
2021-10-08 21:04:04 +03:00
committed by GitHub
parent 846a87c666
commit 02aa0f652a

View File

@@ -1,4 +1,5 @@
import '../../../globals';
import { isCssVariable } from '../../core/properties';
import { isNullOrUndefined } from '../../../utils/types';
import * as cssParser from '../../../css';
@@ -523,7 +524,7 @@ export function fromAstNodes(astRules: cssParser.Node[]): RuleSet[] {
}
function createDeclaration(decl: cssParser.Declaration): any {
return { property: decl.property.toLowerCase(), value: decl.value };
return { property: isCssVariable(decl.property) ? decl.property : decl.property.toLowerCase(), value: decl.value };
}
function createSimpleSelectorFromAst(ast: parser.SimpleSelector): SimpleSelector {