Home / Function/ renderUniqueStylesheet() — astro Function Reference

renderUniqueStylesheet() — astro Function Reference

Architecture documentation for the renderUniqueStylesheet() function in tags.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  72ac4be8_4a6b_e24c_00d2_2d365299d5dd["renderUniqueStylesheet()"]
  20ee4011_0c81_9580_0d21_74d983d52182["tags.ts"]
  72ac4be8_4a6b_e24c_00d2_2d365299d5dd -->|defined in| 20ee4011_0c81_9580_0d21_74d983d52182
  style 72ac4be8_4a6b_e24c_00d2_2d365299d5dd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/server/render/tags.ts lines 12–22

export function renderUniqueStylesheet(result: SSRResult, sheet: StylesheetAsset) {
	if (sheet.type === 'external') {
		if (Array.from(result.styles).some((s) => s.props.href === sheet.src)) return '';
		return renderElement('link', { props: { rel: 'stylesheet', href: sheet.src }, children: '' });
	}

	if (sheet.type === 'inline') {
		if (Array.from(result.styles).some((s) => s.children.includes(sheet.content))) return '';
		return renderElement('style', { props: {}, children: sheet.content });
	}
}

Domain

Subdomains

Frequently Asked Questions

What does renderUniqueStylesheet() do?
renderUniqueStylesheet() is a function in the astro codebase, defined in packages/astro/src/runtime/server/render/tags.ts.
Where is renderUniqueStylesheet() defined?
renderUniqueStylesheet() is defined in packages/astro/src/runtime/server/render/tags.ts at line 12.

Analyze Your Own Codebase

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

Try Supermodel Free