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

Support for containerType CSS Prop Typing & Other Container Query Properties #3001

Closed
KoltonG opened this issue Feb 20, 2023 · 2 comments
Closed

Comments

@KoltonG
Copy link

KoltonG commented Feb 20, 2023

Current behaviour:

When attempting to use the containerType property to use CSS Container Queries, I get a Typescript error and no typing support.

<div
  css={{
    containerType: "inline-size"
  }}
></div>

To reproduce:

  1. Go to https://codesandbox.io/s/emotion-issue-template-forked-nqo492?file=/src/App.tsx
  2. Attempt to cmd+click on the containerType property and see that there is no TS support. Note that on my local VS Code, Typescript red lines show and when running tsc it will fail.

Expected behavior:

The expected behaviour is that the css prop would have support for the containerType and other CSS Container Query properties and values.

Environment information:

  • react version: 18.2.0
  • @emotion/react version: 11.10.6
@Andarist
Copy link
Member

We are using csstype package to get all of those types. Please report it there.

@KoltonG
Copy link
Author

KoltonG commented Feb 20, 2023

Thanks @Andarist for the reply! I've reported this issue with the csstype team and it seems that it will be a larger refactor to their repo than anticipated to support CSS Container Queries.

See frenic/csstype#175

In the mean time, I found that you can still write it without typing support and it will work and also use the @container syntax within ["@container ..."]: {} syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants