Skip to content

Commit

Permalink
perf: update SVGs to support new token name spec #211
Browse files Browse the repository at this point in the history
This commit reverts the revert for using the new Auro design token name
spec. The revert happened due to a side-effect with auro-icon and the
customSize feature. The auro-icon element was updated to allow for more
flexibility in token use.

See AlaskaAirlines/auro-icon#95

This update includes a solution that applies a variable with a variable
fallback with a hard value fallback. The --auro token was specifically
listed first as this is an order of expectation from in-the-wild auro
elements using the legacy --auro token.

It has been verified that regardless of version of tokens a
consumer has installed, or none at all, the customSize feature will work
as expected.

Changes to be committed:
modified:   src/_icons.scss
modified:   src/data/icons.json
  • Loading branch information
blackfalcon committed Oct 12, 2023
1 parent 4cabeb8 commit e737da2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ $iconMap: (
// Square large
.ico_squareLarge {
fill: currentColor;
height: $auro-size-lg;
height: var(--auro-size-lg, var(--ds-size-300, 1.5rem))
}

.ico_squareSmall {
Expand All @@ -52,11 +52,12 @@ $iconMap: (
.ico_squareMed {
fill: currentColor;
height: $auro-size-md;
height: var(--auro-size-md, var(--ds-size-200, 1rem));
}

.ico_squareSml {
fill: currentColor;
height: $auro-size-sm;
height: var(--auro-size-sm, var(--ds-size-150, 0.75rem));
}


Expand All @@ -67,7 +68,7 @@ $iconMap: (
.ico__classiccheckmark {
@if (map-get($iconMap, classiccheckmark)) {
fill: currentColor;
width: $auro-size-md;
width: var(--auro-size-md, var(--ds-size-200, 1rem));
@warn "selector 'ico__toggleArrow' is deprecated, discontinue use.";
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/data/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"color": "currentColor",
"title": "",
"desc": "",
"width": "var(--auro-size-lg)",
"height": "var(--auro-size-lg)",
"width": "var(--auro-size-lg, var(--ds-size-300, 1.5rem))",
"height": "var(--auro-size-lg, var(--ds-size-300, 1.5rem))",
"xmlns": "http://www.w3.org/2000/svg",
"xmlns_xlink": "http://www.w3.org/1999/xlink",
"viewBox": "0 0 24 24",
Expand Down

0 comments on commit e737da2

Please sign in to comment.