Skip to content

Commit

Permalink
fix(odyssey-react-mui): strip units from borderRadiusBase
Browse files Browse the repository at this point in the history
  • Loading branch information
edburyenegren-okta committed Oct 11, 2022
1 parent 33058a6 commit 267d82a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/odyssey-react-mui/src/themes/odyssey/shape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
import type { ThemeOptions } from "@mui/material";
import * as Tokens from "@okta/odyssey-design-tokens";

// Strip units from BorderRadiusBase to accommodate MUI's typing
const StrippedBorderRadiusBase =
typeof Tokens.BorderRadiusBase === "string"
? Tokens.BorderRadiusBase.replace(/\D/g, "")
: Tokens.BorderRadiusBase;

export const shape: ThemeOptions["shape"] = {
borderRadius: parseInt(Tokens.BorderRadiusBase, 10),
borderRadius: StrippedBorderRadiusBase,
};

0 comments on commit 267d82a

Please sign in to comment.