Sunday Night CSS

jennymegan

jennymegan

Posted on September 6, 2020

Sunday Night CSS

Here we are on a Sunday night, and I'm undertaking a tedious task - trying to draw the HTML5 logo (above) using pure CSS and no images.
As someone with a background in CAD and at least a basic grasp of photoshop, it feels like having both hands tied behind my back and painting a picture with my toes...
Having said that, the task has done what it set out (I hope) to do, and I am infinitely more comfortable with CSS's graphic potential than I was this time two days ago.
It seems that even though CSS's primary use was never intended to be for making colourful shapes, there are enough little loopholes in it that some clever folk started making punchy little elements in an array of shapes.
You have the 4 bordered edges of a traditional "block" shape which can be manipulated to form triangles and trapeziuses, standard squares with "transform" to make rhomboids and diamonds, the radius property to make circles and soft edges.
Then you have the option of using an element's inherent pseudo-elements ::before and ::after to give extra little details, make more complex shapes by overlaying the originals, or even whole new shapes.

https://www.popwebdesign.net/drawing-unconventional-shapes-with-css.html is a great visual explanation of border-based and shadow-based shapes.
CSS-tricks has a good article with examples on using ::before & ::after: https://css-tricks.com/the-shapes-of-css.
And this lady just has fabulous skills as a CSS artiste: https://blog.prototypr.io/how-i-started-drawing-css-images-3fd878675c89.

Is there any real merit in designing shapes purely in CSS? Would it be an indication of a sub-par dev if I was to import images I had drawn in photoshop and place them on a site? I can see it's good to know and useful on occasion (to overlay a "Sale" sticker or similar) to use the CSS, but surely when making graphics using an intuitive graphical interface like photoshop (or even trusty old MS paint) has to be the best option. Open to opinions!

๐Ÿ’– ๐Ÿ’ช ๐Ÿ™… ๐Ÿšฉ
jennymegan
jennymegan

Posted on September 6, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Useful CSS Shorthand Properties
codenewbie Useful CSS Shorthand Properties

June 17, 2021

Day 17 - Hover Overlay
codenewbie Day 17 - Hover Overlay

October 2, 2020

Day 16 - Make A Simple Animated Nav Button
codenewbie Day 16 - Make A Simple Animated Nav Button

September 30, 2020

ยฉ TheLazy.dev

About