mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 02:54:11 +08:00
fix(core): improved handling for unsupported '!important' css rule (#10243)
This commit is contained in:

committed by
GitHub

parent
ea45758463
commit
e560cb1374
12
packages/core/ui/styling/css-utils.ts
Normal file
12
packages/core/ui/styling/css-utils.ts
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user