CSS counters are not correctly rendered
See original GitHub issueExpected Behavior
I use CSS counters:
.line-numbers {
code {
counter-reset: step;
counter-increment: step 0;
}
code .line::before {
content: counter(step);
counter-increment: step;
width: v-bind(lineNumbersWidthPx);
margin-right: v-bind(lineNumbersMarginRightPx);
display: inline-block;
text-align: right;
color: $custom;
}
}
and they are shown correctly before downloading the image:
Current Behavior
Inside the generated image, the CSS counter value is 0 for every line:
Possible Solution
Steps To Reproduce
See https://stackblitz.com/edit/js-inyakv?file=index.js and click the button
Error Message & Stack Trace
<!-- Provide a log message if relevant -->
Additional Context
Your Environment
- html-to-image: 1.10.8
- OS: macOS Montery 12.5.1
- Browser: Chrome Version 104.0.5112.101 (Official Build) (x86_64)
Additional info: It works fine in Firefox 104.0.2
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
CSS counter not incrementing in shadow DOM - Stack Overflow
I have the following setup where a CSS counter works for slotted content but not in the shadow DOM. import { LitElement, css,...
Read more >The counters() CSS content function is not parsed correctly #705
Hi,. I have found an issue with using content: counters. It seems that when using the counters syntax the $counter_id holds the "("...
Read more >Using CSS counters - CSS: Cascading Style Sheets | MDN
CSS counters let you adjust the appearance of content based on its location ... The counter's name must not be none , inherit...
Read more >A Guide to CSS counter | SamanthaMing.com
A complete guide to CSS counter. How it works and how you can apply automatic incrementation to any HTML element just like ordered...
Read more >CSS Counter Styles Level 3 - W3C
CSS is a language for describing the rendering of structured documents ... <counter-style-name> is a <custom-ident> that is not an ASCII ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m also having this issue, got my CSS counters working nicely and then… 0 0 0 0 in the rendered image!
Any updates? Can someone point me in the right direction where I could fix this on my own in this project?