#tinyCSStip
π« DON'T use layered text-shadows for text outlines just because text-stroke is broken (
x.com/anatudor/status/178848β¦), they are going to produce ugly corners, thickened roundings and angled lines.
β
DO: use `paint-order: stroke fill` instead!
ALT ```
.mytext { /* π« DON'T */
text-shadow:
2px 2px 0 black,
-2px -2px 0 black,
-2px 2px 0 black,
2px -2px 0 black,
2px 0 0 black,
-2px 0 0 black,
0 2px 0 black,
0 -2px 0 black;
}
.mytext { /* β
DO */
-webkit-text-stroke: #000 4px;
paint-order: stroke fill
}
```
ALT Screenshot showing the same text with the DON'T (text-shadow emulating outlines) vs. the DO (paint-order to fix inner strokes mess) tactic. The text-shadow method comes with corner issues and angled lines getting thickened.
ALT Screenshot showing the same text with the DON'T (text-shadow emulating outlines) vs. the DO (paint-order to fix inner strokes mess) tactic. The text-shadow method comes with corner issues and angled lines getting thickened.
Most cursive fonts are unusable with text-stroke. Yeah, there's paint-order, but I want to have a semi-transparent stroke *on top* of the fill in order to create a font-size-relative double stroke, so just covering up the stroke where it intersects the fill defeats that purpose.