How to verify CSS property of HTML element

I lied at the very first of this topic. I wrote:

No. I have never wanted to write a test that verifies values of CSS properties of HTML elements.

Why did I lie? — I wrote this post just to reply to a previous post.

which was left un-resolved for years. So I wanted to say “yes, it is possible. If you want to, do this, do that”. I pretended, for rhetoric, that I wanted to. But in fact I would never do it. I do not think it is a good idea for WebUI end-to-end test scripts to look into CSS properties. Visual Inspection is far pragmatic for me.