Post #1756606
2026-04-28 13:30 UTC
So it appears that
- the content property of ::before doesn't accept integers as a value
- it is not possible to convert an integer to a string in CSS
Use case: print out values of sibling-index() and a few friends for research purposes.
Replies (2)
-
@bigandy@indieweb.social 2026-04-28 13:48
@ppk@front-end.social you can use counter-reset like so: li { counter-reset: index sibling-index(); &::after { content: "index:: " counter(index); } } https://codepen.io/bigandy/pen/MYbgLmz
-
@kizu@front-end.social 2026-04-28 19:03
@ppk@front-end.social So, this is total overkill for your case, but https://kizu.dev/preview-mixin/