Skip to content

Commit 2e198a3

Browse files
authored
fix(accordion): arrow alignment (#571)
fix: arrow alignment
1 parent 3ed719a commit 2e198a3

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

source/_patterns/02-components/accordion/_accordion.variables.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@import "../../00-base/icons/icons.variables";
33
@import "../../00-base/icons/icons.helpers";
44

5-
$accordion---paddingLeft: 46 !default;
5+
$accordion---paddingLeft: $db-spacing-m !default;
66
$accordion---paddingRight: to-rem(
77
$pxValue: 16
88
) !default;

source/_patterns/02-components/accordion/accordion.scss

+15-8
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,16 @@
88
padding-right: $accordion---paddingRight;
99

1010
summary {
11-
@include icon(glyph(chevron-right), 24, "outline", $partial: $partial);
11+
@include icon(
12+
glyph(expand-more),
13+
24,
14+
"outline",
15+
"after",
16+
$partial: $partial
17+
);
1218
align-items: center;
1319
display: flex;
20+
justify-content: space-between;
1421

1522
padding-block: $db-spacing-sm;
1623
// Negating the padding left for moving the element into that direction with the same measures
@@ -29,9 +36,9 @@
2936
}
3037

3138
// Icon horizontal space
32-
&::before {
33-
--icon-margin-after: #{to-rem($pxValue: 8)};
34-
margin-left: #{to-rem($pxValue: 14)};
39+
&::after {
40+
--icon-margin-before: #{to-rem($pxValue: 8)};
41+
margin-right: #{to-rem($pxValue: 14)};
3542
}
3643

3744
& + p {
@@ -40,7 +47,7 @@
4047
}
4148
// TODO: This might get simplified in the future with @nest
4249
&[open] > summary {
43-
&::before {
50+
&::after {
4451
content: glyph(expand-less);
4552
}
4653
}
@@ -56,7 +63,7 @@
5663
font-weight: 700;
5764
height: to-rem($pxValue: 56);
5865

59-
&::before {
66+
&::after {
6067
--icon-font-size: #{to-rem($pxValue: 32)};
6168
}
6269
}
@@ -78,7 +85,7 @@
7885
// ToDo: This needs to get replaced by the correct variable
7986
padding-block: 0.59375rem;
8087

81-
&::before {
88+
&::after {
8289
--icon-font-size: #{to-rem($pxValue: 20)};
8390
--icon-margin-after: #{to-rem($pxValue: 6)};
8491
margin-left: #{to-rem($pxValue: 6)};
@@ -96,7 +103,7 @@
96103
font-size: to-rem($pxValue: 20);
97104
padding-block: $db-spacing-m;
98105

99-
&::before {
106+
&::after {
100107
--icon-font-size: #{to-rem($pxValue: 32)};
101108
}
102109
}

0 commit comments

Comments
 (0)