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

<Card /> Component rounded corners during SSR not working. #12961

Open
muchisx opened this issue Dec 2, 2024 · 1 comment
Open

<Card /> Component rounded corners during SSR not working. #12961

muchisx opened this issue Dec 2, 2024 · 1 comment
Labels
Bug Something is broken and not working as intended in the system. untriaged

Comments

@muchisx
Copy link

muchisx commented Dec 2, 2024

Summary

Hi,

I noticed that the rounded corners are resolved like this:

const breakpoints = useBreakpoints();
const defaultBorderRadius: BorderRadiusAliasOrScale = '300';
const hasBorderRadius = Boolean(breakpoints[`${roundedAbove}Up`]);
return (
<WithinContentContext.Provider value>
<ShadowBevel
boxShadow="100"
borderRadius={hasBorderRadius ? defaultBorderRadius : '0'}

This poses a problem for people that always want rounded corners as the default is always 0 during SSR

During SSR, namely Remix, breakpoints are not available, thus yieldien a false value for

const hasBorderRadius = Boolean(breakpoints[`${roundedAbove}Up`]); 

Can we have a way to set rounded corners via non-browser-dependant props so during SSR it doesn't look all square before hydration?

Expected behavior

I should be able to define the rounded corners from in an SSR way

Actual behavior

It always looks like this 1-2s.. while is hydrating

Image

Steps to reproduce

tried to set up remix on codesanbox but couldn't set node version necessary for this version of polaris...

Are you using React components?

Yes

Polaris version number

13.9.1

Browser

Chrome

Device

Windows 11 PC

@muchisx muchisx added Bug Something is broken and not working as intended in the system. untriaged labels Dec 2, 2024
@omarcv07
Copy link

omarcv07 commented Dec 2, 2024

I have the same issue, is this going to be resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken and not working as intended in the system. untriaged
Projects
None yet
Development

No branches or pull requests

2 participants