-
Notifications
You must be signed in to change notification settings - Fork 3
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
Configuring custom element classes #3
Comments
It seems like I could possibly do this by working around |
@spl He uses a match for matches i.e. yes it bypasses all the nodes. Let me know if this doesn't solve your first problem and I'll think about it. You can also feel free in relation to PR |
While looking at the code and thinking about this issue, I'm wondering about a few things that maybe you could give me feedback on. First, it seems like the toggle code is rather specialized for On that note, I wonder if it would be an improvement to turn the part that produces the function ({ level, href, text, children }) { ...; return [{ tag, content, attrs }] } The callback provides the most flexibility to the user while still doing the hardest part with Then,
Alternatively, different implementations of the callback can be offered by other packages. Those are just some thoughts passing through my head. |
As an aside, I think |
I would like to work on a feature that would allow me to do something like what I described at the top of the issue. How should I proceed? Should I add the basic ability to set classes on the generated HTML? Or should I try something more general, as discussed in #3 (comment)? If it's the latter, I would like your thoughts on what that approach should look like. Thanks! |
Any thoughts? Thanks! |
// @voischev |
I would leave the TOC code clean. And added classes using sub plugins. It would be cool to see PR how would you do it? |
I'm just trying out
posthtml-toc
. It's nice and simple, and it seems to do what it says. Thanks for putting it out there!Currently, it seems like I have to style the table of contents using
#toc
in my external CSS. For some approaches to CSS, such as the utility-first approach, it would be significantly more convenient to set theclass
es on the generated elements (specifically, each ofdiv#toc
,h2
,ul
,li
). That is, I could end up with something like this (using Tailwind):Is there a way to do that either within or outside
posthtml-toc
? If not, is that something you would consider adding?The text was updated successfully, but these errors were encountered: