frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Performance-focused forks of styled-components

https://www.sanity.io/blog/cut-styled-components-into-pieces-this-is-our-last-resort
29•isaiahwp•3h ago

Comments

RedShift1•3h ago
Maybe CSS in JS was the wrong thing to begin with. Your developers were so preoccupied with whether they could, they didn't stop to think if they should.
mootoday•2h ago
I came to post the same comment :-)!
jeswin•2h ago
It might seem like a terrible idea now. But when it was first introduced, a) people were still trying to get CSS and Components to work together, React having made components quite popular; and (b) React was actually usable, compared to the complete mess it's become now, especially after they introduced hooks.

I switched to web components for all my personal work.

a_humean•2h ago
But we already had things like tachyons css (tailwind precursor) and webpack css modules at the time that both offered static stylesheet solutions to that problem.
jeswin•1h ago
They weren't great either in hindsight.

But more importantly, we need to explore different paths to figure out what doesn't work. Things which seem like bad ideas in hindsight aren't bad experiments to run - otherwise we will all learn nothing.

breakingcups•2h ago
I was about to say the same. Having lived mostly in Vue land, this quote felt astounding to me:

"The React team themselves have made it clear: runtime CSS injection will always be slower than statically extracted styles. They recommend using <link rel="stylesheet"> for static styles and inline styles for dynamic values. That's the future."

I thought this lesson was already widely learned since the jQuery days.

Perz1val•2h ago
"React Andies" have not seen jquery days
reify•2h ago
Does this mean I can eat 40% faster when I use a fork.

if so, I shall set the dining table without knives.

there is no spoon!

dalf•2h ago
You might not have a fork if you dine with philosophers

( https://en.wikipedia.org/wiki/Dining_philosophers_problem )

tym0•2h ago
Haven't written frontend in a few years but honestly for me CSS Modules solved the scoping issue and all the CSS in JS/Tailwind stuff since then feels like a red herring.
theknarf•2h ago
I've always thought CSS Modules was the best solution as well, having worked a lot with Tailwind its entirely okay, but "CSS in JS" was always a bad idea from the get go.
coxmi•2h ago
I’d go further than this and say globally-scoped CSS is fine as long as you’re using a decent naming pattern (e.g. BEM), or @layers.

For me, back in the JQuery days, the problem was always globally-scoped JS/DOM, rather than CSS. The big revolution was simply co-locating/importing styles in JS modules during the compile step, which works surprisingly well even outside of any framework.

Just using vanilla DOM or a small wrapper around web components for connectedCallback/disconnectedCallback logic is refreshingly simple. It’s quite sad that most SSR frameworks don’t allow this sort of approach, and lock you in to a specific front-end library.

diggan•40m ago
> I’d go further than this and say globally-scoped CSS is fine as long as you’re using a decent naming pattern (e.g. BEM), or @layers.

Hear hear. Started using BEM in like 2016, haven't had collision issues since. Not sure why people are so hellbent on doing CSS inside JavaScript when CSS by itself can do almost anything you'd want at this point, even handling basic interactions.

joduplessis•2h ago
CSS-in-JS is possibly the worst idea to come out of the last 10 years of frontend. Saying that as someone who has written a lot of CSS-in-JS code.
lloydatkinson•2h ago
I normally refrain from commenting on anything regarding CSS, styling, and design systems as I feel that HN in particular has disingenuous debates on it.

Rather than using a fork, you could completely remove the “style sheets at runtime” part by using a CSS in TypeScript tool which builds everything and produces plain CSS files and CSS variables.

There are at least four main benefit:

- Can enforce design tokens (colours, spacing, whatever) with type safety

- The previous point helps enforce and encourage design consistency; I have lost count of the amount of times I’ve seen lazy “just append some more unmaintainable mess” at the bottom of CSS files

- CSS is built at build time which is what you are already familiar with if you’ve used a CSS preprocessor before

- Smaller file sizes sent to the users browser

Oh and one final thing: vanilla-extract is not just for React, its standalone meaning you can use it even with something entirely server side if you wished.

VPenkov•5m ago
I'm really not a fan of CSS in JS, however it does have it's use-cases. Class mangling is very convenient with it and allows you to be prescriptive about how you're doing theming support, which is great when building libraries that 3rd parties embed on their websites.

The trade-off is that of course your customers can't style things you haven't anticipated, but it means you can control what changes are breaking.

And you can always add an extra variable in a new version if a customer wants to change a border color.

pimterry•2h ago
Personally I've started migrating to vanilla-extract (https://vanilla-extract.style/): syntactically & conceptually similar to SC, relatively easy migration and lots of the same advantages, but entirely precompiled with zero runtime and nicely framework & tooling agnostic.
jorams•2h ago
Sounds like a good development, but some statements in the post are a bit odd to me:

> Your app has styled-components. That's not changing today. But it doesn't have to be slow while you figure out tomorrow.

It always was. You decided to make it slow and were fine with it, not sure why that's suddenly unacceptable.

Qwen3-Next

https://qwen.ai/blog?id=4074cca80393150c248e508aa62983f9cb7d27cd&from=research.latest-advancement...
137•tosh•3h ago•46 comments

Examples from The LaTeX Companion book (3rd edition)

https://ctan.org/pkg/tlc3-examples
15•teleforce•1h ago•2 comments

Float Exposed

https://float.exposed/
230•SomaticPirate•10h ago•53 comments

Debian 13, Postgres, and the US time zones

https://rachelbythebay.com/w/2025/09/11/debtz/
125•move-on-by•7h ago•49 comments

Top model scores may be skewed by Git history leaks in SWE-bench

https://github.com/SWE-bench/SWE-bench/issues/465
398•mustaphah•15h ago•125 comments

Classic GTK1 GUI Library

https://gitlab.com/robinrowe/gtk1
11•MaximilianEmel•3d ago•1 comments

Using Emacs Org-Mode With Databases: A getting-started guide

https://gitlab.com/ryanprior/emacs-org-data-starter
35•adityaathalye•3d ago•3 comments

Claude’s memory architecture is the opposite of ChatGPT’s

https://www.shloked.com/writing/claude-memory
347•shloked•15h ago•184 comments

Logging in Go with Slog: A Practitioner's Guide

https://www.dash0.com/guides/logging-in-go-with-slog
12•ayoisaiah•3d ago•4 comments

Show HN: I made a generative online drum machine with ClojureScript

https://dopeloop.ai/beat-maker/
4•chr15m•1h ago•1 comments

Doorbell prankster that tormented residents of apartments turns out to be a slug

https://www.theguardian.com/world/2025/sep/08/doorbell-prankster-that-tormented-residents-of-germ...
187•robin_reala•3d ago•91 comments

AirPods live translation blocked for EU users with EU Apple accounts

https://www.macrumors.com/2025/09/11/airpods-live-translation-eu-restricted/
346•thm•22h ago•398 comments

XFN – XHTML Friends Network (2003)

https://gmpg.org/xfn/
29•thinkingemote•4d ago•6 comments

Building my childhood dream PC

https://fabiensanglard.net/2168/
143•joexbayer•4d ago•43 comments

Our website looks like an operating system

https://posthog.com/blog/why-os
357•bnc319•10h ago•259 comments

Behind the scenes of Bun Install

https://bun.com/blog/behind-the-scenes-of-bun-install
386•Bogdanp•21h ago•128 comments

Show HN: C++ Compiler Support Page

https://cppstat.dev
44•cemdervis•4d ago•11 comments

Toddlerbot: Open-Source Humanoid Robot

https://toddlerbot.github.io/
66•base698•10h ago•14 comments

Rails on SQLite: new ways to cause outages

https://andre.arko.net/2025/09/11/rails-on-sqlite-exciting-new-ways-to-cause-outages/
155•ingve•15h ago•47 comments

Samsung taking market share from Apple in U.S. as foldable phones gain momentum

https://www.cnbc.com/2025/08/16/samsungs-us-market-share-apple-rivalry-foldable-phones.html
223•mgh2•1d ago•263 comments

Full Moon: Seestar S50 vs. Samsung S25

https://www.4rknova.com//blog/2025/09/08/moon-photos
31•ibobev•3d ago•26 comments

Bulletproof host Stark Industries evades EU sanctions

https://krebsonsecurity.com/2025/09/bulletproof-host-stark-industries-evades-eu-sanctions/
181•todsacerdoti•16h ago•68 comments

Danish supermarket chain is setting up "Emergency Stores"

https://swiss.social/@swaldorff/115186445638788782
279•sohkamyung•11h ago•264 comments

From burner phones to decks of cards: NYC teens adjusting to the smartphone ban

https://gothamist.com/news/from-burner-phones-to-decks-of-cards-nyc-teens-are-adjusting-to-the-sm...
241•geox•20h ago•184 comments

CRISPR offers new hope for treating diabetes

https://www.wired.com/story/no-more-injections-crispr-offers-new-hope-for-treating-diabetes/
213•manveerc•20h ago•55 comments

The challenge of maintaining curl

https://lwn.net/Articles/1034966/
131•signa11•8h ago•35 comments

Conway's Game of Life, but musical

https://www.hudsong.dev/digital-darwin
189•hudsongr•20h ago•32 comments

NT OS Kernel Information Disclosure Vulnerability

https://www.crowdfense.com/nt-os-kernel-information-disclosure-vulnerability-cve-2025-53136/
137•voidsec•18h ago•29 comments

‘Robber bees’ invade apiarist’s shop in attempted honey heist

https://www.cbc.ca/news/canada/british-columbia/robber-bees-terrace-bc-apiary-1.7627532
141•lemonberry•17h ago•77 comments

A Web Framework for Zig

https://www.jetzig.dev/
123•nivethan•16h ago•16 comments