by throwaway13337 · 10y ago · 0 comments
Probably the easiest way to do this automatically is through adobe illustrator. You can convert an arbitrary file to CSS:
https://helpx.adobe.com/illustrator/using/css-extraction.htm...
I guess a lot of people think it's neat in a 'web-hack' sort of way, but it's just another way to express the same thing.
Pay no attention to the man behind the curtain.
What the author is doing is using the single div and its two pseudo elements before and after (so effectively the author has three elements to work with) and style the borders, border-radius, background, shadow, text-content, etc. The use of linear-gradient declarations on the background in particular is a big part of a lot of these drawings, because you can add an arbitrary number of them on any element. Look at the Tardis sample in your element inspector and toggle the background of the div; you will see that most of the door panelling and windows disappear. These are drawn with linear gradients where the colours don't blend into each other, but stop abruptly. By layering these 'gradients', you can create patterns, such as cross hatching or a grid of lines.
Some of these are actually really clever.
That explains quite a lot.
CSS hacks just got a lot less impressive for me.