Skip to content

Commit

Permalink
🔨 make halo work in Figma
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Feb 6, 2025
1 parent 2dbaed9 commit 96b4aaf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/@ourworldindata/components/src/Halo/Halo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const defaultHaloStyle: React.CSSProperties = {
stroke: "#fff",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: ".25em",
userSelect: "none",
}

Expand All @@ -22,6 +21,11 @@ export function Halo(props: {

const defaultStyle = {
...defaultHaloStyle,
// Figma doesn't support stroke widths using ems, so we use pixels
// if we can and fallback to ems if we can't
strokeWidth: props.children.props.fontSize
? props.children.props.fontSize * 0.25
: ".25em",
fill: props.outlineColor ?? defaultHaloStyle.fill,
stroke: props.outlineColor ?? defaultHaloStyle.stroke,
}
Expand Down

0 comments on commit 96b4aaf

Please sign in to comment.