styled-components / xstyled

A utility-first CSS-in-JS framework built for React. 💅👩‍🎤⚡️
https://xstyled.dev
MIT License
2.28k stars 105 forks source link

Fix wrong type for ThemeVariants #301

Closed yamitzky closed 3 years ago

yamitzky commented 3 years ago

Summary

Currently, auto-completion for responsive and states utility does not work. This is due to an error in the ThemeVariants type. The current ThemeVariants definition is { _: number; xs: number, ... } | { _: null; hover: string; ... }, which is actually treated as never . To fix this, it is necessary to remove the inconsistency of _ and join them with & .

Original:

image

FIxed:

image

netlify[bot] commented 3 years ago

‼️ Deploy request for xstyled rejected. Learn more about Netlify's sensitive variable policy

🔨 Explore the source changes: 79d65b4d366ad9fa6923e1e0accb612386175e2b

codecov[bot] commented 3 years ago

Codecov Report

Merging #301 (79d65b4) into main (d5db56b) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #301   +/-   ##
=======================================
  Coverage   92.74%   92.74%           
=======================================
  Files          60       60           
  Lines        1255     1255           
  Branches      244      244           
=======================================
  Hits         1164     1164           
  Misses         91       91           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d5db56b...79d65b4. Read the comment docs.

gregberge commented 3 years ago

Thanks!