MSzturc / obsidian-advanced-slides

Create markdown-based reveal.js presentations in Obsidian
https://mszturc.github.io/obsidian-advanced-slides/
MIT License
987 stars 82 forks source link

Allow scrolling #230

Closed lucasrodwell closed 10 months ago

lucasrodwell commented 1 year ago

I often want to interactively add to presentations with my audience, which means that I cannot be sure not to overflow on a slide, and need to be able to scroll. Sometimes I have longer texts that I don't want to split up either, such as embeds, where it would be very helpful to be able to scroll.

I have tried solving this with css snippets, but this solution doesn't work, as with advanced slides there is a problem with long texts being clipped above the presentation grid when using overflow-y. I think this is the reason.

I have tried to adapt the css to no avail. If it is not possible for a css snippet solution, a toggle to allow scrolling would be of great help to me.

damywise commented 10 months ago

I added this at the end of scrollable.css:

.present > div,
.past > div,
.future > div
{
    display: block !important;
}

It works, at the very least.

damywise commented 10 months ago

Ah, also you might want to remove

    overflow: auto !important;

from scrollable.css, that makes it scrollable horizontally which shouldn't be

lucasrodwell commented 10 months ago

Is your scrollable.css from here?

damywise commented 10 months ago

Ah yes it is correct. Sorry about that, I forgot to mention it.

lucasrodwell commented 10 months ago

Unfortunately, I can't get it to work... To double-check, the whole snippet is the following ???

.reveal:not(.overview) .slides {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    pointer-events: auto !important;
}

.reveal:not(.overview) .slides::-webkit-scrollbar {
    display: none;
}

.reveal:not(.overview) .slides .past, .reveal:not(.overview) .slides .future {
    height: 0;
}

.present > div,
.past > div,
.future > div
{
    display: block !important;
}
damywise commented 10 months ago

Yes that should be correct. I tried yours and it works. Have you added the css property in the md?

lucasrodwell commented 10 months ago

Thanks, I needed the full path for it to work:

---
css:
  - .obsidian/snippets/scrollable.css
---