### Bug description

Including a subpage of a website that renders to `revealjs` causes `quarto` to fail to discover some scss variables resulting in a scss compilation error.

### Steps to reproduce

1. Clone reproducible example in [this repo](https://github.com/dgkf/quarto-revealjs-theme-reprex)
   - This repo contains an extension that provides a custom `html` and `revealjs` format
   - The project intends to build a website with a navbar item that links to a presentation (using the `revealjs` format)
   - Both leverage a `_variables.scss` file `@include`ed in a theme to define a `$primary` variable
3. `quarto preview`
4. Observe build failure

### Expected behavior

The website renders and the presentation navbar item takes you to a page where you can view the presentation in the browser.

### Actual behavior

`quarto` fails to render the website

### Your environment

- `quarto-cli`
   - 553fec5f3c421a8c0e9a533ef47d76c6f002e437 (from June 1)
   - 1.3.361 installed via homebrew
- on MacOS

### Quarto check output

```
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.361
      Path: /Applications/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.11.3
      Path: /opt/homebrew/opt/python@3.11/bin/python3.11
      Jupyter: 5.3.0
      Kernels: julia-1.8

      NOTE: No Jupyter kernel for Python found

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
```
2023-06-01T20:47:41Z
dgkf
bug
v1.4
closed
Previewing hits scss error when using revealjs format within a webpage
https://github.com/quarto-dev/quarto-cli/issues/5786