Home / Function/ read_style() — svelte Function Reference

read_style() — svelte Function Reference

Architecture documentation for the read_style() function in style.js from the svelte codebase.

Function javascript Compiler Transformer calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  ed89faef_4ddb_7d55_bba6_cc8feba73758["read_style()"]
  251e2338_f8b8_69b4_b2e5_29ee7decbfa6["style.js"]
  ed89faef_4ddb_7d55_bba6_cc8feba73758 -->|defined in| 251e2338_f8b8_69b4_b2e5_29ee7decbfa6
  be9cd3f4_bdc5_dc26_dae4_4a34e45ab7eb["element()"]
  be9cd3f4_bdc5_dc26_dae4_4a34e45ab7eb -->|calls| ed89faef_4ddb_7d55_bba6_cc8feba73758
  94e530df_408d_ac7a_c243_1709ce77053c["read_body()"]
  ed89faef_4ddb_7d55_bba6_cc8feba73758 -->|calls| 94e530df_408d_ac7a_c243_1709ce77053c
  style ed89faef_4ddb_7d55_bba6_cc8feba73758 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/1-parse/read/style.js lines 25–46

export default function read_style(parser, start, attributes) {
	const content_start = parser.index;
	const children = read_body(parser, (p) => p.match('</style') || p.index >= p.template.length);
	const content_end = parser.index;

	parser.eat('</style', true);
	parser.read(/^\s*>/);

	return {
		type: 'StyleSheet',
		start,
		end: parser.index,
		attributes,
		children,
		content: {
			start: content_start,
			end: content_end,
			styles: parser.template.slice(content_start, content_end),
			comment: null
		}
	};
}

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does read_style() do?
read_style() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/1-parse/read/style.js.
Where is read_style() defined?
read_style() is defined in packages/svelte/src/compiler/phases/1-parse/read/style.js at line 25.
What does read_style() call?
read_style() calls 1 function(s): read_body.
What calls read_style()?
read_style() is called by 1 function(s): element.

Analyze Your Own Codebase

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

Try Supermodel Free