Ah, I see your issue: you do know you can have whitespace inside attributes? You don't have to clump all the class names on one line. Scanning vertically is quicker than through the horizontal line-noise of both your examples.
<img class="
block
height-16
small:height-24
rounded-full
margin-horizontal-auto
margin-bottom-4
small:margin-bottom-0
small:margin-right-4
small:margin-left-0
">
This also has the benefit too, that if you use version control line-based diffs to see what's changed, it will highlight the specific css class name that changed. Handy if you need to ensure that whenever you change the bottom margin, you can see at a glance whether the small prefixed one has been updated too.
On the other hand if you regularly need that many classes to style an element, perhaps it's a good place to refactor commonly occurring class names into a set, and label that set with a meaningful identifier.
As for mathematical notation, it's about as understandable to me as my understanding of Hanzi.