Skip to content

Commit

Permalink
Update Card and LegacyCard mobile styles
Browse files Browse the repository at this point in the history
  • Loading branch information
lgriffee committed Apr 23, 2024
1 parent a83084b commit 41e2eb1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
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

0 comments on commit 41e2eb1

Please sign in to comment.