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

Easily use custom fragment for incremental list #11030

Open
cderv opened this issue Oct 11, 2024 · 0 comments
Open

Easily use custom fragment for incremental list #11030

cderv opened this issue Oct 11, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request revealjs Issues with the revealjs format

Comments

@cderv
Copy link
Collaborator

cderv commented Oct 11, 2024

I'm not sure if this is a good idea, but what about adding a variable in the metadata, such as custom-fragments=True, so that all <li class="fragment"> fragments generated by bullet lists become class="fragment custom"?

Currently, I'm using the following JavaScript code when compiling the document:

document.addEventListener("DOMContentLoaded", function () {
  document.querySelectorAll('.fragment').forEach(function (element) {
    element.classList.add('custom');
    
    // Avoid turning elements inside `agenda` https://github.com/andrie/reveal-auto-agenda into `.fragment .custom`.
    if (element.closest('.agenda')) {
      element.className = "agenda list";
    }
  });
});

Originally posted by @ChoCho66 in #9643 (reply in thread)

@cderv cderv added enhancement New feature or request revealjs Issues with the revealjs format labels Oct 11, 2024
@cderv cderv self-assigned this Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request revealjs Issues with the revealjs format
Projects
None yet
Development

No branches or pull requests

1 participant