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

[pigment-css] Box does not create styles #41704

Closed
siriwatknp opened this issue Mar 29, 2024 · 1 comment · Fixed by #41705
Closed

[pigment-css] Box does not create styles #41704

siriwatknp opened this issue Mar 29, 2024 · 1 comment · Fixed by #41705
Assignees
Labels
bug 🐛 Something doesn't work package: pigment-css Specific to @pigment-css/* typescript

Comments

@siriwatknp
Copy link
Member

siriwatknp commented Mar 29, 2024

Steps to reproduce

Steps:

  1. start with a fresh Next.js project using the official CLI
  2. set up Pigment
  3. import { Box } and render with sx={{ background: 'red' }}

Current behavior

No styles are created

// page.tsx
import {Box} from '@pigment-css/react/Box';

<Box sx={{ background: 'red', fontSize: '1rem'}}>
image

Expected behavior

There should be styles

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: pigment css box

@siriwatknp siriwatknp added bug 🐛 Something doesn't work package: pigment-css Specific to @pigment-css/* labels Mar 29, 2024
@siriwatknp
Copy link
Member Author

@brijeshb42 Also, the import looks inconsistent.

Current:

import { Box } from '@pigment-css/react/Box';
 import Box from '@pigment-css/react/Box';
 import { Box } from '@pigment-css/react';

Expected:

import { Box } from '@pigment-css/react';

@brijeshb42 brijeshb42 self-assigned this Mar 29, 2024
brijeshb42 added a commit to brijeshb42/material-ui that referenced this issue Mar 29, 2024
This current fix is very crude and does not handle the case when a user
might have their own wrapper component over Box and they'll be passing
sx prop through the component.

Also made `Box` as a default import instead of name import.

Fixes mui#41704
brijeshb42 added a commit to brijeshb42/material-ui that referenced this issue Mar 29, 2024
This current fix is very crude and does not handle the case when a user
might have their own wrapper component over Box and they'll be passing
sx prop through the component.

Also made `Box` as a default import instead of name import.

Fixes mui#41704
brijeshb42 added a commit to brijeshb42/material-ui that referenced this issue Apr 1, 2024
This current fix is very crude and does not handle the case when a user
might have their own wrapper component over Box and they'll be passing
sx prop through the component.

Also made `Box` as a default import instead of name import.

Fixes mui#41704
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work package: pigment-css Specific to @pigment-css/* typescript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants