File tree 9 files changed +109
-11
lines changed
9 files changed +109
-11
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const {
12
12
element = ' section' ,
13
13
title,
14
14
titleTag = ' span' ,
15
- compact = true ,
15
+ compact,
16
16
className,
17
17
secondary,
18
18
... rest
@@ -37,7 +37,7 @@ const Title = titleTag
37
37
<Title class = " card-title" >{ title } </Title >
38
38
)}
39
39
<div class =" card-body" class:list ={ [compact && ' compact' ]} >
40
- { compact ? (
40
+ { compact && ! secondary ? (
41
41
<div class = " card-wrapper" ><slot /></div >
42
42
) : (
43
43
<slot />
Original file line number Diff line number Diff line change @@ -16,13 +16,13 @@ import { Button as ReactButton } from '@components/Button/Button.tsx'
16
16
</ComponentWrapper >
17
17
18
18
<ComponentWrapper type =" Svelte" >
19
- <SvelteButton theme =" alert" onClick = { () => console . log ( ' 👋 ' ) } client:load >
19
+ <SvelteButton theme =" alert" >
20
20
Button in Svelte
21
21
</SvelteButton >
22
22
</ComponentWrapper >
23
23
24
24
<ComponentWrapper type =" React" >
25
- <ReactButton theme =" info" onClick = { () => console . log ( ' 👋 ' ) } client:load >
25
+ <ReactButton theme =" info" >
26
26
Button in React
27
27
</ReactButton >
28
28
</ComponentWrapper >
Original file line number Diff line number Diff line change
1
+ ---
2
+ import Layout from ' @static/Layout.astro'
3
+
4
+ import AstroCard from ' @components/Card/Card.astro'
5
+ import SvelteButton from ' @components/Button/Button.svelte'
6
+ import { Button as ReactButton } from ' @components/Button/Button.tsx'
7
+ ---
8
+
9
+ <Layout >
10
+ <h1 >Card</h1 >
11
+
12
+ <div class =" grid md-2 lg-3" >
13
+ <AstroCard compact ={ true } >
14
+ Card component using <span class =" a" >Astro</span >
15
+ </AstroCard >
16
+
17
+ <AstroCard compact ={ true } >
18
+ Card component using <span class =" s" >Svelte</span >
19
+ </AstroCard >
20
+
21
+ <AstroCard compact ={ true } >
22
+ Card component using <span class =" r" >React</span >
23
+ </AstroCard >
24
+
25
+ <AstroCard title =" Titled card" compact ={ true } >
26
+ Card with title
27
+ </AstroCard >
28
+
29
+ <AstroCard title =" Spacious" >
30
+ Spacious card with title
31
+ </AstroCard >
32
+
33
+ <AstroCard >
34
+ Spacious card without title
35
+ </AstroCard >
36
+
37
+ <AstroCard title =" Secondary" secondary ={ true } >
38
+ Secondary card with title
39
+ </AstroCard >
40
+
41
+ <AstroCard secondary ={ true } >
42
+ Secondary card without title
43
+ </AstroCard >
44
+
45
+ <AstroCard title =" Bolded" titleTag =" strong" >
46
+ Card with bold title using <code >strong</code > tag.
47
+ </AstroCard >
48
+ </div >
49
+ </Layout >
50
+
51
+ <style lang =" scss" >
52
+ .a {
53
+ background: #B545ED;
54
+ background: linear-gradient(to right, #505FFF, #B545ED);
55
+ background-clip: text;
56
+ -webkit-background-clip: text;
57
+ -webkit-text-fill-color: transparent;
58
+ }
59
+
60
+ .s {
61
+ color: #FF3E00;
62
+ }
63
+
64
+ .r {
65
+ color: #61DAFB;
66
+ }
67
+ </style >
Original file line number Diff line number Diff line change 1
1
---
2
2
import Layout from ' @static/Layout.astro'
3
+ import CardWrapper from ' @static/CardWrapper.astro'
3
4
4
5
import Button from ' @components/Button/Button.astro'
5
- import Card from ' @components/Card/Card.astro'
6
6
import Accordion from ' @components/Accordion/Accordion.astro'
7
7
---
8
8
@@ -27,7 +27,7 @@ import Accordion from '@components/Accordion/Accordion.astro'
27
27
</Button >
28
28
</div >
29
29
<div class =" grid md-2 lg-3" >
30
- <Card title =" Accordion" element = " a " href =" /accordion" >
30
+ <CardWrapper title =" Accordion" href =" /accordion" >
31
31
<Accordion
32
32
items ={ [{
33
33
title: ' Do you offer support?' ,
@@ -40,11 +40,14 @@ import Accordion from '@components/Accordion/Accordion.astro'
40
40
content: ' Hopefully.'
41
41
}]}
42
42
/>
43
- </Card >
44
- <Card title =" Button" element = " a " href =" /button" >
43
+ </CardWrapper >
44
+ <CardWrapper title =" Button" href =" /button" >
45
45
<Button >Primary</Button >
46
46
<Button theme =" secondary" >Secondary</Button >
47
- </Card >
47
+ </CardWrapper >
48
+ <CardWrapper title =" Card" href =" /card" >
49
+ <p >Paragraph inside a card</p >
50
+ </CardWrapper >
48
51
</div >
49
52
</Layout >
50
53
Original file line number Diff line number Diff line change
1
+ @import ' ./global/elements.scss' ;
1
2
@import ' ./global/utility.scss' ;
Original file line number Diff line number Diff line change
1
+ @import ' ../config' ;
2
+
3
+ @mixin Elements () {
4
+ code {
5
+ display : inline-block ;
6
+ padding : 2px 10px ;
7
+ border-radius : 5px ;
8
+ border : 1px solid #252525 ;
9
+ font-size : 14px ;
10
+ }
11
+ }
Original file line number Diff line number Diff line change 2
2
3
3
$config : (
4
4
includeResets : true,
5
- includeHelperClasses : true
5
+ includeHelperClasses : true,
6
+ includeElementStyles : true
6
7
);
7
8
8
9
@function config ($key ) {
@@ -19,4 +20,8 @@ $config: (
19
20
@if (config (' includeHelperClasses' )) {
20
21
@include Utility ();
21
22
}
23
+
24
+ @if (config (' includeElementStyles' )) {
25
+ @include Elements ();
26
+ }
22
27
}
Original file line number Diff line number Diff line change
1
+ ---
2
+ import Card from ' @components/Card/Card.astro'
3
+
4
+ const {
5
+ title,
6
+ href
7
+ } = Astro .props
8
+ ---
9
+
10
+ <Card title ={ title } element =" a" href ={ href } compact ={ true } >
11
+ <slot />
12
+ </Card >
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ const {
11
11
title ={ title || type }
12
12
className ={ type && type .slice (0 , 1 ).toLocaleLowerCase ()}
13
13
titleTag =" strong"
14
- compact ={ false }
15
14
>
16
15
<slot />
17
16
</Card >
You can’t perform that action at this time.
0 commit comments