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

Excluding “:not()” pseudo classes from toc list item #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ochenk
Copy link

@ochenk ochenk commented Aug 29, 2019

All selector classes are inserted as classes on the generated list item. For example, if the toc container looks like this:

<div class="toc" data-toc="h2, first-class, second class" data-toc-container=".main">

then the resulting list item will look like this:

<li class="toc-li-0 toc-h2 first-class second-class" data-scroll-init="true"><a href="#toc-1" data-smooth-active="true">Title for first list item</a></li>

This seems reasonable since there's a possibility that you might want to style list items differently based on their sources.

But if you use something like:

data-toc="h2:not(.excluded-class)"

then you'll get:

<li class="toc-li-0 toc-h2 excluded-class" data-scroll-init="true"><a href="#toc-1" data-smooth-active="true">Title for first list item</a></li>

That excluded-class reference shouldn't be carried over, since there shouldn't be any need to reference things that aren't there.

This PR excludes any :not() classes from the list item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant