frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

The "Most Hated" CSS Feature: Cos() and Sin()

https://css-tricks.com/the-most-hated-css-feature-cos-and-sin/
42•rapawel•3h ago

Comments

swyx•1h ago
oh wow first css tricks i've seen post acquisition

what's up with the magazine in general... is it doing ok?

spartanatreyu•19m ago
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.

drivingmenuts•1h ago
Is it just me or did none of the examples show up in Codepen? The code was there, but nothing showed in the display.
zamadatix•59m ago
Hmm, worked for me on macOS, Linux, and Windows across Chrome/Firefox/Safari.
muzani•18m ago
It didn't work for me the first time I opened it, but did after the second.
tasty_freeze•1h ago
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•1h ago
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•1h ago
hallucinates ‘fluent’ and draws a net to catch eyes
recursive•1h ago
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•1h ago
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•1h ago
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.
Theodores•7m ago
Agreed.

I just checked with some code that I wrote a while back to rotate a faux-3D pyramid, to see how I did it. The trigonometry was the easy part, it was the backface culling that was the hard part. Anyway, I decorated my elements with CSS variables in script and used lots of Math.sin/cos/tan. Also present were lots of radian conversion things and the fun that goes with animating things the 'right way'. Basically oodles of extra stuff that took me the best part of a week to do, to result in something that memory leaks if left running for a few hours.

Now I have seen this article, I might just have to mix and match JS and CSS, so I build out the elements in code and add the CSS variables to them, for everything else to be done in CSS. I will obviously need an intersection observer to trigger the CSS rather than my JS, and so it goes on!

Either way, the trigonometry is the easy part, fixing that memory leak the hard part, but CSS is the way to go because that will work perfectly, unlike with JS.

Sohcahtoa82•1h ago
Surprises me when people hate on trigonometry. I enjoyed trig in high school so much that I made it my internet alias.
rmonvfer•1h ago
This made my day. Great alias!
Waterluvian•57m ago
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•51m ago
I always thought sohcahtoa itself was quite memorable. Sounds like a war cry!
bombcar•25m ago
Or something those wordy math textbooks would have had - the Sohcahtoa Indians who dealt in triangles …
rndmio•45m ago
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•27m ago
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.

spartanatreyu•37m ago
I learned it as: Some old hags, can't always hide, their old age.

I guess this is the version we use in Australia.

muzani•8m ago
We made this up in school: "saya tak hensem, kalau saya hensem, tentu Tipah suka" [opposite = tentang, adjacent = sebelah, cos = kos]

Translation: I'm not handsome, if I were handsome, Tipah (our principal) would like me"

25 years ago and I still remember it clearly. Also it was middle school education on how to solve problems in a different space; this one solving math in a second language space lol

untilted•56m ago
Obligatory xkcd: https://xkcd.com/809/
chris_wot•24m ago
You think they hate trigonometry, then you tell them about radians and they really hate trigonometry. Which is... crazy really.
raldi•1h ago
Mods, new title suggestion: "CSS's cos() and sin() features"
geor9e•52m ago
I would wholeheartedly support the mods rewriting every clickbait headline on HN (there are just so many…)
egypturnash•19m ago
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)
alekratz•7m ago
When I loaded up the page, something like 5 empty HTML files downloaded automatically, did this happen to anyone else? Firefox Linux

Shai-Hulud malware attack: Tinycolor and over 40 NPM packages compromised

https://www.stepsecurity.io/blog/ctrl-tinycolor-and-40-npm-packages-compromised
821•jamesberthoty•12h ago•630 comments

How to make the Framework Desktop run even quieter

https://noctua.at/en/how-to-make-the-framework-desktop-run-even-quieter
168•lwhsiao•5h ago•40 comments

Things you can do with a Software Defined Radio (2024)

https://blinry.org/50-things-with-sdr/
569•mihau•9h ago•105 comments

Denmark close to wiping out cancer-causing HPV strains after vaccine roll-out

https://www.gavi.org/vaccineswork/denmark-close-wiping-out-leading-cancer-causing-hpv-strains-aft...
429•slu•5h ago•172 comments

A dumb introduction to z3

https://asibahi.github.io/thoughts/a-gentle-introduction-to-z3/
83•kfl•1d ago•10 comments

Waymo has received our pilot permit allowing for commercial operations at SFO

https://waymo.com/blog/#short-all-systems-go-at-sfo-waymo-has-received-our-pilot-permit
530•ChrisArchitect•7h ago•503 comments

How Container Filesystem Works: Building a Docker-Like Container from Scratch

https://labs.iximiuz.com/tutorials/container-filesystem-from-scratch
86•lgunsch•3d ago•18 comments

Doom crash after 2.5 years of real-world runtime confirmed on real hardware

https://lenowo.org/viewtopic.php?t=31
23•minki_the_avali•2h ago•9 comments

I built my own phone because innovation is sad rn [video]

https://www.youtube.com/watch?v=qy_9w_c2ub0
146•Timothee•1d ago•33 comments

The "Most Hated" CSS Feature: Cos() and Sin()

https://css-tricks.com/the-most-hated-css-feature-cos-and-sin/
42•rapawel•3h ago•27 comments

Micro-LEDs boost random number generation

https://discovery.kaust.edu.sa/en/article/25936/micro-leds-boost-random-number-generation/
10•giuliomagnifico•2h ago•4 comments

A new experimental Google app for Windows

https://blog.google/products/search/google-app-windows-labs/
116•meetpateltech•8h ago•158 comments

Wind turbine blade transportation challenges

https://spectrum.ieee.org/wind-turbine-blade-transport-plane
72•Brajeshwar•3d ago•93 comments

Should We Drain the Everglades?

https://rabbitcavern.substack.com/p/should-we-drain-the-everglades
60•ksymph•4h ago•48 comments

Launch HN: Rowboat (YC S24) – Open-source IDE for multi-agent systems

https://github.com/rowboatlabs/rowboat
42•segmenta•6h ago•22 comments

Scammed out of $130K via fake Google call, spoofed Google email and auth sync

https://bewildered.substack.com/p/i-was-scammed-out-of-130000-and-google
257•davidscoville•7h ago•440 comments

When the job search becomes impossible

https://www.jeffwofford.com/wp/?p=2240
135•pertinhower•10h ago•182 comments

Plugin System

https://iina.io/plugins/
124•xnhbx•7h ago•31 comments

The Linux Process Journey (2023) [pdf]

https://thelearningjourneyebooks.com/wp-content/uploads/2023/09/TheLinuxProcessJourney_v6_Sep2023...
50•maxmoehl•5h ago•1 comments

UTF-8 history (2003)

https://doc.cat-v.org/bell_labs/utf-8_history
83•mikecarlton•3d ago•32 comments

SQL performance improvements: finding the right queries to fix

https://ohdear.app/news-and-updates/sql-performance-improvements-finding-the-right-queries-to-fix...
16•freekmurze•3h ago•1 comments

Top UN legal investigators conclude Israel is guilty of genocide in Gaza

https://www.middleeasteye.net/news/un-concludes-israel-guilty-genocide-gaza
586•Qem•15h ago•381 comments

Inboxfuscation: Because Rules Are Meant to Be Broken

https://permiso.io/blog/inboxfuscation-because-rules-are-meant-to-be-broken
5•campuscodi•3d ago•0 comments

CIA Freedom of Information Act Electronic Reading Room

https://www.cia.gov/readingroom
147•bookofjoe•10h ago•34 comments

Writing an operating system kernel from scratch – RISC-V/OpenSBI/Zig

https://popovicu.com/posts/writing-an-operating-system-kernel-from-scratch/
82•popovicu•2d ago•3 comments

Bertrand Russell to Oswald Mosley (1962)

https://lettersofnote.com/2016/02/02/every-ounce-of-my-energy/
173•giraffe_lady•7h ago•83 comments

Implicit ODE solvers are not universally more robust than explicit ODE solvers

https://www.stochasticlifestyle.com/implicit-ode-solvers-are-not-universally-more-robust-than-exp...
95•cbolton•10h ago•32 comments

Paper Folding Assembly Line [video]

https://www.youtube.com/watch?v=XhUuhl9iWpQ
59•peteforde•1w ago•9 comments

Development of the MOS Technology 6502: A Historical Perspective (2022)

https://www.EmbeddedRelated.com/showarticle/1453.php
55•jason_s•8h ago•8 comments

60 years after Gemini, newly processed images reveal details

https://arstechnica.com/space/2025/09/60-years-after-gemini-newly-processed-images-reveal-incredi...
254•sohkamyung•3d ago•72 comments