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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Card and LegacyCard mobile styles #11926

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/angry-avocados-scream.md
@@ -0,0 +1,5 @@
---
'@shopify/polaris': minor
---

Removed default `Card` and `LegacyCard` bevel styles below sm breakpoint
7 changes: 3 additions & 4 deletions polaris-react/src/components/Card/Card.tsx
@@ -1,7 +1,6 @@
import type {
BreakpointsAlias,
ColorBackgroundAlias,
BorderRadiusAliasOrScale,
SpaceScale,
} from '@shopify/polaris-tokens';
import React from 'react';
Expand Down Expand Up @@ -40,15 +39,15 @@ export const Card = ({
roundedAbove = 'sm',
}: CardProps) => {
const breakpoints = useBreakpoints();
const defaultBorderRadius: BorderRadiusAliasOrScale = '300';
const hasBorderRadius = Boolean(breakpoints[`${roundedAbove}Up`]);
const hasBevel = Boolean(breakpoints[`${roundedAbove}Up`]);

return (
<WithinContentContext.Provider value>
<ShadowBevel
boxShadow="100"
borderRadius={hasBorderRadius ? defaultBorderRadius : '0'}
borderRadius="300"
zIndex="32"
bevel={hasBevel}
>
<Box
background={background}
Expand Down
@@ -1,12 +1,8 @@
.LegacyCard {
background-color: var(--p-color-bg-surface);
box-shadow: var(--p-shadow-300);
outline: var(--p-border-width-025) solid transparent;
overflow: clip;

@mixin shadow-bevel var(--p-shadow-100), var(--p-border-radius-0), null, '',
101;

+ .LegacyCard {
margin-top: var(--p-space-400);

Expand All @@ -16,6 +12,7 @@
}

@media (--p-breakpoints-sm-up) {
box-shadow: var(--p-shadow-300);
border-radius: var(--p-border-radius-200);

@mixin shadow-bevel var(--p-shadow-100), var(--p-border-radius-300), null,
Expand Down