MCPcopy Create free account
hub / github.com/angular/components / extendStyles

Function extendStyles

src/cdk/drag-drop/dom/styling.ts:24–42  ·  view source on GitHub ↗
(
  dest: CSSStyleDeclaration,
  source: Record<string, string>,
  importantProperties?: Set<string>,
)

Source from the content-addressed store, hash-verified

22 * @docs-private
23 */
24export 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.

Callers 4

_createPreviewMethod · 0.90
toggleVisibilityFunction · 0.70

Calls

no outgoing calls

Tested by 1