Skip to content

Commit b2f0149

Browse files
authored
Improved vertical positioning for svg text icons (#3056)
* Replaced dominant-baseline="central" with dy="0.35em" to improve vertical positioning for svg text icons
1 parent acc2f4d commit b2f0149

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/lib/output/themes/default/partials/icon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const kindIcon = (letterPath: JSX.Element, color: string, label: TranslatedStrin
2424

2525
const textIcon = (letter: string, color: string, label: TranslatedString, circular = false) =>
2626
kindIcon(
27-
<text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">
27+
<text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">
2828
{letter}
2929
</text>,
3030
color,

src/lib/utils-common/jsx.elements.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,7 @@ export interface JsxSvgPresentationProps {
952952
| "mathematical"
953953
| "hanging"
954954
| "text-top";
955+
dy?: string;
955956
fill?: string;
956957
"fill-opacity"?: number;
957958
"fill-rule"?: "nonzero" | "evenodd";

0 commit comments

Comments
 (0)