By “S” I’m not referring to “style” or “sheets”… I’m talking about the “S” in my logo – I remade it with CSS (Take a look at upper left if you haven’t noticed it). It’s largely inspired by Nicolas Gallagher’s genius pure CSS GUI icons.
A closer look:
It’s one HTML element!
1
<divid="s"></div>
Here is how I did it:
First draw a circle using border-radius.
Base circle
12345678
#s{position:relative;width:1em;/* make it scale with font size */height:1em;border:1pxsolid$color;border-radius:1em;/* actually slightly over 0.5em is enough *//* vendor prefixes emitted for succinctness */}
Then cover up the upper-right and lower-left part of the circle using a rotated :before pseudo element.
:before cover up
123456789101112
#s:before{content:' ';position:absolute;display:block;width:0.707em;/* = sqrt(2) / 2 */height:1.2em;/* exceed 1em to cover the border */top:-0.1em;/* = (1.2 - 1) / 2 */left:0.1465em;/* = (1 - 0.707) / 2 */background-color:#fff;/* fill with white */transform:rotate(45deg);/* rotate 45 degrees clockwise */}
The :before element is actually like this:
Last, connect the two quarter circles with a solid :after pseudo element.