Home / Function/ is_outer_global() — svelte Function Reference

is_outer_global() — svelte Function Reference

Architecture documentation for the is_outer_global() function in utils.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  35596639_b906_6d9c_da50_4cb4a3a4a0b3["is_outer_global()"]
  ad593fd6_3727_04c3_f22e_c845647cea4d["utils.js"]
  35596639_b906_6d9c_da50_4cb4a3a4a0b3 -->|defined in| ad593fd6_3727_04c3_f22e_c845647cea4d
  c89a58ea_32ad_64b6_f48c_d266ac47f008["apply_selector()"]
  c89a58ea_32ad_64b6_f48c_d266ac47f008 -->|calls| 35596639_b906_6d9c_da50_4cb4a3a4a0b3
  style 35596639_b906_6d9c_da50_4cb4a3a4a0b3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/2-analyze/css/utils.js lines 163–177

export function is_outer_global(relative_selector) {
	const first = relative_selector.selectors[0];

	return (
		first.type === 'PseudoClassSelector' &&
		first.name === 'global' &&
		(first.args === null ||
			// Only these two selector types can keep the whole selector global, because e.g.
			// :global(button).x means that the selector is still scoped because of the .x
			relative_selector.selectors.every(
				(selector) =>
					selector.type === 'PseudoClassSelector' || selector.type === 'PseudoElementSelector'
			))
	);
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does is_outer_global() do?
is_outer_global() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/2-analyze/css/utils.js.
Where is is_outer_global() defined?
is_outer_global() is defined in packages/svelte/src/compiler/phases/2-analyze/css/utils.js at line 163.
What calls is_outer_global()?
is_outer_global() is called by 1 function(s): apply_selector.

Analyze Your Own Codebase

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

Try Supermodel Free