Is it possible to recreate such a field without using background images and only one element?

Ideally, I could control which corners are darkened by adding a class, so the above image could be class="box dark-top dark-left dark-bottom dark-right". I can darken two using: before and: after, but I have problems with good thinking to darken three or four corners without adding extra markup.
source
share