The "Most Hated" CSS Feature: Cos() and Sin()
27 comments
·September 16, 2025Sohcahtoa82
Waterluvian
Did you learn it as “sign on highway, cozy at home, tan on arm”? That’s basically the only high school math that stuck with me.
Oh and I guess negative b plus or minus b squared something something four a c over two a. I think there’s a square root to shove most of that into.
cameronh90
I always thought sohcahtoa itself was quite memorable. Sounds like a war cry!
bombcar
Or something those wordy math textbooks would have had - the Sohcahtoa Indians who dealt in triangles …
spartanatreyu
I learned it as: Some old hags, can't always hide, their old age.
I guess this is the version we use in Australia.
rndmio
In the UK it was “Attack Henry Cooper, outside his shop, on a Tuesday” no idea why the random violence but I never forgot it
Theodores
Allegedly your grandpa, armed with his slide rule, has even more random violence:
"Spitfire or Hurricane come and hurry to our aid"
This works for me as the order of the functions matches the order shown on my trusty FX82A. Your version is kind of messed up.
I am giving this AI thing a wide birth, however, could we ask a LLM to invent a new aide memoire for this? We have got the silent generation and the boomers covered, but is there something we can do for kids today? Maybe it references Cinnamoroll, Hello Kitty or Octonauts characters that actual kids know, without it being ultra-violent.
rmonvfer
This made my day. Great alias!
chris_wot
You think they hate trigonometry, then you tell them about radians and they really hate trigonometry. Which is... crazy really.
untilted
Obligatory xkcd: https://xkcd.com/809/
egypturnash
brb gonna see how much of DOC’s Demons Are Forever can be collapsed into simple css animations (https://m.youtube.com/watch?v=3tSI8gw_yUQ)
raldi
Mods, new title suggestion: "CSS's cos() and sin() features"
geor9e
I would wholeheartedly support the mods rewriting every clickbait headline on HN (there are just so many…)
tasty_freeze
I can't wait for the LLM() function to drop.
body { LLM(
"You are an expert web designer, completely fluent in CSS.
Create styling for this commerce website which is both
eye-catching yet professional looking, while being engaging.
Ensure it conforms to accessibility standards."
) }
falcor84
I actually am really looking forward to a future where we have better tooling for a true "user agent" that knows my preferences and can style every page automatically just ust the way I like it (and letting me override anything by asking it once and having it remember). I'm so tired of UX designers choosing things for me assuming I'm a 5-year old.
dgfitz
hallucinates ‘fluent’ and draws a net to catch eyes
recursive
This seems like the type of thing that I'd want to like. But the necessity of inline assigning the `--i` CSS variables to each element bothers me. I have to use some template system or manually keep these variables in sync in my markup. Doing those things seems worse than doing this kind of layout arithmetic in javascript, loathe though I am to admit it.
mhink
He does mention at one point that sometime soon it won't be necessary:
> Note: This step will become much easier and concise when the sibling-index() and sibling-count() functions gain support (and they’re really neat). I’m hardcoding the indexes with inline CSS variables in the meantime.
The inline links there go to https://css-tricks.com/almanac/functions/s/sibling-index/, which is pretty nifty honestly.
zamadatix
Inlining isn't necessarily a requirement for how it's used here. E.g. you could put something like:
.container:nth-child(1) {--i: 1}
.container:nth-child(2) {--i: 2}
...
In your CSS. Still not all that ideal given you need to ensure you have enough entries for all the entries you might have... but at least a more dynamic and self-contained option until the `sibling-index()` feature they mention roles out.null
swyx
oh wow first css tricks i've seen post acquisition
what's up with the magazine in general... is it doing ok?
spartanatreyu
Post-acquisition the Digital Ocean ran it for a little while with the same staff, then they let a whole bunch of people go (both digital ocean and css-tricks staff).
The css-tricks website was basically dormant for a few years.
Chris (the original creator of css-tricks) sick of seeing his creation stagnate tried to get Digital Ocean to get the website going again but it looked like Digital Ocean didn't know enough about the site to resume posting.
At some point the website's editor (Geoff) who had been let go as part of the layoff came back to work on the website and their was much rejoicing.
---
You can read more about it here: https://chriscoyier.net/2024/02/28/where-im-at-on-the-whole-...
---
CSS-trick's content had a bit rocky at the start of its comeback, but it's feels much better now than it did when it first resumed.
The vibe is a little bit different now, but I think that's because so many webdev writers are experimenting and writing in the open on mastodon before posting on their own blogs and larger platforms like css-tricks.
We didn't get as much of a peak behind the curtain before.
null
drivingmenuts
Is it just me or did none of the examples show up in Codepen? The code was there, but nothing showed in the display.
muzani
It didn't work for me the first time I opened it, but did after the second.
zamadatix
Hmm, worked for me on macOS, Linux, and Windows across Chrome/Firefox/Safari.
lyu07282
So its hated because you had to explain basic high school level math to frontend developers in the article I assume? /s
Surprises me when people hate on trigonometry. I enjoyed trig in high school so much that I made it my internet alias.