-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[examples] Add pigment-css-nextjs-ts starter project #41105
Conversation
…-runtime-starter
…-runtime-starter
…-runtime-starter
Netlify deploy previewhttps://deploy-preview-41105--material-ui.netlify.app/ Bundle size report |
/> | ||
<Bubble | ||
className={css` | ||
${generateBubbleVars()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an FYI, These variables will be random during the build time. In the browser, it'll still be static.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's the intention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's worth mentioning this behavior between emotion/zero-runtime:
{[…Array(10)].map((_, index) => (
<Bubble
key={index}
className={css`
${generateBubbleVars()}
`
/>
)}
Zero-runtime: generate just one set of variables (all instances will have the same styles).
Emotion: generate 10 random set of styles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zero-runtime: generate just one set of variables that'll only change when you rebuild the app. And for each build, it'll not change with page refresh.
Emotion: generate 10 random set of styles that'll also change with each page refresh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@siriwatknp overall it looks good. Let's wait for the first alpha release of the zero-runtime, and do a final review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few writing tweaks so we're consistent with how we refer to "zero-runtime"! I'm not being able to run the example, though, I see this error after running it with either npm or pnpm (and I've also tried running pnpm install
on the whole repo before, but nothing...):
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@mui%2fzero-next-plugin - Not found
npm ERR! 404
npm ERR! 404 '@mui/zero-next-plugin@latest' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git URL.
It's because we haven't released |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got this error while building
Creating an optimized production build ...
⨯ Failed to find font override values for font `Kalnia`
⨯ Failed to find font override values for font `Kalnia`
✓ Compiled successfully
Linting and checking validity of types ..Failed to compile.
./src/app/page.tsx:164:13
Type error: No overload matches this call.
Overload 2 of 2, '(arg: TemplateStringsArray, ...templateArgs: (Primitve | CssFn)[]): string', gave the following error.
Object literal may only specify known properties, and 'letterSpacing' does not exist in type 'TemplateStringsArray'.
162 | ${josefin.className}
163 | ${css({
> 164 | letterSpacing: "2px",
| ^
165 | fontSize: "clamp(0.75rem, 0.5885rem + 0.6891vw, 1.25rem)",
166 | textTransform: "uppercase",
167 | fontWeight: 500,
Co-authored-by: Danilo Leal <[email protected]> Signed-off-by: Siriwat K <[email protected]>
…-runtime-starter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the other PR should we use pigment-css instead of zero?
We'll need to wait the package to be published to review these examples, right? |
Yes. This PR can be merged after the release. |
Tested. It works. curl https://codeload.github.com/siriwatknp/material-ui/tar.gz/zero-runtime-starter | tar -xz --strip=2 material-ui-zero-runtime-starter/examples/pigment-css-nextjs-ts
cd pigment-css-nextjs-ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay
The starter project demonstrates the usage of
css
,keyframes
andstyled
APIs.Support dark mode via
prefers-color-scheme
media query (built-in support).Screen.Recording.2567-03-08.at.13.13.48.mov