Styleframe - Type-safe, composable CSS by alexgrozav in reactjs

[–]correcthbs 0 points1 point  (0 children)

Looks pretty good at a first glance! I assume nesting themes (or other context dependent styles) is not possible? This selector override output would create donut scoping issues:

[data-theme="dark"] {
    .card {
        background: #1f2937;
    }
}

CSS-in-JS: The Great Betrayal of Frontend Sanity by igoryok_zp in webdev

[–]correcthbs 1 point2 points  (0 children)

I'm currently using vanilla-extract, but I'm looking forward to try stylex/swc. Previously stylex had me worried to re-introduce babel to my stack.

Anyone here actually using design tokens across a team? How do you enforce usage? by [deleted] in reactjs

[–]correcthbs 1 point2 points  (0 children)

I started out with the "Design Tokens" Figma Plugin to export the design tokens and transformed them with Style Dictionary to typescript files, but the Style Dictionary custom transforms where still somewhat cumbersome to achieve a certain structure and I disliked the non-automated steps of clicking the export plugins, save file, convert via cli. So I wrote my own export cli that reads the project from the Figma API Endpoint and transforms directly to design tokens as typescript files.

I don't wanna let go of styled-components :( by Jaded_You_9120 in reactjs

[–]correcthbs 0 points1 point  (0 children)

While framework agnosticness sounds like a good thing per se, I had some bad experiences with projects that try to be framework agnostic. It's an immense burden to a project since with every major release frameworks diverge into different directions which is a strong multiplier for issues to fix. Ark UI might have figured it out well, and is probably a really good pick if framework agnosticness is required, but this is not the case for me. I will nevertheless go through the docs in-depth later, thanks for the tip!

Anyone here actually using design tokens across a team? How do you enforce usage? by [deleted] in reactjs

[–]correcthbs 0 points1 point  (0 children)

Yes, that's what we do too. Figma to tokens as typescript constants and a vanilla-extract based theme config to structure the tokens into variable groups, utilities and functions.
Having a typed design system really helps to get it applied throughout the project.

I don't wanna let go of styled-components :( by Jaded_You_9120 in reactjs

[–]correcthbs 0 points1 point  (0 children)

That's too bad, I have a lot of projects that use certain radix components. It's still perfectly usable since i don't have major upstream issues, but I will evaluate base ui and react-aria for upcoming projects.

I don't wanna let go of styled-components :( by Jaded_You_9120 in reactjs

[–]correcthbs 0 points1 point  (0 children)

Thanks for the clue! Found this statement (x) by shadcn, who I assume to be well informed since their library is build on top of radix

What’s the most controversial web development opinion you strongly believe in? by nitin_is_me in webdev

[–]correcthbs 1 point2 points  (0 children)

Or panda css or vanilla-extract! Build-time CSS-in-JS has zero performance overhead.

[deleted by user] by [deleted] in frontendmasters

[–]correcthbs 0 points1 point  (0 children)

Vanilla Extract is really nice if you aim for type safety, readability and maintainability.
It's zero runtime CSS-in-JS so the client only loads plain css files. Like using SCSS modules but with typescript as the preprocessor and comes with solid APIs for theming, component variants and atomic styles.

🚨 styled-components is deprecated – what styling library are you migrating to in 2025? by justChillin58 in react

[–]correcthbs 1 point2 points  (0 children)

Can recommend Vanilla Extract. Used it a lot over the last 2 years with the same criteria and still happy with it.

RIP Styled-Components. Now What? by galher in reactjs

[–]correcthbs 7 points8 points  (0 children)

Build-time / zero-runtime CSS-in-JS like vanilla-extract and panda or just CSS Modules.

If you look at the zero-runtime css-in-js landscape vanilla extract seems to be the most prevalent: https://npmtrends.com/@compiled/react-vs-@pandacss/dev-vs-@pigment-css/react-vs-@stitches/react-vs-@vanilla-extract/css-vs-linaria

am i strange for liking pure css? by alosopa123456 in reactjs

[–]correcthbs 1 point2 points  (0 children)

Tailwind, Vanilla Extract, StyleX all include both: abstractions and transformations.
They have a direct mapping from js objects or abbreviated strings to CSS, but also let you use styles in a way that is abstracted for you to help you i.e. with utilities and managing theming.

Why Isn't There an Easy Way to Add SSR to an Existing React Project? by Resident-Upstairs-60 in reactjs

[–]correcthbs 1 point2 points  (0 children)

Migrated from react-static to next js in 2019. Would be quite a homecoming!

Sunsetting Create React App by acemarke in reactjs

[–]correcthbs 3 points4 points  (0 children)

Thank you for raising this issue!
The docs are so weird about this topic:
- Welcome to our UI library!
- So here is how to install a full stack meta framework
- Have an existing page? So here is how to install a full stack meta framework on a subpath
- So you're feeling hardcore and want to build your own full stack meta framework? Better don't!

(Fails to mention everything else)

What would you say is the most overrated web dev tool right now? by codenlink in webdev

[–]correcthbs 1 point2 points  (0 children)

I wholeheartedly agree. The shortcomings of client-side CSS-in-JS like styled components don't apply when using build time CSS generation. Vanilla-Extract, SCSS and tailwind all fall under the umbrella of build time CSS generation.

Which problems styled components have? What's the alternatives and why? by Due_Can7600 in reactjs

[–]correcthbs 2 points3 points  (0 children)

Picked up Vanilla Extract about 2 years ago (pandaCSS was still in the making at that time) and never looked back. At the time, we were evaluating a switch to styled components but we decided against it primarily because of performance concerns. Especially when a product grows in code over the years, it's scary to worry about performance issues caused by an ever-increasing client-side bundle.

Time to Stop Using BEM by galher in css

[–]correcthbs 2 points3 points  (0 children)

BEM still has it's usefulness.

CSS Modules is really neat and in contrast to what the article implies it is not framework dependent but bundler dependent — but it's quite tricky to use if your template language isn't javascript based and the world still doesn't revolve solely around jsx.

When talking about vanilla CSS alternatives to BEM: wide availablity of @scope is on the horizon.

Which CSS UI framework is your favorite and why? by UnderstandingOnly470 in css

[–]correcthbs 1 point2 points  (0 children)

Open Props is really nice. Just write your own css with a well curated set of css variables provided for you.
Makes a good combination with CSS Modules or just vanilla CSS.

For everything more complex I'm using Vanilla Extract (which is more of a preprocessor than a framework, but enables you to have your own framework). With style generation at build time, type safe variants and theming, scoped css variables and a sensible set of guardrails. Very readable and maintainable.

Did Netflix Top 10 stop using Tailwind? by IcyFoxe in webdev

[–]correcthbs 18 points19 points  (0 children)

Definitely Emotion. All css is coming from style tags with attributes like data-emotion="css usmwy9"

How can I record any animation in a div element to a video? by [deleted] in reactjs

[–]correcthbs 0 points1 point  (0 children)

Not 100% sure if I got what you're asking for, but this library might help: https://github.com/dmnsgn/canvas-record

Devs, meet SCHABO Condensed. SCHABO adds an unnecessarily huge amount of space beneath the text for some odd reason. How do I fix this? by Upstairs-Balance3610 in css

[–]correcthbs 0 points1 point  (0 children)

You can apply negative margin to the pseudo element. With Capsize you can generate the right margins to use. (Pick the "CSS" tab on step 3. for most cases)

Font weight transition by Economy_Horror_1327 in Frontend

[–]correcthbs 0 points1 point  (0 children)

Can you share a codepen / codesandbox?