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

Remove card shadows from smaller breakpoints #12877

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Germanika
Copy link
Contributor

@Germanika Germanika commented Nov 6, 2024

WHY are these changes introduced?

Fixes #11968

Re-implementation of #11926

WHAT is this pull request doing?

Removes Card and LegacyCard default bevel styles below the sm breakpoint. Essentially if card corners aren’t rounded then shadow styles are removed as well.

Currently the Card component toggles border-radius at certain breakpoints with the roundedAbove prop (and defaults to the sm breakpoint). This PR also adds box-shadow to these toggled styles.

This is also removing the reliance on useBreakpoints() in the Card component. Currently the borderRadius does not apply on an initial SSR render because useBreakpoints relies on the client-side render to determine the browser size. So we default to the mobile style with square corners (and no shadow/bevel) on initial SSR before getting the rounded corners on client-side render.

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

🎩 checklist

@Germanika Germanika force-pushed the remove-use-breakpoints-use-in-cards branch from feba02c to 6fee7aa Compare November 8, 2024 20:57
@Germanika Germanika force-pushed the remove-use-breakpoints-use-in-cards branch from 6fee7aa to b0702da Compare November 8, 2024 21:22
@Germanika
Copy link
Contributor Author

/snapit

Copy link
Contributor

🫰✨ Thanks @Germanika! Your snapshot has been published to npm.

Test the snapshot by updating your package.json with the newly published version:

"@shopify/polaris": "0.0.0-snapshot-20241112004800"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Card][LegacyCard] Box shadow incorrectly visible on sm breakpoint
1 participant