Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: add responsive styles for workspace card #2390

Merged
merged 1 commit into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/component/src/components/workspace-card/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export const StyledCard = styled('div')<{
pointerEvents: 'auto',
},
},
'@media (max-width: 720px)': {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can still use something like [breakpoints.down('sm', true)]

width: '100%',
},
};
});

Expand Down
9 changes: 9 additions & 0 deletions packages/component/src/components/workspace-list/index.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { style } from '@vanilla-extract/css';

export const workspaceItemStyle = style({
'@media': {
'screen and (max-width: 720px)': {
width: '100%',
},
},
});
2 changes: 2 additions & 0 deletions packages/component/src/components/workspace-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { SortableContext, useSortable } from '@dnd-kit/sortable';
import type { FC } from 'react';

import { WorkspaceCard } from '../workspace-card';
import { workspaceItemStyle } from './index.css';

export type WorkspaceListProps = {
disabled?: boolean;
Expand Down Expand Up @@ -42,6 +43,7 @@ const SortableWorkspaceItem: FC<
};
return (
<div
className={workspaceItemStyle}
data-testid="draggable-item"
style={style}
ref={setNodeRef}
Expand Down