Skip to content

Commit d9cd688

Browse files
author
Adithya Thejas
committed
token
1 parent aa1054d commit d9cd688

File tree

5 files changed

+53
-17
lines changed

5 files changed

+53
-17
lines changed

component/Accordion/Accordion.module.scss

+15-15
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@
1212

1313
@keyframes accordion-down {
1414
from {
15-
height: 0;
15+
height: $accordian-height-up;
1616
}
1717
to {
18-
height: 67px;
18+
height: $accordian-height-down;
1919
}
2020
}
2121

2222
@keyframes accordion-up {
2323
from {
24-
height: 67px;
24+
height: $accordian-height-down;
2525
}
2626
to {
27-
height: 0;
27+
height: $accordian-height-up;
2828
}
2929
}
3030

3131
.accordian-primitive {
32-
border-bottom-width: 1px;
32+
border-bottom-width: $accordian-width-primary;
3333
color: $accordian-text-primary;
3434
}
3535
.accordion-primitive-trigger {
@@ -39,17 +39,17 @@
3939
background-image: none;
4040
display: flex;
4141
flex: 1 1 0%;
42-
padding-top: 1rem;
43-
padding-bottom: 1.2rem;
44-
font-size: 16px;
45-
font-weight: 500;
42+
padding-top: $accordian-padding-primary;
43+
padding-bottom: $accordian-padding-secondary;
44+
font-size: $accordian-font-primary;
45+
font-weight: $accordian-font-danger;
4646
justify-content: space-between;
4747
align-items: center;
4848
border-top: none;
4949
border-left: none;
5050
border-right: none;
5151
border-bottom-color: $accordian-border; // rgb(226, 232, 240)
52-
border-bottom-width: 1px;
52+
border-bottom-width: $accordian-width-primary;
5353
border-image-width: 1;
5454
color: $accordian-text; // #0F172A // #E1E7EF
5555

@@ -62,16 +62,16 @@
6262
}
6363
}
6464
.chevron-down {
65-
width: 1rem;
66-
height: 1rem;
65+
width: $accordian-width-secondary;
66+
height: $accordian-height-primary;
6767
transition-property: transform;
6868
transition-duration: 200ms;
6969
color: $accordian-text;
7070
}
7171

7272
.space {
7373
padding-top: 0;
74-
padding-bottom: 1rem;
74+
padding-bottom: $accordian-padding-primary;
7575
}
7676

7777
.header {
@@ -81,9 +81,9 @@
8181
.accordion-primitive-content {
8282
overflow: hidden;
8383
transition-property: all;
84-
font-size: 14px;
84+
font-size: $accordian-font-secondary;
8585
line-height: 1.25rem;
86-
font-weight: 100;
86+
font-weight: $accordian-fontweight-primary;
8787

8888
&[data-state="closed"] {
8989
@include animate-accordion-up;

next.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,12 @@ module.exports = {
1414
prependData: `@import "colors.scss";`,
1515
},
1616
};
17+
18+
// const paths = require("path");
19+
20+
// module.exports = {
21+
// sassOptions: {
22+
// includePaths: [paths.join(__dirname, "styles")],
23+
// prependData: `@import "spacing.scss";`,
24+
// },
25+
// };

pages/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default function Home() {
4747

4848
{/* <Input type={"email"} placeholder={"Email"} />
4949
<br></br> */}
50-
{/* <AccordionDemo /> */}
50+
<AccordionDemo />
5151
{/* <SelectDemo /> */}
5252
{/* <CheckboxDemo /> */}
5353
{/* <ContextMenuDemo /> */}
@@ -61,7 +61,7 @@ export default function Home() {
6161
{/* <NavigationMenuDemo /> */}
6262
{/* <ToggleDemo /> */}
6363
{/* <ToastDemo /> */}
64-
<PopoverDemo />
64+
{/* <PopoverDemo /> */}
6565
</>
6666
);
6767
}

styles/colors.scss

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import "./spacing.scss";
2+
13
@function color($color-name) {
24
@return var(--color-#{$color-name});
35
}

styles/spacing.scss

+25
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,41 @@
1+
@function space($space-name) {
2+
@return var(--space-#{$space-name});
3+
}
4+
5+
$accordian-height-up: space(height-0);
6+
$accordian-height-down: space(spacing-850);
7+
$accordian-width-primary: space(spacing-1);
8+
$accordian-width-secondary: space(space-rem-1);
9+
$accordian-height-primary: space(space-rem-1);
10+
$accordian-padding-primary: space(space-rem-1);
11+
$accordian-padding-secondary: space(space-rem-1A);
12+
$accordian-font-primary: space(spacing-300);
13+
$accordian-font-secondary: space(spacing-250);
14+
$accordian-font-danger: space(weight-500);
15+
$accordian-fontweight-primary: space(weight-100);
16+
117
$map-space: (
18+
spacing-1: 1px,
219
spacing-50: 2px,
320
spacing-75: 4px,
421
spacing-100: 8px,
522
spacing-200: 12px,
23+
spacing-250: 14px,
624
spacing-300: 16px,
725
spacing-400: 24px,
826
spacing-500: 32px,
927
spacing-600: 40px,
1028
spacing-700: 48px,
1129
spacing-800: 64px,
30+
spacing-850: 67px,
1231
spacing-900: 80px,
1332
spacing-1000: 96px,
33+
height-0: 0,
34+
space-rem-1: 1rem,
35+
space-rem-1A: 1.2rem,
36+
space-rem-2: 2rem,
37+
weight-100: 100,
38+
weight-500: 500,
1439
);
1540

1641
@mixin apply-space-map($map) {

0 commit comments

Comments
 (0)