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

@mui/material-pigment-css useTheme: theme has no spacing property #43803

Closed
bmakan opened this issue Sep 18, 2024 · 3 comments · May be fixed by #44137
Closed

@mui/material-pigment-css useTheme: theme has no spacing property #43803

bmakan opened this issue Sep 18, 2024 · 3 comments · May be fixed by #44137
Assignees
Labels
docs Improvements or additions to the documentation package: pigment-css Specific to @pigment-css/* status: waiting for author Issue with insufficient information

Comments

@bmakan
Copy link

bmakan commented Sep 18, 2024

Steps to reproduce

Link to live example: CodeSandbox
(Sandbox not working, but downloading the sandbox code and running it locally works. Not sure what's going on.)

Steps:

  1. Download sandbox and unzip.
  2. bun install
  3. bun run vite
  4. open browser and check the console log for the theme - there's no spacing property in it.

Current behavior

When using the theme from import { useTheme } from "@mui/material-pigment-css";, the theme object has no spacing property. The property is present when using the import { useTheme } from "@mui/material/styles";.

Expected behavior

The theme object should have a spacing property.

Context

No response

Your environment

npx @mui/envinfo
  System:
    OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
  Binaries:
    Node: 20.12.2 - /usr/bin/node
    npm: 10.5.0 - /usr/bin/npm
    pnpm: Not Found
  Browsers:
    Edge: Version 128.0.2739.79 (Official build) (64-bit)
  npmPackages:
    @emotion/react:  11.13.3 
    @emotion/styled:  11.13.0 
    @mui/core-downloads-tracker:  6.1.0 
    @mui/material: 6.1.0 => 6.1.0 
    @mui/material-pigment-css: 6.1.0 => 6.1.0 
    @mui/private-theming:  6.1.0 
    @mui/styled-engine:  6.1.0 
    @mui/system:  6.1.0 
    @mui/types:  7.2.16 
    @mui/utils:  6.1.0 
    @pigment-css/react: 0.0.22 => 0.0.22 
    @pigment-css/vite-plugin: 0.0.22 => 0.0.22 
    @types/react: ^18.2.65 => 18.3.7 
    react: ^18.2.0 => 18.3.1 
    react-dom: ^18.2.0 => 18.3.1 
    typescript: ^5.4.2 => 5.6.2 

Search keywords: pigmentcss theme spacing

@bmakan bmakan added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 18, 2024
@zannager zannager added the package: pigment-css Specific to @pigment-css/* label Sep 18, 2024
@mc-dsk
Copy link

mc-dsk commented Sep 26, 2024

Same for shadows

@siriwatknp
Copy link
Member

siriwatknp commented Oct 17, 2024

The goal of Pigment is to remove calling theme at runtime. Can you share what's your use case for getting the theme at runtime?

The proper way is to use the generated CSS variables:

spacing is available as --mui-spacing or theme.vars.spacing
shadow is avaiable as --mui-shadows-<number> or theme.vars.shadows[number]

@siriwatknp siriwatknp added status: waiting for author Issue with insufficient information docs Improvements or additions to the documentation and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 17, 2024
Copy link

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation package: pigment-css Specific to @pigment-css/* status: waiting for author Issue with insufficient information
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants