So somewhere on the internetz I stumbled into an article on CSS shapes, and from there, CSS hexagons. The article's well worth a read, however there was one more thing that I though could be improved on the final code example... making changing colours easier! This can be done relatively easily by setting the border colour in with the rule for .hex
and then having the ::before
and ::after
rules for border-color
inherit.
I've used LESS to create my example, however the processed CSS is still very similar to that in the .less
file.
A Pen by William Duyck on CodePen.