Skip to content

Commit b390420

Browse files
authored
fix: possibility to define two icons on an element again (#588)
1 parent 399d2e9 commit b390420

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

source/_patterns/00-base/icons/_icons.attributes-mappings.scss

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
@each $icon-name, $icon-glyph in $icon-glyphs {
55
[data-icon="#{$icon-name}"],
66
[data-icon-before="#{$icon-name}"] {
7-
&::before {
8-
--icon-glyph: "#{$icon-glyph}";
9-
}
7+
--icon-glyph-before: "#{$icon-glyph}";
108
}
11-
[data-icon-after="#{$icon-name}"]::after {
12-
--icon-glyph: "#{$icon-glyph}";
9+
[data-icon-after="#{$icon-name}"] {
10+
--icon-glyph-after: "#{$icon-glyph}";
1311
}
1412
}

source/_patterns/00-base/icons/_icons.helpers.scss

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
) {
99
// We're setting this on the parent tag, so that it could get overwritten via data-icon=*
1010
@if $glyph != "" {
11-
--icon-glyph: "#{$glyph}";
11+
--icon-glyph-#{$position}: "#{$glyph}";
1212
}
1313

1414
&::#{$position} {
@@ -30,8 +30,9 @@
3030
);
3131
}
3232

33+
content: var(--icon-glyph-#{$position});
34+
3335
@if $partial {
34-
content: var(--icon-glyph);
3536
display: inline-block;
3637
/*** icon - partial ***/
3738
// * use !important to prevent issues with browser extensions that change fonts

source/_patterns/00-base/icons/icons.scss

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
[data-icon-before] {
1212
&::before {
1313
@extend %icon;
14+
content: var(--icon-glyph-before);
1415
margin-inline-end: var(--icon-margin-after, #{$icon-content-space});
1516
font-size: var(
1617
--icon-font-size-before,
@@ -22,6 +23,7 @@
2223
[data-icon-after] {
2324
&::after {
2425
@extend %icon;
26+
content: var(--icon-glyph-after);
2527
margin-inline-start: var(--icon-margin-before, #{$icon-content-space});
2628
font-size: var(
2729
--icon-font-size-after,

0 commit comments

Comments
 (0)