Elektrine lite

← Feed

@bhoot@mastodon.pub.solar

Post #1767860

2026-04-27 10:03 UTC

@aartaka yes unfortunately. I've put it to another use though: to number the levels of my headings in an article. So a heading is prefixed with their corresponding section number like this: https://bhoot.dev/2024/on-linux-file-and-links/#copying-a-soft-link-file CSS in the following post:

Replies (2)

  • @bhoot@mastodon.pub.solar 2026-04-27 10:03

    @aartaka ``` :root { counter-reset: h2 h3 h4; } h2::before { counter-increment: h2; content: counter(h2) "."; counter-set: h3 0; } h3::before { counter-increment: h3; content: counter(h2) "." counter(h3) "."; counter-set: h4 0; } h4::before { counter-increment: h4; content: counter(h2) "." counter(h3) "." counter(h4) "."; } ```

    Open ##1767861

  • @aartaka@merveilles.town 2026-04-27 13:33

    @bhoot yes, that seems to be one of the intended use-cases for counters! I just wish these were slightly more flexible…

    Open ##1767862