csstype icon indicating copy to clipboard operation
csstype copied to clipboard

CSS Typed OM support

Open MrFoxPro opened this issue 3 years ago • 1 comments

https://developer.chrome.com/blog/cssom/

https://ishoudinireadyyet.com/

https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/w3c-css-typed-object-model-level-1

style={{
   width: CSS.percent(100),
   height: CSS.percent(100),
}} // <- this is valid in Chromium

/* Type 'CSSUnitValue' is not assignable to type 'Width<0 | (string & {})>'.
  Type 'CSSUnitValue' is not assignable to type 'string & {}'.
    Type 'CSSUnitValue' is not assignable to type 'string'. */

MrFoxPro avatar Nov 15 '22 11:11 MrFoxPro

As I understand it's possible right now with Generics:

csstype.PropertiesHyphen<CSSUnitValue | 0 | (string & {})>

Is it correct?

MrFoxPro avatar Nov 15 '22 12:11 MrFoxPro