Skip to content
Closed
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
18 changes: 16 additions & 2 deletions src/components/MDXComponents/DocHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@ export function DocHomeCardContainer(props: any) {
sm: "grid",
},
flexDirection: "column",
gridTemplateColumns: "repeat(auto-fit, minmax(224px, 30%))",
gridTemplateColumns: {
sm: "repeat(2, minmax(0, 1fr))",
md: "repeat(3, minmax(0, 1fr))",
},
gap: "1.25rem",
justifyContent: "start",

Expand All @@ -363,6 +366,7 @@ interface DocHomeCardProps {
icon: string;
label: string;
colSpan?: 1 | 2 | 3;
colspan?: 1 | 2 | 3;
actionBtnLabel?: string;
ctaGraphic?: string;
}
Expand All @@ -374,9 +378,11 @@ export function DocHomeCard(props: React.PropsWithChildren<DocHomeCardProps>) {
icon = "global-tidb-product",
label,
colSpan,
colspan,
actionBtnLabel,
ctaGraphic,
} = props;
const cardColSpan = colSpan ?? colspan;

return (
<Box
Expand All @@ -386,12 +392,20 @@ export function DocHomeCard(props: React.PropsWithChildren<DocHomeCardProps>) {
referrerPolicy="no-referrer-when-downgrade"
href={href}
sx={(theme) => ({
display: "block",
boxSizing: "border-box",
height: "100%",
position: "relative",
zIndex: 0,
padding: "24px",
transition: ".5s",
border: `1px solid ${theme.palette.carbon[400]}`,
gridColumn: colSpan ? `span ${colSpan}` : undefined,
gridColumn: cardColSpan
? {
sm: `span ${Math.min(cardColSpan, 2)}`,
md: `span ${cardColSpan}`,
}
: undefined,

"&:hover": {
background:
Expand Down