All features

Cherry Blossom feature

Frontend Scss: Theme Importer

Resolves SCSS imports against child and parent theme source roots.

Resolves SCSS imports against child and parent theme source roots.

Capabilities and extension points

Resolves SCSS imports against child and parent theme source roots.

Each import is resolved independently. A matching child-theme file takes precedence, while imports without a child counterpart fall back to the parent theme.

SCSS source roots in resolution order.

  • var string[]

Sets up the importer.

  • param string[] $roots SCSS source roots in resolution order.

Resolves an import URL to its preferred theme file.

  • param UriInterface $url Import URL.
  • return UriInterface|null Canonical file URL, or null when unresolved.

Loads a canonical SCSS file URL.

  • param UriInterface $url Canonical file URL.
  • return ImporterResult|null Imported stylesheet, or null for non-files.

Returns a readable importer description.

  • return string Importer description.

Gets the theme-relative path represented by an import URL.

  • param UriInterface $url Import URL.
  • return string|null Theme-relative path, or null when unsupported.

Normalises a filesystem path for comparisons.

  • param string $path Filesystem path.
  • return string Normalised path.

Source reference

This editable reference page is based on the PHP documentation in frontend/scss/class-theme-importer.php.