Skip to content

Wrong type ThemeOptions.shape.borderRadius #46128

@joaogardenberg

Description

@joaogardenberg

Steps to reproduce

It's not something reproduceable, it's just wrong typing.

Current behavior

Currently, the shape's borderRadius property is described as number:

Image

Expected behavior

It should be number | string, as stuff like 1rem, 1em, 5%, 5vh and 5vw work alright.

Image

Context

Would prevent getting errors like this when setting up the theme:

Image

(yes, this works)

Your environment

npx @mui/envinfo
  System:
    OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
  Binaries:
    Node: 22.11.0 - /usr/bin/node
    npm: 10.9.0 - /usr/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: Not Found
  npmPackages:
    @mui/core-downloads-tracker:  7.1.0 
    @mui/icons-material: ^7.1.0 => 7.1.0 
    @mui/material: ^7.1.0 => 7.1.0 
    @mui/private-theming:  7.1.0 
    @mui/styled-engine:  7.1.0 
    @mui/styled-engine-sc: ^7.1.0 => 7.1.0 
    @mui/system:  7.1.0 
    @mui/types:  7.4.2 
    @mui/utils:  7.1.0 
    @types/react: ^19.1.3 => 19.1.3 
    react: ^19.1.0 => 19.1.0 
    react-dom: ^19.1.0 => 19.1.0 
    styled-components: ^6.1.18 => 6.1.18 
    typescript: ~5.8.3 => 5.8.3 

Search keywords: typescript borderRadius type string number

Metadata

Metadata

Assignees

No one assigned

    Labels

    customization: themeCentered around the theming featurespackage: systemSpecific to @mui/systemready to takeHelp wanted. Guidance available. There is a high chance the change will be acceptedtypescript

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions