Home / Function/ updateStyle() — astro Function Reference

updateStyle() — astro Function Reference

Architecture documentation for the updateStyle() function in card.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  4ef8718e_c8d4_405d_588e_d180e0a1916b["updateStyle()"]
  37f75f3c_f7fc_630d_6b0d_4943b32b71bd["DevToolbarCard"]
  4ef8718e_c8d4_405d_588e_d180e0a1916b -->|defined in| 37f75f3c_f7fc_630d_6b0d_4943b32b71bd
  d9424fb6_44c6_d9af_a768_ffea3baf21d8["cardStyle()"]
  d9424fb6_44c6_d9af_a768_ffea3baf21d8 -->|calls| 4ef8718e_c8d4_405d_588e_d180e0a1916b
  ea9a6b6e_7887_5160_cb08_58d74f806583["attributeChangedCallback()"]
  ea9a6b6e_7887_5160_cb08_58d74f806583 -->|calls| 4ef8718e_c8d4_405d_588e_d180e0a1916b
  22c5c240_9892_2b43_4ee1_718cd9e4bfb7["connectedCallback()"]
  22c5c240_9892_2b43_4ee1_718cd9e4bfb7 -->|calls| 4ef8718e_c8d4_405d_588e_d180e0a1916b
  style 4ef8718e_c8d4_405d_588e_d180e0a1916b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/client/dev-toolbar/ui-library/card.ts lines 45–56

	updateStyle() {
		const style = this.shadowRoot.querySelector<HTMLStyleElement>('#selected-style');

		if (style) {
			style.innerHTML = `
				:host {
					--hover-background: var(--${this.cardStyle}-hover-background);
					--hover-border: var(--${this.cardStyle}-hover-border);
				}
			`;
		}
	}

Domain

Subdomains

Frequently Asked Questions

What does updateStyle() do?
updateStyle() is a function in the astro codebase, defined in packages/astro/src/runtime/client/dev-toolbar/ui-library/card.ts.
Where is updateStyle() defined?
updateStyle() is defined in packages/astro/src/runtime/client/dev-toolbar/ui-library/card.ts at line 45.
What calls updateStyle()?
updateStyle() is called by 3 function(s): attributeChangedCallback, cardStyle, connectedCallback.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free