Does Quarto/Pandoc support RevealJS "slide attributes"? #5549
-
I'm trying to get a Quarto (1.3.340) presentation to set blur + dimming on the background image of non-title slides to make text more readable. I aimed to do this with RevealJS' slide attributes mechanism, similar to the method described here. When I add a slide attributes HTML comment beneath the front matter of my markdown doc, instead of adding attributes to each slide
Is there any way currently with Quarto (or Pandoc) to add attributes to all slide |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Getting the same result when using pandoc directly:
... and none of my slides receive that attribute. I think this is an issue of pandoc not supporting the feature. Is there a place I can look for a list of revealjs features pandoc does not support? Does anyone have any other ideas for how to accomplish this? |
Beta Was this translation helpful? Give feedback.
-
Just to be sure: using the syntax
You can use a Lua filter to apply some attributes to all headers at once. That would be the easiest IMO.
For revealjs output, we leverage Pandoc's support for revealjs, and I don't think it supports the markdown syntax. Pandoc will convert markdown to HTML for revealjs directly and attributes are passed as HTML attributes (example with data-background) |
Beta Was this translation helpful? Give feedback.
-
Correct. If I apply this to every slide, I get the outcome I'm expecting, but I prefer not to apply that to every slide!
I'm hoping that by setting a
Will look in to this, thanks!
Do you think it's worth my time to open an issue with Pandoc? Or do you think supporting this feature would be out-of-scope? |
Beta Was this translation helpful? Give feedback.
-
Following up with how I solved this problem after maybe too much fidgeting with CSS (Firefox doesn't fully support this method; see comment): /*
blur, desaturate, and dim backgrounds of non-title slides to make text easier
to read.
NOTE: Firefox does not support the `:has()` selector (for the last 16 years:
https://bugzilla.mozilla.org/show_bug.cgi?id=418039), so in Firefox all slides
will appear "dim".
*/
html .backgrounds {
-webkit-filter: blur(4px) saturate(.7) brightness(.8);
-moz-filter: blur(4px) saturate(.7) brightness(.8);
-o-filter: blur(4px) saturate(.7) brightness(.8);
-ms-filter: blur(4px) saturate(.7) brightness(.8);
filter: blur(4px) saturate(.7) brightness(.8);
}
.slides:has(> #title-slide:not([hidden])) ~ .backgrounds {
-webkit-filter: blur(0px) saturate(1) brightness(1);
-moz-filter: blur(0px) saturate(1) brightness(1);
-o-filter: blur(0px) saturate(1) brightness(1);
-ms-filter: blur(0px) saturate(1) brightness(1);
filter: blur(0px) saturate(1) brightness(1);
} |
Beta Was this translation helpful? Give feedback.
Just to be sure: using the syntax
# heading {data-state="blur}
works, right ? What is the attributes you want to set exactly ?You can use a Lua filter to apply some attributes to all headers at once. That would be the easiest IMO.
For revealjs output, we leverage Pandoc's support for revealjs, and I don't think it supports the markdown syntax. Pandoc will convert markdown to HTML for revealjs directly and attributes are passed as HTML attributes (example with data-background)