File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const {
11
11
titleTag = ' span' ,
12
12
compact,
13
13
className,
14
+ bodyClassName,
14
15
secondary,
15
16
... rest
16
17
} = Astro .props
@@ -19,7 +20,13 @@ const classes = [
19
20
styles .card ,
20
21
secondary && styles .secondary ,
21
22
className
22
- ].filter (Boolean ).join (' ' )
23
+ ]
24
+
25
+ const bodyClasses = [
26
+ styles .body ,
27
+ compact && styles .compact ,
28
+ bodyClassName
29
+ ]
23
30
24
31
const Component = element
25
32
const Title = titleTag
@@ -29,7 +36,7 @@ const Title = titleTag
29
36
{ title && (
30
37
<Title class :list = { styles .title } >{ title } </Title >
31
38
)}
32
- <div class:list ={ [ styles . body , compact && styles . compact ] } >
39
+ <div class:list ={ bodyClasses } >
33
40
<slot />
34
41
</div >
35
42
</Component >
Original file line number Diff line number Diff line change 10
10
export let titleTag: CardProps [' titleTag' ] = ' span'
11
11
export let compact: CardProps [' compact' ] = false
12
12
export let className: CardProps [' className' ] = ' '
13
+ export let bodyClassName: CardProps [' bodyClassName' ] = ' '
13
14
export let secondary: CardProps [' secondary' ] = false
14
15
15
16
const classes = classNames ([
20
21
21
22
const bodyClasses = classNames ([
22
23
styles .body ,
23
- compact && styles .compact
24
+ compact && styles .compact ,
25
+ bodyClassName
24
26
])
25
27
</script >
26
28
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const Card = ({
11
11
TitleTag = 'span' ,
12
12
compact,
13
13
className,
14
+ bodyClassName,
14
15
secondary,
15
16
children,
16
17
...rest
@@ -23,7 +24,8 @@ const Card = ({
23
24
24
25
const bodyClasses = classNames ( [
25
26
styles . body ,
26
- compact && styles . compact
27
+ compact && styles . compact ,
28
+ bodyClassName
27
29
] )
28
30
29
31
return (
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ export type CardProps = {
4
4
titleTag ?: string
5
5
compact ?: boolean
6
6
className ?: string
7
+ bodyClassName ?: string
7
8
secondary ?: boolean
8
9
[ key : string ] : any
9
10
}
You can’t perform that action at this time.
0 commit comments