MCPcopy
hub / github.com/sveltejs/svelte / css_props

Function css_props

packages/svelte/src/internal/client/dom/blocks/css-props.js:10–28  ·  view source on GitHub ↗
(element, get_styles)

Source from the content-addressed store, hash-verified

8 * @returns {void}
9 */
10export function css_props(element, get_styles) {
11 if (hydrating) {
12 set_hydrate_node(get_first_child(element));
13 }
14
15 render_effect(() => {
16 var styles = get_styles();
17
18 for (var key in styles) {
19 var value = styles[key];
20
21 if (value) {
22 element.style.setProperty(key, value);
23 } else {
24 element.style.removeProperty(key);
25 }
26 }
27 });
28}

Callers

nothing calls this directly

Calls 3

set_hydrate_nodeFunction · 0.90
get_first_childFunction · 0.90
render_effectFunction · 0.90

Tested by

no test coverage detected