Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarto website treats h1 as quarto-title-block if no title in frontmatter #11686

Closed
simonsteiger opened this issue Dec 15, 2024 · 2 comments
Closed
Labels
duplicate This issue or pull request already exists

Comments

@simonsteiger
Copy link

simonsteiger commented Dec 15, 2024

Bug description

Hello,

After updating to 1.6.39, quarto websites began treating a raw html h1 as the page title, which appears to drop any other CSS attached to said h1.

Maybe this behaviour is intended; it came as a surprise for me at least.

Steps to reproduce

Here's the example that caused the error.

Setting title to "" (or removing it from the frontmatter entirely) causes "upper-content" class to be overridden by quarto's title block.

---
title: "test" # works
# title: ""   # doesn't work
---

```{=html}
<div class="upper-content">
    <h1>Turing.jl</h1>
</div>
```

And the corresponding styles.css:

.upper-content {
    color: red;
}

Expected behavior

The words "Turing.jl" should show up in red.

Actual behavior

The words "Turing.jl" show up in black (CSS class "upper-content" was not applied).

Your environment

  • I ran quarto preview on the terminal
  • MacOS Sequoia 15.1.1

Quarto check output

Quarto 1.6.39
[✓] Checking environment information...
      Quarto cache location: /Users/simonsteiger/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.4.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.46.3: OK
      Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.6.39
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: 869685

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/simonsteiger/Library/TinyTeX/bin/universal-darwin
      Version: 2023

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

[✓] Checking Python 3 installation....OK
      Version: 3.11.6
      Path: /opt/homebrew/opt/[email protected]/bin/python3.11
      Jupyter: 5.5.0
      Kernels: julia-1.11, julia-1.10, julia-1.8, julia-1.9

      NOTE: No Jupyter kernel for Python found

[✓] Checking R installation...........OK
      Version: 4.3.2
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
      knitr: 1.43
      rmarkdown: 2.23

[✓] Checking Knitr engine render......OK
@simonsteiger simonsteiger added the bug Something isn't working label Dec 15, 2024
@simonsteiger simonsteiger changed the title Quarto website ignores CSS if no page title present Quarto website treats h1 as quarto-title-block if no title in frontmatter Dec 15, 2024
@mcanouil
Copy link
Collaborator

mcanouil commented Dec 15, 2024

What is your goal when doing raw h1 and no title? (Why not set and target the title?)

Anyhow, this is a duplicate:

(In the future, please search for related issues before opening a new one)

@mcanouil mcanouil added duplicate This issue or pull request already exists and removed bug Something isn't working labels Dec 15, 2024
@simonsteiger
Copy link
Author

We used <h1> in addition to a custom CSS class to create an animated banner for the landing page (see https://turinglang.org/pr-previews/105/). We did not want to style other titles in the same way, so we did not target the title.

Sorry for not searching better previously!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants