'Adding dynamic content from django templates with css
Is it possible to add dynamic content with css? I'm having a button that shows/hides collapsible content and I would like to display on it "Show less" and "Show all X errors" where X is a number of errors. Right now I've got:
.collapsible_button:not(.active):after {
content: '\02795 Show all errors';
/* Unicode character for "plus" sign (+) */
float: left; }
.banner .active:after {
content: "\2796 Show less ";
/* Unicode character for "minus" sign (-) */
float: left; }
and
<button id="show_more" class="btn btn-secondary collapsible_button"></button>
But I would like something like:
content: '\02795 Show all {{ spreadsheet|length }} errors';
Is there a way to do this with scss only or I need to get js involved?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
