public function findThemedResource($resource, $themes = null)
    {
        if ($themes === null) {
            $themes = SSViewer::get_themes();
        }

        $paths = $this->getThemePaths($themes);

        foreach ($paths as $themePath) {
            $relativePath = Path::join($themePath, $resource);
            $absolutePath = Path::join($this->base, $relativePath);
            if (file_exists($absolutePath)) {
                return $relativePath;
            }
        }

        // Resource exists in no context
        return null;
    }