( dest: CSSStyleDeclaration, source: Record<string, string>, importantProperties?: Set<string>, )
| 22 | * @docs-private |
| 23 | */ |
| 24 | export function extendStyles( |
| 25 | dest: CSSStyleDeclaration, |
| 26 | source: Record<string, string>, |
| 27 | importantProperties?: Set<string>, |
| 28 | ) { |
| 29 | for (let key in source) { |
| 30 | if (source.hasOwnProperty(key)) { |
| 31 | const value = source[key]; |
| 32 | |
| 33 | if (value) { |
| 34 | dest.setProperty(key, value, importantProperties?.has(key) ? 'important' : ''); |
| 35 | } else { |
| 36 | dest.removeProperty(key); |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | return dest; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Toggles whether the native drag interactions should be enabled for an element. |
no outgoing calls