(value: unknown, propertyName: string)
| 3 | import { Length } from './length-shared'; |
| 4 | |
| 5 | export function cleanupImportantFlags(value: unknown, propertyName: string) { |
| 6 | if (typeof value !== 'string') { |
| 7 | return '' + value; |
| 8 | } |
| 9 | |
| 10 | const index = value?.indexOf('!important'); |
| 11 | if (index >= 0) { |
| 12 | if (Trace.isEnabled()) { |
| 13 | Trace.write(`The !important css rule is currently not supported. Property: ${propertyName}`, Trace.categories.Style, Trace.messageType.warn); |
| 14 | } |
| 15 | return value.substring(0, index).trim(); |
| 16 | } |
| 17 | return value; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Matches whitespace except if the whitespace is contained in parenthesis - e.g. rgb(a), hsl color. |
no test coverage detected