Setting aside the question of whether what you're doing violates Medium's ToS, ::before
is a CSS pseudo-element. It doesn't appear in the HTML markup, but acts like a virtual element, injected before a particular selector's element, that you can apply styles to.
In this case, the selector is .ordered-posts .post-item-small:before
, so the pseudo-element is inserted before each .post-item-small
that appears inside an .ordered-posts
element.
Psuedo-elements are often used in conjunction with CSS generated content, which can add some stuff to display inside the pseudo-element. In this case, the content is generated from a CSS counter which increments each time a matching element appears, so the list appears to be numbered! And if you reorder it, you don't have to worry about updating all the numbers; the counter handles that for you automatically. Pretty cool!
Here's a good reference for the ::before pseudo-element, and a good write-up of the CSS content property.
And just for fun: a great post on some cool stuff you can do with pseudo-elements.