--c: #5EBD3E,#FFB900,#F78200,#E23838,#973999,#009CDF;
@content: '';PS: Please give me comments on the current design of the blog.
<script src="https://esm.sh/css-doodle/css-doodle.min.js?raw"></script>
<css-doodle>
@grid: 15 / 90%;
border-radius: 50%;
background: hsl(@t(/20), 70%, 60%);
scale: sin(@atan2(@dx, @dy) + @ts);
</css-doodle>
No JS needed except for loading the definition of the <css-doodle> component. Works in plain HTML, Markdown, frameworks, etc.Have you tried the same thing with shadows? They can also be stacked, I believe.
Kudos to the author for posting something cool and new in the age of standardised styles.
The Daily Sketch series or 'CSS Animation with offset-path' are equally fun.
I may be entirely wrong though, I don't know in detail how browsers render stuff
Made few shots and playground for that back then: https://x.com/myfonj/status/1870178380831732160
My example: https://codepen.io/spartanatreyu/pen/xggjWz
------------------------------------------------
Overall, CSS tends to be the better tool for the job.
SVG has better paths and more interesting filters, but it's held back by a few critical issues.
1. A small amount of filters are not hardware accelerated in firefox/servo's webrender engine, which causes them to fallback to software rendering. Usually it just freezes the web page for a second or two while the image software renders before returning to normal performance, but if you try to animate any of the values it locks up the entire page.
That basically animated SVGs with filters a no-go.
2. Safari doesn't draw SVGs properly, it has a built-in "performance budget" where it just stops drawing the rest of the SVG if it isn't finished within a split second. Which is fine for something like an icon, but terrible for things like the main feature graphic / background of a page.
Meanwhile CSS keeps getting better. Its filters are improving (filter, mix-blend-mode, backdrop-filter), and its animations are improving too (keyframes + animation, transition, offset, custom-properties + @property's syntax, scroll-timeline, cross-document view transitions).
The two things that CSS is worse at than SVG are:
1. Paths (in which case, you can just put SVG paths into your page and style them with CSS for anything more complex than a static stroke/fill anyway)
2. Generating textures (which you can't guarantee look consistent thanks to Safari, so you're usually better off sending a hand optimized texture over the wire anyway)
Firefox has chosen to expand based on distance at all points, which is one of the reasonable answers and probably the most general one; a cusp then expands to a curve.
The others have chosen to retain cusps, which can be a reasonable answer and I believe is a lot cheaper to compute; but degenerate cases abound as you expand past the feature size (distances between nodes), so that by the fourth red ring it’s obviously incorrect.
Box shadows are another case where expansion occurs: the fourth length parameter, spread distance. If the corner is a cusp, the shadow corner will be a cusp. If it’s rounded, the shadow corner will be rounded. See https://drafts.csswg.org/css-backgrounds/#shadow-shape for some helpful diagrams. A sneaky trick: .1px border-radius means the box still looks square, but the expanded shadow will curve. Sometimes useful. But back on the original content of the article—if you use a font with microscopic curves instead of cusp nodes, Chromium/Safari will look more like Firefox.
SVG is not great for text - HTML has more features - but for display text it's OK.
(Yes, it could technically be infinite corner cases)
I used to see that retro multi-stroke text effect quite often and tried to replicate it using the CSS text-stroke property, but the results never quite matched. Because text-stroke accepts a single value, stacking elements was the only workaround I could think of, though it didn't seem to work.
One evening late last year, I was eager to give it another shot after seeing the text effect again in the book Graphic Japan : from woodblock and zen to manga and kawaii.

Text stroke effect from the book
I kept stacking several elements and accidentally varied the text-stroke-width for each layer. To my suprise, the result was getting closer this time.
--c: #cc0d55;
--n: @i(-1);
@grid: 36x1 / 240px;
@content: '✱';
position: absolute;
inset: 0;
font: 100px/0 sans-serif;
color: var(--c);
z-index: @I(-@i);
-webkit-text-stroke-color: @pn(--c, #f4e1e8);
-webkit-text-stroke-width: $em(.08n+.02(1-(-1)^n));
For different values of the text-stroke-width, browsers will automatically draw outlines of the charater, The larger you set the stroke width, the thicker the outline will get, while still maintain its original shape.
@grid: 7x1/ 360px auto noclip; @content: '✱'; font: 50px/0 sans-serif; color: transparent; -webkit-text-stroke-color: #cc0d55; -webkit-text-stroke-width: @i(*1.8px);
The next step is to use different colors and put them in order.
@grid: 12x1/ 100px ß #f4e1e8; @content: '✱'; position: absolute; inset: 0; z-index: @I(-@i); font: 50px/0 sans-serif; color: transparent; -webkit-text-stroke-color: @pn(#f4e1e8, #cc0d55); -webkit-text-stroke-width: @i(*3px);
The interesting part is how the browsers outlining the character shapes differently. FireFox offers more smoother rendering than in Chrome and Safari.
Another interesting part is when there are more text put inline, the character shapes will be merged.
/* ... */
@content: '秋收冬藏';
The final result really depends on the font you choose. To help experimenting with different fonts more quickly, I added the @google-font function for faster font loading.
--c: #cc0d55,#fff; @grid: 34x1 / 320px; @content: 'b'; font: 150px/0 @google-font(Matemasie); @place: center; z-index: @I(-@i); color: @pn(--c); -webkit-text-stroke-color: @pn(--c); -webkit-text-stroke-width: @i(-1, ease, *12px);
font-family: @google-font(Matemasie);
@content: 'b';
--c: #cc0d55,#fff; @grid: 30x1 / 320px; :after { content: 'Love'; position: absolute; } font: 80px/0 @google-font("Pacifico"); @place: center; z-index: @I(-@i); color: @pn(--c); -webkit-text-stroke-color: @pn(--c); -webkit-text-stroke-width: @i(ease, -1, *15px);
font-family: @google-font(Tangerine);
@content: 'Love';
--c: #fff9e0,#f1c550,#ff6600,#ce2525; --c: #cc0d55,#fff; @grid: 30x1 / 320px +2 ~0 -10%; :after { content: '+'; position: absolute; } @place: 50% 50%; font: 120px/0 @google-font("Cherry Bomb One"); z-index: @I(-@i); color: @pn(--c); -webkit-text-stroke-color: @pn(--c); -webkit-text-stroke-width: @i(ease, -1, *12px);
font-family: @google-font('Cherry Bomb One');
@content: '+';
Unfortunately, the performance is as bad as CSS filters, especially when the font-size is getting bigger, you may have noticed some flicking above. It's fine for experiments like this, or for generating images with css-doodle, but it's not well-suited for production usage.
Here are two more examples to play around with different colors and characters, generated with css-doodle, just for fun.

CodePen link for the first one: https://codepen.io/yuanchuan/pen/ogzarGo