You can insert a new stylesheet with the following HTML:
<style scoped> li:before { color: red; } </style>
The reason this is the only way to do this is because :before is a pseudo-element, which means that it does not actually become part of the DOM. Unfortunately, this means that there is no way to style it inline as requested.
As an example:
<li style="color: red;">text</li>
will stylize the entire LI element, not just its :before pseudo-element, and since the :before element has no markup, it cannot have its own property style= .
source share