Ensure icon size is applied just to outer SVG (#458)

Due to changes in chrome (https://issues.chromium.org/issues/40409865),
width and height presentation attributes within nested SVGs are now
respected, which breaks icons styling in RWP. This fixes that by
ensuring that the styling that sets width and height on the outer icon
SVG _only_ applies to the outer SVG, allowing the inner SVG's
intrinsic/declared size to be respected properly.

Tested in latest chrome, firefox, and safari on macos.

Fixes #457
This commit is contained in:
Emma Segal-Grossman
2025-10-03 12:30:55 -07:00
committed by GitHub
parent fc6daf131d
commit 3660c3b89e
+1 -1
View File
@@ -85,7 +85,7 @@ class FaIcon extends LitElement {
margin: 0;
line-height: 1em;
}
:host svg {
:host > svg {
fill: var(--fa-icon-fill-color, currentcolor);
width: var(--fa-icon-width, 19px);
height: var(--fa-icon-height, 19px);