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

Missing type export? #77

Open
oliviertassinari opened this issue May 11, 2024 · 0 comments
Open

Missing type export? #77

oliviertassinari opened this issue May 11, 2024 · 0 comments
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer typescript

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented May 11, 2024

Steps to reproduce

I'm trying to type:

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

const mystye = css({
  color: '#fff',
  // position: 'initial' works
  position: 'initial !important',
  backgroundColor: '#000',
});

export default function Home() {
  return <main className={mystye}>mystye</main>;
}

https://stackblitz.com/edit/github-vfcqdf?file=src%2FApp.tsx

but I struggle to. I have tried React.CSSProperties but it doesn't work, which makes sense, this type is meant for the style prop.

Current behavior

I see 3 distinct things:

  1. I can't find reexported types from Pigment CSS that I can use.
SCR-20240511-uerp

Should types around here be exported?

export type CSSObject<Props extends object> =

  1. Should !important work outside of the box? Like it does with @mui/system. Proof: https://codesandbox.io/p/sandbox/patient-cloud-xykphn?file=%2Fsrc%2FDemo.tsx%3A5%2C3.

  2. Shouldn't the error be flagged on the property that is wrong and not the first property?

Expected behavior

No response

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: -

@oliviertassinari oliviertassinari added status: waiting for maintainer These issues haven't been looked at yet by a maintainer typescript labels May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer typescript
Projects
None yet
Development

No branches or pull requests

1 participant