diff --git a/client/src/utils/__tests__/svg.test.ts b/client/src/utils/__tests__/svg.test.ts
index 4e5050d1c0..6ac459b78e 100644
--- a/client/src/utils/__tests__/svg.test.ts
+++ b/client/src/utils/__tests__/svg.test.ts
@@ -342,6 +342,24 @@ describe('isMonochromeSvg', () => {
'';
expect(isMonochromeSvg(svg)).toBe(false);
});
+
+ it('preserves a nested-use currentColor glyph fixed by the outer use color', () => {
+ const svg =
+ '';
+ expect(isMonochromeSvg(svg)).toBe(false);
+ });
+
+ it('preserves a nested-use currentColor glyph fixed by the inner use color', () => {
+ const svg =
+ '';
+ expect(isMonochromeSvg(svg)).toBe(false);
+ });
+
+ it('tints a nested-use currentColor glyph with no fixed color at any use', () => {
+ const svg =
+ '';
+ expect(isMonochromeSvg(svg)).toBe(true);
+ });
});
describe('paint set on non-rendering containers', () => {
diff --git a/client/src/utils/svg.ts b/client/src/utils/svg.ts
index 77798517c5..29f6b8f980 100644
--- a/client/src/utils/svg.ts
+++ b/client/src/utils/svg.ts
@@ -332,55 +332,85 @@ function resolveCurrentColor(el: Element, boundary: Element, rules: StyleRule[])
return CURRENT_COLOR;
}
+/**
+ * The fixed color a `currentColor` paint resolves to for one instantiation chain.
+ * The chain lists the `