fix(core): improved handling for unsupported '!important' css rule (#10243)

This commit is contained in:
Dimitris-Rafail Katsampas
2023-03-22 17:13:35 +02:00
committed by GitHub
parent ea45758463
commit e560cb1374
4 changed files with 17 additions and 11 deletions

View File

@ -0,0 +1,12 @@
import { Trace } from '../../trace';
export function cleanupImportantFlags(value: string, propertyName: string) {
const index = value?.indexOf('!important');
if (index >= 0) {
if (Trace.isEnabled()) {
Trace.write(`The !important css rule is currently not supported. Property: ${propertyName}`, Trace.categories.Style, Trace.messageType.warn);
}
return value.substring(0, index).trim();
}
return value;
}