I'm trying to create a logo using pure HTML and CSS. The design is very intuitive, being a [13x13] matrix containing some colored items.
CSS is very simple and minor. However, the HTML code has many repeated parts and needs to be DRY (Don't Repeat Yourself).
body { width: 100vmin; margin: auto } logo { display: grid; grid-template-columns: repeat(13, 1fr); } s { } w { background-color: #d6d6d6; aspect-ratio: 1 } l { background-color: #d6d6d6; aspect-ratio: 1 } f { background-color: #d6d6d6; aspect-ratio: 1 }
I've tried using
instead of
without success.
Is there any way to reduce this code?
Note:The color should remain unchanged.
If javascript is available, you can concatenate the cell type into a string object and use it to dynamically build the flag. Sample code is as follows.
Based on the need for HTML/CSS and @Temani Afif's comment, here is an SVG solution: