File tree 7 files changed +50
-38
lines changed
7 files changed +50
-38
lines changed Original file line number Diff line number Diff line change 5
5
"scripts" : {
6
6
"dev" : " astro dev" ,
7
7
"start" : " astro dev" ,
8
- "build" : " astro check && astro build"
8
+ "build" : " astro check && astro build" ,
9
+ "build:package" : " minify && copy components public scss package.json --outDir=dist"
9
10
},
10
11
"dependencies" : {
11
12
"@astrojs/check" : " 0.7.0" ,
14
15
"sass" : " 1.77.5" ,
15
16
"svelte" : " 4.2.18" ,
16
17
"typescript" : " 5.4.5"
18
+ },
19
+ "exports" : {
20
+ "./astro" : " ./astro.js" ,
21
+ "./styles" : " ./scss/index.scss" ,
22
+ "./config" : " ./scss/config.scss"
17
23
}
18
24
}
Original file line number Diff line number Diff line change
1
+ declare module 'webcoreui/astro' {
2
+ import type { Props as AccordionProps } from './components/Accordion/Accordion.astro'
3
+
4
+ export function Accordion ( _props : AccordionProps ) : any
5
+ }
Original file line number Diff line number Diff line change
1
+ import Accordion from './components/Accordion/Accordion.astro'
2
+
3
+ export const Accordion = Accordion
Original file line number Diff line number Diff line change 1
1
---
2
- interface Props {
2
+ export interface Props {
3
3
items: {
4
4
title: string
5
5
content: string
Original file line number Diff line number Diff line change 1
1
---
2
- import Button from ' @components/Button/Button.astro'
3
- import Card from ' @components/Card/Card.astro'
4
- import Accordion from ' @components/Accordion/Accordion.astro'
2
+ import AstroAccordion from ' @components/Accordion/Accordion.astro'
3
+
4
+ const accordionItems = [{
5
+ title: ' Do you offer support?' ,
6
+ content: ' We provide 30 days of support.'
7
+ }, {
8
+ title: ' Can I request customizations?' ,
9
+ content: ' Yes!'
10
+ }, {
11
+ title: ' Are there any refunds?' ,
12
+ content: ' Hopefully.'
13
+ }]
5
14
---
6
15
7
16
<!DOCTYPE html >
@@ -18,18 +27,7 @@ import Accordion from '@components/Accordion/Accordion.astro'
18
27
<img src =" /img/logo.png" alt =" Logo" />
19
28
</a >
20
29
<h1 >Accordion</h1 >
21
- <Accordion
22
- items ={ [{
23
- title: ' Do you offer support?' ,
24
- content: ' We provide 30 days of support.'
25
- }, {
26
- title: ' Can I request customizations?' ,
27
- content: ' Yes!'
28
- }, {
29
- title: ' Are there any refunds?' ,
30
- content: ' Hopefully.'
31
- }]}
32
- />
30
+ <AstroAccordion items ={ accordionItems } />
33
31
</div >
34
32
</body >
35
33
</html >
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import Accordion from '@components/Accordion/Accordion.astro'
23
23
</h1 >
24
24
<h2 >
25
25
Rocket launch your frontend projects with fully coded components. <br />
26
- Customizable. Lightweight . Accessible.
26
+ Configurable. Themeable . Accessible.
27
27
</h2 >
28
28
<div class =" cta" >
29
29
<Button
@@ -56,7 +56,10 @@ import Accordion from '@components/Accordion/Accordion.astro'
56
56
57
57
<style is:global lang =" scss" >
58
58
@import '../scss/index.scss';
59
- @include Setup();
59
+ @include Setup((
60
+ fontRegular: '/fonts/Inter-Regular.woff2',
61
+ fontBold: '/fonts/Inter-Bold.woff2'
62
+ ));
60
63
61
64
.container {
62
65
margin-top: 20px;
Original file line number Diff line number Diff line change 1
1
@mixin Resets () {
2
- @if (config (' includeFonts ' )) {
2
+ @if (config (' fontRegular ' )) {
3
3
@font-face {
4
4
font-family : Regular;
5
5
font-display : swap ;
6
- src : url (' /fonts/Inter-Regular.woff2 ' ) format (' woff2' );
6
+ src : url (#{ config ( ' fontRegular ' )} ) format (' woff2' );
7
7
}
8
-
8
+ }
9
+
10
+ @if (config (' fontBold' )) {
9
11
@font-face {
10
12
font-family : Bold ;
11
13
font-display : swap ;
12
- src : url (' /fonts/Inter-Bold.woff2 ' ) format (' woff2' );
14
+ src : url (#{ config ( ' fontBold ' )} ) format (' woff2' );
13
15
}
14
16
}
15
-
17
+
16
18
* {
17
19
box-sizing : border-box ;
18
20
}
22
24
color : #FFF ;
23
25
margin : 0 ;
24
26
font-size : 18px ;
25
-
26
- @if (config (' includeFonts' )) {
27
- font-family : Regular, sans-serif ;
28
- }
27
+ font-family : Regular, sans-serif ;
29
28
}
30
-
31
- @if (config (' includeFonts' )) {
32
- h1 ,
33
- h2 ,
34
- h3 ,
35
- h4 ,
36
- h5 ,
37
- h6 {
38
- font-family : Bold , sans-serif ;
39
- }
29
+
30
+ h1 ,
31
+ h2 ,
32
+ h3 ,
33
+ h4 ,
34
+ h5 ,
35
+ h6 {
36
+ font-family : Bold , sans-serif ;
40
37
}
41
38
42
39
a {
You can’t perform that action at this time.
0 commit comments