I have a small problem with styling my ordered lists. Consider the following (auto-generated) HTML. The fact that it is automatically generated is quite important because I don't really feel like correcting every single HTML file that is generated this way. Now to style JUST the numbers on this bad boy, I wrote some style sheets of cascading persuasion. See below.
ol {
list-type: none;
}
ol::first-of-type {
/* The selector here is my latest addition, and surprise surprise, it doesn't play */
counter-reset: count_list;
/* well with the incremention of the counter. Without this, the numbering */
} /* does increment, except when the <ol>'s get closed to accomodate the <p> */
ol li::before {
display: inline-block;
counter-increment: count_list;
content: counter(count_list) " ";
color: $c-brand-primary;
/* substitute this with any hex, I'm using SCSS variables */
width: 1.3em;
float: left;
margin: 0 0 0 -1.3em;
font-weight: bold;
text-align: right;
direction: rtl;
padding-right: 1.3em;
/* yeah I know it's quite the long way 'round, but it does what I want it to */
}
<ol>
<li>Item1</li>
<li>Item2 is an item that looks a lot like a Lorem ipsum dolor sit amet, consectetuer adipiscing elit, meaning it's quite long and causes some problems in wrapping.
</ol>
<!--Yes, it actually closes the ol in favour of showing the next-->
<p>
<p> Pretend like this says something very long and interesting </p>
<ol start=3>
<li> And we list on.</li>
</ol>
Is there any CSS way to get the styling to take these pesky start
s into consideration AND let me style JUST the numbers of the list the way I want them to?