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

CSSObject<Props> Requires css-defined keys #283

Open
FourwingsY opened this issue Oct 21, 2024 · 0 comments
Open

CSSObject<Props> Requires css-defined keys #283

FourwingsY opened this issue Oct 21, 2024 · 0 comments
Assignees
Labels
customization: css Design CSS customizability customization: theme Centered around the theming features status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@FourwingsY
Copy link

FourwingsY commented Oct 21, 2024

Steps to reproduce

add this kinds of things throws type error.

  variants: [
    {
      props: { focused: true },
      style: {
        '--label-color': theme.colors.primary70,
        '--border-color': theme.colors.primary70,
      },
    },
  ]

Current behavior

'--label-color': string is inferred as CSSOthersObject
which is { [selector: string]: CSSObject<Props>; }

Warning saids, theme.colors.primary70 is not an CSSObject<Props>

While, if I put some valid css keys with it,

  variants: [
    {
      props: { focused: true },
      style: {
        textIndent: 0,  // <<<
        '--label-color': theme.colors.primary70,
        '--border-color': theme.colors.primary70,
      },
    },
  ]

Type error disappears.

Expected behavior

'--label-color': string should be accepted as a valid key and value without other css properties.

Context

No response

Your environment

in VSCode

Search keywords: css, style, CSSObject, key

@FourwingsY FourwingsY added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 21, 2024
@zannager zannager added customization: theme Centered around the theming features customization: css Design CSS customizability labels Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customization: css Design CSS customizability customization: theme Centered around the theming features status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants