Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[blog] Introducing Pigment CSS blog post #42198

Merged
merged 36 commits into from May 15, 2024

Conversation

samuelsycamore
Copy link
Member

@samuelsycamore samuelsycamore commented May 10, 2024

Broad, high-level introduction to the hows and whys of Pigment CSS, to coincide with Olivier's talk at React Conf.

⚠️ Need to publish by Wednesday, May 15th! ⚠️

Preview: https://deploy-preview-42198--material-ui.netlify.app/blog/introducing-pigment-css/

@samuelsycamore samuelsycamore added blog package: pigment-css Specific to @pigment-css/* labels May 10, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 10, 2024
@mui-bot
Copy link

mui-bot commented May 10, 2024

Netlify deploy preview

https://deploy-preview-42198--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 9a9e884

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label May 10, 2024
@samuelsycamore samuelsycamore marked this pull request as ready for review May 13, 2024 20:47
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great Sam!

docs/pages/blog/introducing-pigment-css.md Outdated Show resolved Hide resolved
docs/pages/blog/introducing-pigment-css.md Outdated Show resolved Hide resolved
docs/pages/blog/introducing-pigment-css.md Outdated Show resolved Hide resolved
docs/pages/blog/introducing-pigment-css.md Outdated Show resolved Hide resolved
docs/pages/blog/introducing-pigment-css.md Outdated Show resolved Hide resolved
docs/pages/blog/introducing-pigment-css.md Outdated Show resolved Hide resolved
docs/pages/blog/introducing-pigment-css.md Outdated Show resolved Hide resolved
samuelsycamore and others added 4 commits May 14, 2024 08:17
Co-authored-by: Brijesh Bittu <brijeshb42@gmail.com>
Co-authored-by: Marija Najdova <mnajdova@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Signed-off-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
@brijeshb42
Copy link
Contributor

The Netlify preview doesn't seem to exist.

@mnajdova
Copy link
Member

@brijeshb42 the link works as expected to me now: https://deploy-preview-42198--material-ui.netlify.app/blog/introducing-pigment-css/

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Let me know when we need to publish it :)

Copy link
Contributor

@danilo-leal danilo-leal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉🎉🎉

@danilo-leal danilo-leal merged commit f3be912 into mui:next May 15, 2024
19 checks passed
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A first review pass. Nice to see this blog post! Great start

@brijeshb42 and @siriwatknp could we also get a review? Thanks

docs/lib/sourcing.ts Show resolved Hide resolved
docs/pages/blog/introducing-pigment-css.md Show resolved Hide resolved
docs/pages/blog/introducing-pigment-css.md Show resolved Hide resolved
docs/pages/blog/introducing-pigment-css.md Show resolved Hide resolved

For users of Emotion and styled-components, the benefits of adopting Pigment CSS are clear: your end users get better performance, and you get RSC and App Router compatibility without having to significantly change how you author component styles.

### Better performance
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm lost by this section.

These seem to be load time performance, which I believe is not the same as runtime performance. So I would start with:

Suggested change
### Better performance
### Better page load performance

and then add a new header for render performance specifically.

docs/pages/blog/introducing-pigment-css.md Show resolved Hide resolved
### Other options don't meet our needs

For those of us who are perfectly happy with the patterns we know and love from CSS-in-JS, it feels frustrating to consider abandoning all that muscle memory just to reinvent the wheel yet again.
We like the DX of colocated styles, and we'd rather not bloat the DOM with atomic class names—so Tailwind CSS, StyleX, Panda CSS, and other solutions that have cropped up in recent months just don't match up with our preferences.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't feel accurate. I have reworked this part in https://react-conf-2024-pigment-css.netlify.app/?presenterMode=true&slideIndex=29&stepIndex=0. The first point is that Atomic for production, sure, if it helps with performance, great. The issue with atomic classes is only in development mode IMHO. I have doubt that https://twitter.com/astahmer_dev/status/1776919737999425629 can truly help here.

My point is that "Other options don't meet our needs", yes, but a big part of this is that we also see an opportunity with a deeper bundle integration, that we don't see any other library trying. Mostly because it's a lot of work, but hopefully: 1. we have the resources to make it work, and 2. React Compiler is paving the way

Two examples of projects not trying/giving up on this direction:

docs/pages/blog/introducing-pigment-css.md Show resolved Hide resolved
docs/pages/blog/introducing-pigment-css.md Show resolved Hide resolved
docs/pages/blog/introducing-pigment-css.md Show resolved Hide resolved
@brijeshb42 brijeshb42 added the needs cherry-pick The PR should be cherry-picked to master after merge label May 16, 2024
brijeshb42 added a commit to brijeshb42/material-ui that referenced this pull request May 16, 2024
Signed-off-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
Co-authored-by: Lukas <llukas.tyla@gmail.com>
Co-authored-by: Brijesh Bittu <brijeshb42@gmail.com>
Co-authored-by: Marija Najdova <mnajdova@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
brijeshb42 added a commit to brijeshb42/material-ui that referenced this pull request May 16, 2024
Signed-off-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
Co-authored-by: Lukas <llukas.tyla@gmail.com>
Co-authored-by: Brijesh Bittu <brijeshb42@gmail.com>
Co-authored-by: Marija Najdova <mnajdova@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
brijeshb42 added a commit that referenced this pull request May 16, 2024
Signed-off-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
Co-authored-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
Co-authored-by: Lukas <llukas.tyla@gmail.com>
Co-authored-by: Marija Najdova <mnajdova@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blog needs cherry-pick The PR should be cherry-picked to master after merge package: pigment-css Specific to @pigment-css/*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants