Skip to content

Commit bd94150

Browse files
author
Naomi Trevino
committed
update card styling
1 parent 1c82abb commit bd94150

2 files changed

Lines changed: 57 additions & 18 deletions

File tree

website/src/components/card.css.ts

Lines changed: 55 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,66 @@
11
import { style } from "@vanilla-extract/css"
2+
import { borderWidth } from "polished"
3+
import { fonts, hsize, mediaQueries, radii, space, thickness, vspace } from "src/style/constants"
4+
import { media, onHover } from "src/style/utils"
25

36
export const card = style({
47
width: "100%",
58
borderWidth: "1px",
69
borderStyle: "solid",
710
borderColor: "black",
8-
borderRadius: "1em",
9-
display: "flex",
11+
borderRadius: radii.medium,
12+
display: "grid",
13+
gridTemplateColumns: "fit-content(20%) minmax(50px,5fr)",
14+
gridTemplateRows: "fit-content(100%) fit-content(100%)",
15+
columnGap: space.medium,
1016
})
1117

12-
export const cardImage = style({
13-
width: "25%",
14-
borderBottomLeftRadius: "inherit",
15-
borderTopLeftRadius: "inherit",
16-
margin: "0px",
17-
})
18-
19-
export const cardHeader = style({})
18+
export const cardImage = style([
19+
{
20+
width: "100%",
21+
borderTopLeftRadius: "inherit",
22+
margin: "inherit",
23+
borderBottomLeftRadius: radii.none,
24+
gridRowStart: "1",
25+
gridColumnStart: "1",
26+
gridRowEnd: "span 1",
27+
gridColumnEnd: "span 1",
28+
},
29+
media(mediaQueries.medium, {
30+
borderBottomLeftRadius: "inherit",
31+
gridRowEnd: "span 2",
32+
})
33+
])
2034

21-
export const cardText = style({
22-
marginLeft: "2em",
23-
marginTop: "2em",
24-
marginRight: "1em",
35+
export const cardHeader = style({
36+
margin: "inherit",
37+
gridRowStart: "1",
38+
gridColumnStart: "2",
39+
gridRowEnd: "span 1",
40+
gridColumnEnd: "span 1",
41+
placeSelf: "center stretch",
42+
padding: space.small
2543
})
44+
45+
export const cardText = style([
46+
{
47+
margin: "inherit",
48+
gridRowStart: "2",
49+
gridColumnStart: "1",
50+
gridRowEnd: "span 1",
51+
gridColumnEnd: "span 2",
52+
placeSelf: "center stretch",
53+
fontFamily: fonts.header,
54+
borderTopWidth: thickness.thin,
55+
padding: space.small
56+
},
57+
media(mediaQueries.medium, {
58+
gridRowStart: "2",
59+
gridColumnStart: "2",
60+
gridRowEnd: "span 1",
61+
gridColumnEnd: "span 1",
62+
placeSelf: "center stretch",
63+
borderTopWidth: thickness.none,
64+
})
65+
66+
])

website/src/components/card.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@ export const Card = (props: {
1212
return (
1313
<Group className={card}>
1414
<img src={props.thumbnail} className={cardImage} />
15-
<div className={cardText}>
16-
<h2>
15+
<h2 className={cardHeader}>
1716
{props.header.link ? (
1817
<Link href={props.header.link}>{props.header.text}</Link>
1918
) : (
2019
props.header.text
2120
)}
2221
</h2>
23-
<p>{props.description}</p>
24-
</div>
22+
<p className={cardText}>{props.description}</p>
2523
</Group>
2624
)
2725
}

0 commit comments

Comments
 (0)