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

[core] Bug when trying to wrap the styled function #21

Open
mladenkn opened this issue Apr 18, 2024 · 1 comment
Open

[core] Bug when trying to wrap the styled function #21

mladenkn opened this issue Apr 18, 2024 · 1 comment
Assignees
Labels
enhancement This is not a bug, nor a new feature new feature New feature or request status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it

Comments

@mladenkn
Copy link

mladenkn commented Apr 18, 2024

Steps to reproduce

Links to live example:
Next.JS: https://stackblitz.com/edit/stackblitz-starters-e6kyr6?description=The%20React%20framework%20for%20production&file=app%2Fpage.tsx&title=Next.js%20Starter
Vite: https://stackblitz.com/edit/vitejs-vite-14nhvq?file=src%2FApp.tsx

Steps: just click the link and let the app start.

Current behavior

There appears to be a bug when trying to wrap styled function from "@pigment-css/react".

Here's the screenshot from Vite environment
image

Expected behavior

The CSS should be applied to the element.

Context

I am trying to have a simple wrapper for styled function from "@pigment-css/react".

Since it doesn't work, I'm wondering whether is it a bug or is it simply not supported?

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 wrapper

@mladenkn mladenkn added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 18, 2024
@brijeshb42
Copy link
Contributor

At this moment, it is expected and not a bug, though we might need to customize the error message to better convey that.
You can not customise the styled function since it needs to be called at the root scope of the file for better static analysis. We maybe able to provide an option to use your own styled definition if we get enough requests.

@brijeshb42 brijeshb42 added new feature New feature or request status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it enhancement This is not a bug, nor a new feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 18, 2024
@danilo-leal danilo-leal transferred this issue from mui/material-ui Apr 18, 2024
@danilo-leal danilo-leal changed the title Wrapper for Pigment CSS [core] Bug when trying to wrap the styled function Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is not a bug, nor a new feature new feature New feature or request status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it
Projects
None yet
Development

No branches or pull requests

2 participants