Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tonalOffset as object crashed when used with cssVariables #44573

Closed
synedra-mpe opened this issue Nov 27, 2024 · 1 comment · Fixed by #44585
Closed

tonalOffset as object crashed when used with cssVariables #44573

synedra-mpe opened this issue Nov 27, 2024 · 1 comment · Fixed by #44585
Assignees
Labels
bug 🐛 Something doesn't work customization: css Design CSS customizability v6.x

Comments

@synedra-mpe
Copy link

synedra-mpe commented Nov 27, 2024

Steps to reproduce

Steps:

  1. Open this link to live example: https://stackblitz.com/edit/xsaqnx?file=Demo.tsx (forked from https://mui.com/material-ui/customization/palette/#tonal-offset)
  2. See "color.startsWith is not a function error"

Current behavior

App crashes with error:
Error in /turbo_modules/@mui/[email protected]/node/styles/createThemeWithVars.js (35:24)
color.startsWith is not a function

Expected behavior

Show the the same output as in https://mui.com/material-ui/customization/palette/#tonal-offset but also have css variables.

Context

Make custom palette with given primary color and make use of object tonalOffset and cssVariables: true.

Your environment

npx @mui/envinfo
  System:
    OS: Linux 6.11 Fedora Linux 41 (Workstation Edition)
  Binaries:
    Node: 20.12.2 - ~/devel/repository/tool/linux/script/node
    npm: 10.9.0 - /usr/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: 131.0.6778.85
  npmPackages:
    @emotion/react: ^11.13.3 => 11.13.3 
    @emotion/styled: ^11.13.0 => 11.13.0 
    @mui/base:  5.0.0-beta.61 
    @mui/core-downloads-tracker:  6.1.7 
    @mui/icons-material: ^6.1.7 => 6.1.7 
    @mui/lab: 6.0.0-beta.15 => 6.0.0-beta.15 
    @mui/material: ^6.1.7 => 6.1.7 
    @mui/private-theming:  6.1.7 
    @mui/styled-engine:  6.1.7 
    @mui/system:  6.1.7 
    @mui/types:  7.2.19 
    @mui/utils:  6.1.7 
    @types/react:  18.2.42 
    react: ^18.2.0 => 18.2.0 
    react-dom: ^18.2.0 => 18.2.0 

Search keywords: tonalOffset cssVariables palette customizateion

@synedra-mpe synedra-mpe added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 27, 2024
@zannager zannager added the customization: css Design CSS customizability label Nov 27, 2024
@siriwatknp siriwatknp added bug 🐛 Something doesn't work v6.x and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 28, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@synedra-mpe How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work customization: css Design CSS customizability v6.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants